author | wenzelm |
Tue, 28 Oct 1997 17:58:35 +0100 | |
changeset 4029 | 22f2d1b17f97 |
parent 71 | 729fe026c5f3 |
permissions | -rw-r--r-- |
16
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
1 |
(* Title: ZF/ex/primrec.thy |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
2 |
ID: $Id$ |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
4 |
Copyright 1993 University of Cambridge |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
5 |
|
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
6 |
Primitive Recursive Functions |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
7 |
|
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
8 |
Proof adopted from |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
9 |
Nora Szasz, |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
10 |
A Machine Checked Proof that Ackermann's Function is not Primitive Recursive, |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
11 |
In: Huet & Plotkin, eds., Logical Environments (CUP, 1993), 317-338. |
71
729fe026c5f3
sample datatype defs now use datatype_intrs, datatype_elims
lcp
parents:
16
diff
changeset
|
12 |
|
729fe026c5f3
sample datatype defs now use datatype_intrs, datatype_elims
lcp
parents:
16
diff
changeset
|
13 |
See also E. Mendelson, Introduction to Mathematical Logic. |
729fe026c5f3
sample datatype defs now use datatype_intrs, datatype_elims
lcp
parents:
16
diff
changeset
|
14 |
(Van Nostrand, 1964), page 250, exercise 11. |
16
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
15 |
*) |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
16 |
|
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
17 |
Primrec0 = ListFn + |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
18 |
consts |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
19 |
SC :: "i" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
20 |
CONST :: "i=>i" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
21 |
PROJ :: "i=>i" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
22 |
COMP :: "[i,i]=>i" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
23 |
PREC :: "[i,i]=>i" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
24 |
primrec :: "i" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
25 |
ACK :: "i=>i" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
26 |
ack :: "[i,i]=>i" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
27 |
|
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
28 |
translations |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
29 |
"ack(x,y)" == "ACK(x) ` [y]" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
30 |
|
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
31 |
rules |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
32 |
|
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
33 |
SC_def "SC == lam l:list(nat).list_case(0, %x xs.succ(x), l)" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
34 |
|
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
35 |
CONST_def "CONST(k) == lam l:list(nat).k" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
36 |
|
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
37 |
PROJ_def "PROJ(i) == lam l:list(nat). list_case(0, %x xs.x, drop(i,l))" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
38 |
|
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
39 |
COMP_def "COMP(g,fs) == lam l:list(nat). g ` map(%f. f`l, fs)" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
40 |
|
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
41 |
(*Note that g is applied first to PREC(f,g)`y and then to y!*) |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
42 |
PREC_def "PREC(f,g) == \ |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
43 |
\ lam l:list(nat). list_case(0, \ |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
44 |
\ %x xs. rec(x, f`xs, %y r. g ` Cons(r, Cons(y, xs))), l)" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
45 |
|
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
46 |
ACK_def "ACK(i) == rec(i, SC, \ |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
47 |
\ %z r. PREC (CONST (r`[1]), COMP(r,[PROJ(0)])))" |
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
48 |
|
0b033d50ca1c
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
diff
changeset
|
49 |
end |