src/HOL/NumberTheory/Fib.thy
author nipkow
Fri, 24 Nov 2000 16:49:27 +0100
changeset 10519 ade64af4c57c
parent 10147 178deaacb244
child 11049 7eef34adb852
permissions -rw-r--r--
hide many names from Datatype_Universe.

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