src/HOL/ex/NatSum.thy
author paulson
Mon, 08 May 2000 16:59:18 +0200
changeset 8836 32fe62227ff0
parent 8356 14d89313c66c
permissions -rw-r--r--
new example

(*  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 = Main +
consts sum     :: [nat=>nat, nat] => nat
primrec 
  sum_0    "sum f 0 = 0"
  sum_Suc  "sum f (Suc n) = f(n) + sum f n"

end