From dcf99fd7ebf54474ea6d81ced6e00c28fba614fa Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Mon, 24 Oct 2022 08:48:36 +0200 Subject: add maude & ATS --- entries/lizard-business/fib.maude | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 entries/lizard-business/fib.maude (limited to 'entries/lizard-business/fib.maude') diff --git a/entries/lizard-business/fib.maude b/entries/lizard-business/fib.maude new file mode 100644 index 0000000..20bc428 --- /dev/null +++ b/entries/lizard-business/fib.maude @@ -0,0 +1,27 @@ +smod FIB is + pr LIST{Nat} . + + vars M N : Nat . + var Ns : List{Nat} . + + rl [start]: nil => 0 1 . + rl [next]: Ns M N => Ns M N (M + N) . + rl [drop] : Ns N => N . + + strats fib fibgo : Nat @ List{Nat} . + sd fib(N) := start ; fibgo(N) . + sd fibgo(0) := top(drop) . + sd fibgo(s(N)) := top(next) ; fibgo(N) . +endsm + +***( + Maude> srew nil using fib(10) . + srewrite in FIB : nil using fib(10) . + + Solution 1 + rewrites: 8330 in 12ms cpu (12ms real) (694166 rewrites/second) + result NzNat: 89 + + No more solutions. + rewrites: 8469 in 12ms cpu (13ms real) (705750 rewrites/second) +) -- cgit v1.2.3-70-g09d2