src/HOL/NumberTheory/Fib.thy
changeset 9944 2a705d1af4dc
child 10147 178deaacb244
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/HOL/NumberTheory/Fib.thy	Wed Sep 13 18:46:45 2000 +0200
     1.3 @@ -0,0 +1,17 @@
     1.4 +(*  Title:      ex/Fib
     1.5 +    ID:         $Id$
     1.6 +    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     1.7 +    Copyright   1997  University of Cambridge
     1.8 +
     1.9 +The Fibonacci function.  Demonstrates the use of recdef.
    1.10 +*)
    1.11 +
    1.12 +Fib = Divides + Primes +
    1.13 +
    1.14 +consts fib  :: "nat => nat"
    1.15 +recdef fib "less_than"
    1.16 +  zero    "fib 0 = 0"
    1.17 +  one     "fib 1 = 1"
    1.18 +  Suc_Suc "fib (Suc (Suc x)) = fib x + fib (Suc x)"
    1.19 +
    1.20 +end