- •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?
68 CHAPTER 9. DENOTATIONAL SEMANTICS OF T
5. t = w u with w of type U!V , u of type U; we de ne the function App from [[U!V ]]; [[U]] to [[V ]] by:
App(f; a) = f : 9a a (a ; ) 2 fg
It is immediate that App is stable; so we de ne [[t]](s) = App([[w]](s); [[u]](s))
As an exercise, one can calculate the traces of Pair, 1, 2, App and the function in 4 which takes F to G.
9.2Properties of the interpretation
Essentially, as we have said, conversion becomes denotational equality: if t |
u |
then [[t]] = [[u]]. To show this, we use: |
|
1(Pair(a; b)) = a 2(Pair(a; b)) = b App(Tr(F ); a) = F (a)
The last formula is to be used in conjunction with a substitution property: consider v[x; u[x]=y]; one can associate to this two stable functions:
by calculating the interpretation of this term;
by forming the (n + 1)-ary function [[v]](a; b), the n-ary function [[u]](a) and then [[v]](a; [[u]](a)).
The two functions so obtained are equal, as can be shown without di culty (but what a bore!) by induction on v.
This property is used thus (omitting the auxiliary variables):
[[( x: v) u]] = App(Tr(a 7![[v]](a)); [[u]]) = [[v]]([[u]]) = [[v[u=x]]]
In fact, the secondary equations, which we keep meeting but have not taken seriously, are also satis ed:
Pair( 1(c); 2(c)) = c |
Tr(a 7! App(f; a)) = f |
Categorically, what we have shown is that N and ! are the product and exponential for a Cartesian closed category whose objects are coherence spaces and whose morphisms are stable maps. However, we have forgotten one thing: composition! But it is easy to show that the trace of G F is
f(a1 [ ::: [ ak; ) : (f 1; :::; kg; ) 2 Tr(F ); (a1; 1); :::; (ak; k) 2 Tr(G)g
where F and G are stable functions from A to B and from B to C respectively.
• |
69 |
9.3. GODEL'S SYSTEM |
9.3G•odel's system
9.3.1Booleans
We shall interpret the type Bool by Bool:
[[T]] = T |
def |
ftg |
def |
ffg |
= |
[[F]] = F = |
D u v t is interpreted using a ternary stable function D from A, A, Bool to A,
de ned by |
|
|
D(a; b; ?) = ? |
D(a; b; ftg) = a |
D(a; b; ffg) = b |
and so we put [[D u v t]] = D([[u]]; [[v]]; [[t]]). |
|
In particular, the fact that terms of G•odel's system can be interpreted by stable functions makes it impossible to de ne parallel or. Indeed, if the equations
t hT; xi T |
t hx; Ti T |
t hF; Fi F |
had a solution in T, we would have |
|
|
[[t]](T ; ?) = T |
[[t]](?; T ) = T |
[[t]](F; F) = F |
which corresponds to the non-stable function called F0 |
in 8.3.2. |
9.3.2Integers
The obvious idea for interpreting Int is the coherence space Int introduced in the previous chapter:
def
[[O]] = O = f0g [[S t]] = S([[t]]) with S(?) = ?; S(fng) = fn + 1g
This interpretation works only by values; indeed, it is easy to nd u and v such that
R u v O T R u v (S x) F
If F is the function which interprets x 7!R u v x, this forces
F (O) = ftg |
F (S(?)) = ffg |
but S(?) = ? O, contradiction. |
|
70 |
CHAPTER 9. DENOTATIONAL SEMANTICS OF T |
What is wrong with Int? If we apply S to ? (empty information), we obtain ? again, whereas we know something more, namely that we have a successor | a piece of information which may well be su cient for a recursion step.
Therefore, we must revise our interpretation, adding 0+ for the information \being a successor", i.e. something > 0, and more generally, p+ for something greater than p. Let us de ne1 Int+ by jInt+j = f0; 0+; 1; 1+; : : :g with:
_ |
p |
+ _ |
p |
+ _ |
+ |
for all p; q |
p ^ q i p = q |
^ q i p < q |
^ q |
|
To see how it all works out, let us look for the maximal points. If a 2 Int+ is maximal, either:
|
some |
p |
2 |
a |
; |
then a contains no other q, |
nor does it contain any q+ with |
||||||
|
|
def |
|
|
|
|
|
|
|
||||
|
p q. So a p = f0+; : : : ; (p 1)+; pg; but this set is coherent, and as a is |
||||||||||||
|
maximal it |
must be equal to p. |
|
|
|
|
|
||||||
|
|
e |
|
def |
|
0+; 1+; 2+; : : : |
|
|
|||||
|
a contains no p; then a |
|
|
|
which is coherent, so a is |
||||||||
|
e= |
f |
g |
||||||||||
equal to this in nite set. |
f1 |
|
|
|
|
The interpretation is as follows:
O = f0g S(a) = f0+g [ fi + 1 : i 2 ag [ f(i + 1)+ : i+ 2 ag
In particular the numeral p = Sp O will be interpreted by pe.
It remains to interpret recursion: given a coherence space A, a point o 2 A and a stable function F from A; Int+ to A, we shall construct a stable function G from Int+ to A which satis es:
G(O) = o |
G(S(a)) = F (G(a); a) |
G(a) = ? if 0; 0+ 2= a |
G is actually well-de ned on the nite points of Int+; it is easily shown to be monotone and hence extends to a continuous, and indeed stable, function on in nite points. In particular, G(1f) = S"fG(Sn(?)) : n 2 Ng.
1These lazy natural numbers are rather more complicated than the usual ones, which do not form a coherence space but a dI-domain (section 12.2.1). The di erence is that we admit the token 1+ in the absence of 0+, although it is di cult to see what this might mean.
9.3. |
• |
|
|
|
|
|
|
71 |
GODEL'S SYSTEM |
|
|
||||||
In fact, if a0 |
a is the largest subset of the form |
|||||||
p = f0+; : : : ; (p 1)+; pg = SpO, or |
||||||||
|
e |
f |
|
|
|
g |
S ? |
|
|
def |
|
0+; 1+; :::; (p |
|
1)+ = |
p |
|
|
|
p = |
|
|
|
then G(a0) = G(a) (assuming F has this property), so (by induction) no term of T involves p or p+ in its semantics without f0+; : : : (p 1)+g as well.
As an exercise, one can try to calculate directly a stable function from Int+ to Int+ which represents the predecessor.
9.3.3In nity and xed point
What is the r^ole of the object 1f? We see that it is a xed point of the successor: S(1f) = 1f. One could try to add it to the syntax of T, with the nonconvergent rewriting rule 1 S 1. We see, by using the iterator, that
It u v 1 v (It u v 1)
and so 1, combined with recursion, gives us access to the xed point, Y.
In the denotational semantics, the token occurs in the interpretation of Yf whenever ha; i occurs in the trace of (the interpretation of) f and the clique a occurs in the interpretation of Yf. Hardly surprisingly, this is a recursive de nition, and it is obtained by repeatedly applying f to ?. The tokens of the interpretation of Y itself can therefore be described in terms of nite trees.
It is not our purpose here to discuss the programming applications of thexed point (general recursion), an idea which is currently rather alien to type systems, although the denotational semantics accommodates it very well. But fundamentally, what does this mean?