| author | wenzelm |
| Sat, 18 Nov 2000 19:48:34 +0100 | |
| changeset 10495 | 284ee538991c |
| parent 9647 | e9623f47275b |
| child 12867 | 5c900a821a7c |
| permissions | -rw-r--r-- |
(* Title: HOL/ex/Natsum.thy ID: $Id$ Author: Tobias Nipkow & Lawrence C Paulson A summation operator. sum(f,n+1) is the sum of all f(i), i=0...n. Note: n is a natural number but the sum is an integer, and f maps integers to integers *) NatSum = Main + consts sum :: [i=>i, i] => i primrec "sum (f,0) = #0" "sum (f, succ(n)) = f($#n) $+ sum(f,n)" end