- •Sense, Denotation and Semantics
- •Sense and denotation in logic
- •The algebraic tradition
- •The syntactic tradition
- •The two semantic traditions
- •Tarski
- •Heyting
- •Natural Deduction
- •The calculus
- •The rules
- •Interpretation of the rules
- •The Curry-Howard Isomorphism
- •Lambda Calculus
- •Types
- •Terms
- •Operational significance
- •Conversion
- •Description of the isomorphism
- •Relevance of the isomorphism
- •The Normalisation Theorem
- •The weak normalisation theorem
- •Proof of the weak normalisation theorem
- •Degree and substitution
- •Degree and conversion
- •Conversion of maximal degree
- •Proof of the theorem
- •The strong normalisation theorem
- •Sequent Calculus
- •The calculus
- •Sequents
- •Structural rules
- •The intuitionistic case
- •Logical rules
- •Some properties of the system without cut
- •The last rule
- •Subformula property
- •Asymmetrical interpretation
- •Sequent Calculus and Natural Deduction
- •Properties of the translation
- •Strong Normalisation Theorem
- •Reducibility
- •Properties of reducibility
- •Atomic types
- •Product type
- •Arrow type
- •Reducibility theorem
- •Pairing
- •Abstraction
- •The theorem
- •The calculus
- •Types
- •Terms
- •Intended meaning
- •Conversions
- •Normalisation theorem
- •Expressive power: examples
- •Booleans
- •Integers
- •Expressive power: results
- •Canonical forms
- •Representable functions
- •Coherence Spaces
- •General ideas
- •Coherence Spaces
- •The web of a coherence space
- •Interpretation
- •Stable functions
- •Parallel Or
- •Direct product of two coherence spaces
- •The Function-Space
- •The trace of a stable function
- •Representation of the function space
- •The Berry order
- •Partial functions
- •Denotational Semantics of T
- •Simple typed calculus
- •Types
- •Terms
- •Properties of the interpretation
- •Booleans
- •Integers
- •Sums in Natural Deduction
- •Defects of the system
- •Standard conversions
- •The need for extra conversions
- •Subformula Property
- •Extension to the full fragment
- •Commuting conversions
- •Properties of conversion
- •The associated functional calculus
- •Empty type
- •Sum type
- •Additional conversions
- •System F
- •The calculus
- •Comments
- •Representation of simple types
- •Booleans
- •Product of types
- •Empty type
- •Sum type
- •Existential type
- •Representation of a free structure
- •Free structure
- •Representation of the constructors
- •Induction
- •Representation of inductive types
- •Integers
- •Lists
- •Binary trees
- •Trees of branching type U
- •The Curry-Howard Isomorphism
- •Coherence Semantics of the Sum
- •Direct sum
- •Lifted sum
- •dI-domains
- •Linearity
- •Characterisation in terms of preservation
- •Linear implication
- •Linearisation
- •Linearised sum
- •Tensor product and units
- •Cut Elimination (Hauptsatz)
- •The key cases
- •The principal lemma
- •The Hauptsatz
- •Resolution
- •Strong Normalisation for F
- •Idea of the proof
- •Reducibility candidates
- •Remarks
- •Reducibility with parameters
- •Substitution
- •Universal abstraction
- •Universal application
- •Reducibility theorem
- •Representation Theorem
- •Representable functions
- •Numerals
- •Total recursive functions
- •Provably total functions
- •Proofs into programs
- •Formulation of HA2
- •Translation of HA2 into F
- •Representation of provably total functions
- •Semantics of System F
- •What is Linear Logic?
7.3. EXPRESSIVE POWER: EXAMPLES |
49 |
7.3Expressive power: examples
7.3.1Booleans
The typical example is given by the logical connectors:
neg(u) = D F T u |
disj(u; v) = D T v u |
conj(u; v) = D v F u |
|
For example, disj(T; x) |
T and disj(F; x) |
x; but on the other hand, faced with |
|
the expression disj(x; T), we do not know |
what to do. |
|
Question Is it possible to de ne another disjunction which is symmetrical?
We shall see in 9.3.1, by semantic methods, that there is no term G of type
Bool; Bool ! Bool such that:
G hT; xi T |
G hx; Ti T |
G hF; Fi F |
7.3.2Integers
First we must represent the integers: the choice of n = Sn O to represent the integer n is obvious.
The classical functions are de ned by simple recurrence relations. Let us give the example of the addition: we have to work from the de ning equations we already know:
x + O = x |
x + S y = S (x + y) |
Consider t[x; y] = R x ( zInt: z0 Int: S z) y:
t[x; O] x |
t[x; S y] ( zInt: z0 Int: S z) (t[x; y]) y S t[x; y] |
This shows that one can take t[x; y] as a de nition of x + y.
Among easy exercises in this style, one can amuse oneself by de ning multiplication, exponential, predecessor etc.
Predicates on integers can also be de ned, for example
null(O) = T null(S x) = F
gives
def Bool 0 Int
null(x) = R T ( z : z : F) x
which allows us to turn a characteristic function (type Int) into a predicate (type
Bool).
50 |
• |
CHAPTER 7. GODEL'S SYSTEM T |
None of these examples makes serious use of higher types. However, as the types used in the recursion increase, more and more functions become expressible. For example, if f is of type Int! Int, one can de ne it(f) of type Int! Int by
it(f) x = R |
|
( zInt: z0 Int: f z) x |
(it(f) |
|
is fn |
|
|
|
1 |
1) |
|||||||
n |
As an object of type (Int! Int)!(Int! Int), the function it, is:
xInt!Int: it(x)
It is easy to see that by nite iteration of some reasonable function f0, we can exceed every primitive recursive function. The function which, given n, returns itn f0 (Ackermann's function), grows more quickly than all the primitive recursive functions.
This kind of function is easily de nable in T, provided we use a recursion on a complex type, such as Int! Int: take R f0 ( xInt!Int: zInt: it(x)) y, which normalises for y = O to f0, and for n to itn f0.
To nish, let us remark that the second argument of v in R u v t is frequently unused. One would prefer an iterator It instead of the recursor R, applying to u of type T , v of type T !T , and t of type Int, with the rule:
It u v (S t) v (It u v t)
The one-step predecessor satisfying the equations pred(O) = O, pred(S x) = x cannot be constructed using the iterator: R is essential. In fact, if one has only the iterator one can de ne the same functions but a certain number of equations with variables disappear. So the predecessor will still be de nable, but will satisfy pred(S t) t only when t is of the form n, in other words by values. This is a little annoying (in particular for F, where we shall no longer have anything but the iterator), for it shows that to calculate pred(n), the program makes n steps, which is manifestly excessive. We do not know how to type the predecessor, except in systems like T, where the solution is visibly ad hoc.
As an exercise, de ne R from It and pairing (by values only). We shall use this in system F (see 11.5.1).