src/HOL/ex/NatSum.thy
author nipkow
Mon, 03 Nov 1997 08:08:14 +0100
changeset 4069 d6d06a03a2e9
parent 3269 eca2a3634acd
child 5184 9b8547a9496a
permissions -rw-r--r--
expand_list_case -> split_list_case
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1476
608483c2122a expanded tabs; incorporated Konrad's changes
clasohm
parents: 1376
diff changeset
     1
(*  Title:      HOL/ex/natsum.thy
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1476
608483c2122a expanded tabs; incorporated Konrad's changes
clasohm
parents: 1376
diff changeset
     3
    Author:     Tobias Nipkow
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     4
    Copyright   1994 TU Muenchen
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     5
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     6
A summation operator. sum(f,n+1) is the sum of all f(i), i=0...n.
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     7
*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     8
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     9
NatSum = Arith +
1376
92f83b9d17e1 removed quotes from consts and syntax sections
clasohm
parents: 969
diff changeset
    10
consts sum     :: [nat=>nat, nat] => nat
3269
eca2a3634acd Function "sum" now defined using primrec
paulson
parents: 1476
diff changeset
    11
primrec "sum" nat 
eca2a3634acd Function "sum" now defined using primrec
paulson
parents: 1476
diff changeset
    12
  "sum f 0 = 0"
eca2a3634acd Function "sum" now defined using primrec
paulson
parents: 1476
diff changeset
    13
  "sum f (Suc n) = f(n) + sum f n"
eca2a3634acd Function "sum" now defined using primrec
paulson
parents: 1476
diff changeset
    14
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    15
end