]> matita.cs.unibo.it Git - helm.git/commitdiff
a module was missing .........
authorFerruccio Guidi <ferruccio.guidi@unibo.it>
Sat, 30 Oct 2010 13:03:34 +0000 (13:03 +0000)
committerFerruccio Guidi <ferruccio.guidi@unibo.it>
Sat, 30 Oct 2010 13:03:34 +0000 (13:03 +0000)
helm/software/lambda-delta/src/common/level.ml [new file with mode: 0644]
helm/software/lambda-delta/src/common/level.mli [new file with mode: 0644]

diff --git a/helm/software/lambda-delta/src/common/level.ml b/helm/software/lambda-delta/src/common/level.ml
new file mode 100644 (file)
index 0000000..d33c1be
--- /dev/null
@@ -0,0 +1,37 @@
+(*
+    ||M||  This file is part of HELM, an Hypertextual, Electronic        
+    ||A||  Library of Mathematics, developed at the Computer Science     
+    ||T||  Department, University of Bologna, Italy.                     
+    ||I||                                                                
+    ||T||  HELM is free software; you can redistribute it and/or         
+    ||A||  modify it under the terms of the GNU General Public License   
+    \   /  version 2 or (at your option) any later version.              
+     \ /   This software is distributed as is, NO WARRANTY.              
+      V_______________________________________________________________ *)
+
+type level = int option
+
+(* Interface functions ******************************************************)
+
+let infinite = None
+
+let finite i = Some i
+
+let is_zero xi = 
+   xi = (Some 0)
+
+let is_infinite xi =
+   xi = None
+
+let succ = function
+   | None   -> None
+   | Some i -> Some (succ i)
+
+let pred = function
+   | None              -> None
+   | Some i when i > 0 -> Some (pred i)
+   | _                 -> Some 0
+
+let to_string = function
+   | None   -> ""
+   | Some i -> string_of_int i
diff --git a/helm/software/lambda-delta/src/common/level.mli b/helm/software/lambda-delta/src/common/level.mli
new file mode 100644 (file)
index 0000000..70a49d5
--- /dev/null
@@ -0,0 +1,26 @@
+(*
+    ||M||  This file is part of HELM, an Hypertextual, Electronic        
+    ||A||  Library of Mathematics, developed at the Computer Science     
+    ||T||  Department, University of Bologna, Italy.                     
+    ||I||                                                                
+    ||T||  HELM is free software; you can redistribute it and/or         
+    ||A||  modify it under the terms of the GNU General Public License   
+    \   /  version 2 or (at your option) any later version.              
+     \ /   This software is distributed as is, NO WARRANTY.              
+      V_______________________________________________________________ *)
+
+type level
+
+val infinite: level
+
+val finite: int -> level
+
+val is_zero: level -> bool
+
+val is_infinite: level -> bool
+
+val succ: level -> level
+
+val pred: level -> level
+
+val to_string: level -> string