From bc135dc59cac6ddd2b18d62bf45371133b80aab3 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Thu, 21 Feb 2008 19:03:09 +0000 Subject: [PATCH] A new very simple example for recursive functions. Still bugged, but getting better. --- helm/software/components/ng_kernel/test.ma | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/helm/software/components/ng_kernel/test.ma b/helm/software/components/ng_kernel/test.ma index 95c919854..ff017315c 100644 --- a/helm/software/components/ng_kernel/test.ma +++ b/helm/software/components/ng_kernel/test.ma @@ -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 -- 2.39.2