author | wenzelm |
Sat, 02 Sep 2000 21:56:24 +0200 | |
changeset 9811 | 39ffdb8cab03 |
parent 8658 | 3cf533397c5a |
permissions | -rw-r--r-- |
3300 | 1 |
(* Title: ex/Fib |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1997 University of Cambridge |
|
5 |
||
3494 | 6 |
The Fibonacci function. Demonstrates the use of recdef. |
3300 | 7 |
*) |
8 |
||
6481 | 9 |
Fib = Divides + Primes + |
3300 | 10 |
|
11 |
consts fib :: "nat => nat" |
|
12 |
recdef fib "less_than" |
|
8658 | 13 |
zero "fib 0 = 0" |
14 |
one "fib 1 = 1" |
|
15 |
Suc_Suc "fib (Suc (Suc x)) = fib x + fib (Suc x)" |
|
3300 | 16 |
|
17 |
end |