| author | nipkow |
| Thu, 26 Jun 1997 13:20:50 +0200 | |
| changeset 3465 | e85c24717cad |
| parent 3375 | d9b30c300f1e |
| child 3494 | f7ac2d1e2051 |
| 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 |
||
6 |
Fibonacci numbers and other simple examples of recursive definitions |
|
7 |
(the TFL package) |
|
8 |
*) |
|
9 |
||
| 3375 | 10 |
Fib = WF_Rel + Divides + |
| 3300 | 11 |
|
12 |
consts fib :: "nat => nat" |
|
13 |
recdef fib "less_than" |
|
14 |
"fib 0 = 0" |
|
15 |
"fib 1 = 1" |
|
16 |
"fib (Suc(Suc x)) = (fib x + fib (Suc x))" |
|
17 |
||
18 |
end |