]> matita.cs.unibo.it Git - helm.git/commitdiff
A new very simple example for recursive functions. Still bugged, but getting
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 21 Feb 2008 19:03:09 +0000 (19:03 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 21 Feb 2008 19:03:09 +0000 (19:03 +0000)
better.

helm/software/components/ng_kernel/test.ma

index 95c919854b46a9d6ed96ad5d71c4cad4555ca702..ff017315c685abc8b3b177565e65e8fe9eb93b23 100644 (file)
@@ -14,6 +14,7 @@
 
 include "nat/plus.ma".
 
+(*
 let rec f n := 
   match n with
   [ O => O
@@ -28,4 +29,16 @@ let rec f n :=
                   in
                     h q] 
            in 
-             g m].
\ No newline at end of file
+             g m].
+*)
+
+let rec f n := 
+  match n with
+  [ O => O
+  | S m => g m
+  ]
+and g m :=
+ match m with
+  [ O => O
+  | S n => f n
+  ].
\ No newline at end of file