src/HOL/ex/NatSum.thy
author paulson
Thu, 25 Sep 1997 12:24:53 +0200
changeset 3712 242546f35f8e
parent 3269 eca2a3634acd
child 5184 9b8547a9496a
permissions -rw-r--r--
Deleted the unused gtake and recoded enumerate to use foldl

(*  Title:      HOL/ex/natsum.thy
    ID:         $Id$
    Author:     Tobias Nipkow
    Copyright   1994 TU Muenchen

A summation operator. sum(f,n+1) is the sum of all f(i), i=0...n.
*)

NatSum = Arith +
consts sum     :: [nat=>nat, nat] => nat
primrec "sum" nat 
  "sum f 0 = 0"
  "sum f (Suc n) = f(n) + sum f n"

end