src/HOL/ex/Fib.thy
author wenzelm
Mon, 17 Jul 2000 21:44:39 +0200
changeset 9380 63cca60b2cce
parent 8658 3cf533397c5a
permissions -rw-r--r--
consts: include *all* names;

(*  Title:      ex/Fib
    ID:         $Id$
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
    Copyright   1997  University of Cambridge

The Fibonacci function.  Demonstrates the use of recdef.
*)

Fib = Divides + Primes +

consts fib  :: "nat => nat"
recdef fib "less_than"
  zero    "fib 0 = 0"
  one     "fib 1 = 1"
  Suc_Suc "fib (Suc (Suc x)) = fib x + fib (Suc x)"

end