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