src/HOL/NumberTheory/Fib.thy
author wenzelm
Fri, 17 Nov 2000 18:47:15 +0100
changeset 10480 76dedf65408f
parent 10147 178deaacb244
child 11049 7eef34adb852
permissions -rw-r--r--
Library/Ring_and_Field.thy;

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