Mathematisches Institut der Universit¨at M¨unchen Helmut Schwichtenberg
Sommersemester 2007 Blatt 6
Ubungen zur Vorlesung “Program Extraction from Proofs”¨
It suffices to indicate derivations informally. Also disregard the difference between ∀U,→Uand ∀,→.
Aufgabe 21. =N is inductively defined by
∀Un
1,n2(F →n1 =Nn2), 0 =N 0,
∀Un
1,n2(n1 =N n2 →Sn1 =NSn2).
Consider the boolean-valued function =N:N→N→B. Derive in IDω (a) ∀Un1,n2(n1 =Nn2 →Uatom(=N(n1, n2))),
(b) ∀n1,n2(atom(=N (n1, n2))→n1 =N n2).
Hint. For (a) use the elimination axiom, and for (b) a double induction on n1 and n2, and the clause∀Un
1,n2(F →n1=N n2).
Aufgabe 22. Define N,W and T by
N :=µα(α, α→α) natural numbers,
W:=µα(α, α→α, α→α) words, or positive numbers in binary, T :=µα(α, α→α→α) binary trees,
with constructors 0 and S for N; 1, S0 and S1 for W; 0 and ∗ for T. For µ∈ {N,W,T}show “atomic compatibility”, using the cases scheme instead of induction whenever possible.
HAω ` ∀x
1,x2,fµ→B x1=µx2 →atom(f x1)→atom(f x1) .
Aufgabe 23. Study Laura Crosilla’s tutorial for the Minlog proof assistant.
Introduce the three algebras N, W and T, using the constructor names Zero and Succ for nat; One, SZero and SOne for pos; Leaf and Cons for bin. Formally introduce terms for some recursion operators, and print their types. Example:
(pp (pt "(Rec nat=>nat)"))
(pp (term-to-type (pt "(Rec nat=>nat)")))
Aufgabe 24. Define some interesting functions on N, W and T, using recursion operators.
(a) Formally introduce terms for these functions, and print them (by pp).
(b) Evaluate (bynt) some closed terms of ground type involving these func- tions. Example:
(pp (nt (pt "(Rec nat=>nat)2 0([n,m](Succ(Succ m)))")))
Abgabetermin. Montag, 18. Juni 2007, 11:15 Uhr