src/HOL/ex/Fib.thy
author wenzelm
Tue, 25 Jul 2000 00:06:46 +0200
changeset 9436 62bb04ab4b01
parent 8658 3cf533397c5a
permissions -rw-r--r--
rearranged setup of arithmetic procedures, avoiding global reference values;

(*  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