Step-Indexed Biorthogonality: a Tutorial Example

Similar documents
Realizability Semantics of Parametric Polymorphism, General References, and Recursive Types

Contextual equivalence

Techniques. Contextual equivalence

Relational Reasoning for Recursive Types and References

arxiv: v3 [cs.pl] 15 May 2011

A should be R-closed: R(A) A. We would like this to hold because we would like every element that the rules say should be in A to actually be in A.

Step-Indexed Logical Relations for Probability

Step-indexed models of call-by-name: a tutorial example

Logical Step-Indexed Logical Relations

MFPS LICS Special Session Honouring Dana Scott. Symmetric Scott. Andrew Pitts. Computer Laboratory MFPS/LICS /14

Streams and Coalgebra Lecture 2

Lecture 2: Syntax. January 24, 2018

Sequent Calculus in the Topos of Trees

LOGICAL STEP-INDEXED LOGICAL RELATIONS

Model Theory of Modal Logic Lecture 5. Valentin Goranko Technical University of Denmark

Extended Abstract: Reconsidering Intuitionistic Duality

Boolean Algebra and Propositional Logic

Boolean Algebra and Propositional Logic

TR : Binding Modalities

University of Oxford, Michaelis November 16, Categorical Semantics and Topos Theory Homotopy type theor

Two papers: a scattered tale. T. Litak, U. of Leicester (still, but not for much more) Tbilisi, July 2012

via Topos Theory Olivia Caramello University of Cambridge The unification of Mathematics via Topos Theory Olivia Caramello

On Modal Logics of Partial Recursive Functions

On Models of Higher-Order Separation Logic

Safety Analysis versus Type Inference for Partial Types

Topos Theory. Lectures 17-20: The interpretation of logic in categories. Olivia Caramello. Topos Theory. Olivia Caramello.

A Discrete Duality Between Nonmonotonic Consequence Relations and Convex Geometries

The Logic of Proofs, Semantically

Recursive types to D and beyond

Parametric Polymorphism and Operational Equivalence

Proof Methods for Corecursive Programs. 1. Introduction. Jeremy Gibbons. Graham Hutton

Binding in Nominal Equational Logic

Interpreting Polymorphic FPC into domain theoretic models of parametric polymorphism

Fixed-point elimination in Heyting algebras 1

A Note on Extensional PERs

A Fixed Point Representation of References

Type Systems as a Foundation for Reliable Computing

Partial model checking via abstract interpretation

A generalization of modal definability

CSCI 490 problem set 6

Binary positivity in the language of locales

A simple proof that super-consistency implies cut elimination

On the Complexity of the Reflected Logic of Proofs

1. Propositional Calculus

Denoting computation

Sequences. Chapter 3. n + 1 3n + 2 sin n n. 3. lim (ln(n + 1) ln n) 1. lim. 2. lim. 4. lim (1 + n)1/n. Answers: 1. 1/3; 2. 0; 3. 0; 4. 1.

Closure operators on sets and algebraic lattices

Nominal Syntax and Semantics

Higher Order Containers

arxiv: v2 [math.gr] 22 Aug 2016

The algebraicity of the lambda-calculus

Logic for Computational Effects: work in progress

A type theory for productive coprogramming via guarded recursion

A Type-Coercion Problem in Computer Algebra

Completeness Theorems and λ-calculus

Peano Arithmetic. CSC 438F/2404F Notes (S. Cook) Fall, Goals Now

Maximal Introspection of Agents

Herbrand Theorem, Equality, and Compactness

KRIPKE S THEORY OF TRUTH 1. INTRODUCTION

Krivine s Intuitionistic Proof of Classical Completeness (for countable languages)

1. Propositional Calculus

ACLT: Algebra, Categories, Logic in Topology - Grothendieck's generalized topological spaces (toposes)

Nested Epistemic Logic Programs

Lecture Notes on Data Abstraction

Lecture Notes on Combinatory Modal Logic

Handbook of Logic and Proof Techniques for Computer Science

Relational Models and Program Logics: Logical Relations in Iris

Adjunctions! Everywhere!

Topology for functional programming

Strong Normalization for Guarded Types

Lecture 9: Sheaves. February 11, 2018

Lecture three: Automata and the algebra-coalgebra duality

Statistics for Financial Engineering Session 2: Basic Set Theory March 19 th, 2006

The Curry-Howard Isomorphism

ISTITUTO DI ANALISI DEI SISTEMI ED INFORMATICA

Přednáška 12. Důkazové kalkuly Kalkul Hilbertova typu. 11/29/2006 Hilbertův kalkul 1

A Taste of Categorical Logic Tutorial Notes

A Taste of Categorical Logic Tutorial Notes

Machines, Models, Monoids, and Modal logic

1 Differentiable manifolds and smooth maps

An Independence Relation for Sets of Secrets

Löwenheim-Skolem Theorems, Countable Approximations, and L ω. David W. Kueker (Lecture Notes, Fall 2007)

Vietoris bisimulations

MONADIC FRAGMENTS OF INTUITIONISTIC CONTROL LOGIC

Universal Algebra for Logics

Informal Statement Calculus

Final Exam (100 points)

Classical Propositional Logic

Restricted truth predicates in first-order logic

Math 676. A compactness theorem for the idele group. and by the product formula it lies in the kernel (A K )1 of the continuous idelic norm

5 Set Operations, Functions, and Counting

arxiv: v1 [math.lo] 11 Jul 2016

Names and Symmetry in Computer Science

The Fundamental Group

Basic counting techniques. Periklis A. Papakonstantinou Rutgers Business School

Constructive Linear-Time Temporal Logic: Proof Systems and Kripke Semantics

Reverse Mathematics. Benedict Eastaugh December 13, 2011

Lecture 11: Minimal types

Streams and Coalgebra Lecture 1

Semantics of intuitionistic propositional logic

Transcription:

Step-Indexed Biorthogonality: a Tutorial Example Andrew Pitts University of Cambridge Computer Laboratory 1 Introduction The purpose of this note is to illustrate the use of step-indexing [2] combined with biorthogonality [10, 9] to construct syntactical logical relations. It walks through the details of a syntactically simple, yet non-trivial example: a proof of the CIU Theorem for contextual equivalence of terms in the untyped call-by-value λ-calculus with recursively defined functions. I took as inspiration two works: Ahmed s step-indexed syntactic logical relations for recursive types [1] and Benton & Hur s work on compiler correctness that combines biorthogonality with step-indexing [4]. The logical relation constructed here will come as no surprise to those familiar with these works. However, compared with Ahmed, we do not regard biorthogonality as complex machinery to be avoided in my view it simplifies matters; and compared with Benton & Hur, I work entirely with operational semantics and with a high-level language. Both things are true of the recent work by Dreyer et al [7]; indeed I believe everything in this note can be deduced from their logical relation for call-byvalue System F extended with recursive types, references and continuations. Nevertheless, it seems useful, for tutorial purposes, to extract a specific example of what the combination of step-indexing and biorthogonality can achieve, in as simple yet non-trivial a setting as possible. Of course there are other ways to prove the CIU theorem for untyped call-by-value λ- calculus; for example, by using Howe s method (see [12]). However, two points about the logical relation constructed here are of interest. First, and the main point of the technique as far as I am concerned, is the way step-indexing is used to break the vicious circle in the mixed-variance specification of the logical relation see definition (10). Second is the fact that, unlike for some other forms of syntactical logical relation (see [11] for example), no compactness property (also known as an unwinding theorem ) is needed to deal with recursively defined functions see the proof of Lemma 4.3(ii). 2 Programming language We use the untyped call-by-value λ-calculus with explicit recursive function definitions. Since we are going to use biorthogonality, we use expressions in A-normal form and use frame stacks to define termination of call-by-value evaluation. So starting with a fixed, 1

countably infinite set V of variables, we define: Values v V ::= x, f variables (x, f V) fun( f x = e) recursively defined function Expressions e Λ ::= v value v v application let x = e in e sequencing Frame stacks E Λ ::= Id empty E (x e) non-empty We identify values/expressions/frame stacks up to α-equivalence of bound variables (the binding forms being fun( f x = _), let x = e in _ and E (x _)). The finite sets fv(v)/fv(e)/fv(e) of free variables of a value/expression/frame stack are defined as usual. Given a finite subset x V, we write V(x) {v V fv(v) x} (1) Λ(x) {e Λ fv(e) x} (2) Λ (x) {E Λ fv(e) x}. (3) Note that V(x) Λ(x). Capture-avoiding substitution of values v for free variables x in an expression e is denoted e[v/x] and similarly for substitution into values and frame stacks. Given a closed value substitution σ V( ) x e[σ] denotes the substituted expression e[σ(x)/x x x]. Definition 2.1 (termination). The relation E n e (n N, E Λ ( ), e Λ( )) says that call-by-value evaluation of the closed expression e with respect to the closed frame stack E terminates properly in at most n steps. It is inductively defined by the rules Id n v E n e[v/x] E (x e) n+1 v E n e[v/ f, v /x] v = fun( f x = e) E n+1 v v E (x e ) n e E n+1 let x = e in e Then we define E e ( n N) E n e (4) e Id e. (5) 2

3 Contextual pre-order x e ctx e (x fin V, e, e Λ(x)) is the greatest relation (with respect to inclusion) which is pre-ordered e Λ(x) x e ctx e x e ctx e x e ctx e x e ctx e compatible x, f, x e ctx e x fun( f x = e) ctx fun( f x = e ) x v 1 ctx v 1 x v 2 ctx v 2 x v 1 v 2 ctx v 1 v 2 x e 1 ctx e 1 x, x e 2 ctx e 2 x let x = e 1 in e 2 ctx let x = e 1 in e 2 and adequate e ctx e e e. (It is an exercise to check that the greatest such relation does indeed exist. You can define it more explicitly in terms of contexts if you want to.) Definition 3.1 (CIU pre-order). The relation e ciu e (e, e Λ( )) is defined to hold if ( E Λ ( )) E e E e. It is extended to open expressions via closing value substitutions: given e, e Λ(x) we define x e ciu e ( σ V( ) x ) e[σ] ciu e [σ]. We wish to prove the following theorem. We will do so using a certain logical relation constructed in the next section. Theorem 3.2 (CIU theorem). ctx is equal to ciu. 4 Logical step-indexed relations Definition 4.1. A step-indexed relation (SIR) on a set X is by definition an N-indexed family of sets R = (R n n N) satisfying We define X R 0 R 1 R 2 (6) SIR(V( ) V( )) (7) SIR(Λ( ) Λ( )) (8) SIR(Λ ( ) Λ ( )) (9) 3

as follows: v n v ( m < n)( v 1, v 1) v 1 m v 1 e[v/ f, v 1 /x] m e [v / f, v 1 /x] (10) where v = fun( f x = e) and v = fun( f x = e ) e n e ( m n)( E, E ) E m E E m e E e (11) E n E ( m n)( v, v ) v m v E m v E v. (12) (Thus n is defined by recursion on n using the auxiliary SIRs and that are defined directly in terms of. It is easy to see that the relations do satisfy the decreasing property (6).) These relations are extended to open values/expressions/frame stacks via closing valuesubstitutions as follows. Given closed value substitutions σ, σ V( ) x on a finite set of variables x, we define σ n σ ( x x) σ(x) n σ (x). (13) Then for v, v V(x), e, e Λ(x) and s, s Λ (x), we define x v v ( n)( σ, σ V( ) x ) σ n σ v[σ] n v [σ ] (14) x e e ( n)( σ, σ V( ) x ) σ n σ e[σ] n e [σ ] (15) x E E ( n)( σ, σ V( ) x ) σ n σ E[σ] n E [σ ]. (16) Lemma 4.2. Given n N, x V and e, e Λ(x), suppose holds. Then for all m n ( m n)( v, v V( )) v m v e[v/x] m e [v /x] (17) E m E E (x e) m E (x e ) (18) e 1 m e 1 let x = e 1 in e m let x = e 1 in e. (19) Proof. For (18), suppose E m E, k m and v k v. If E (x e) k v, then (k > 0 and) E k 1 e[v/x]. By hypothesis (17) we have e[v/x] k 1 e [v /x]. So from E m E and E k 1 e[v/x] we get E e [v /x] and hence also E (x e ) v. Therefore by definition of m, we have E (x e) m E (x e ), as required. For (19), suppose e 1 m e 1, k m and E k E. If E k let x = e 1 in e, then (k > 0 and) E (x e) k 1 e 1 ; but by (18) we have E (x e) k 1 E (x e ) and hence E (x e ) e 1 and therefore also E let x = e in e 1. Thus by definition of m we have let x = e 1 in e m let x = e 1 in e, as required. Lemma 4.3. (i) If x x, then x x x. (ii) If x, f, x e e, then x fun( f x = e) fun( f x = e ). (iii) If x v v, then x v v. (iv) If x v 1 v 1 and x v 2 v 2, then x v 1 v 2 v 1 v 2. (v) If x e 1 e 1 and x, x e 2 e 2, then x let x = e 1 in e 2 let x = e 1 in e 2. (vi) x Id Id. 4

(vii) If x E E and x, x e e, then x E (x e) E (x e ). Proof. (i) This follows directly from (13) and (14). (ii) Suppose x, f, x e e. (20) We prove ( n)( σ, σ V( ) x ) σ n σ fun( f x = e[σ]) n fun( f x = e [σ ]) by induction on n. So suppose ( m < n)( σ, σ V( ) x ) σ m σ fun( f x = e[σ]) m fun( f x = e [σ ]) (21) and that σ n σ V( ) x. Writing v fun( f x = e[σ]) and v fun( f x = e [σ ]), we have to show that v n v. By definition of n this means that we have to prove for all m < n and v 1 m v 1 that e[σ][v/ f, v 1/x] m e [σ ][v / f, v 1 /x]. So suppose m < n and v 1 m v 1. Since σ n σ we also have σ m σ ; and hence from the induction hypothesis (21) we get v m v. Then from (20) we get e[σ][v/ f, v 1 /x] m e[σ ][v / f, v 1 /x], as required. (iii) It suffices to show that n n. Suppose v n v. For any m n and E m E, since v m v holds, by definition of m we have E m v E v. Hence by definition of, we have v m v, as required. (iv) It suffices to show for all n that if v n v and v 1 n v 1, then v v 1 n v v 1. By definition of n, this means that we have to prove for all m n and E m E that E m v v 1 implies E v v 1. So suppose m n and E m E that E m v v 1. Let v = fun( f x = e) and v = fun( f x = e ). Then by definition of _ m _ we must have (m > 0 and) E m 1 e[v/ f, v 1 /x]. Since v n v, m 1 < n and v 1 m 1 v 1, by definition of n we have e[v/ f, v 1 /x] m 1 e [v / f, v 1 /x]. Then since E m E, we get E e [v / f, v 1 /x] and hence also E v v 1, as required. (v) This is a corollary of Lemma 4.2. (vi) Note that Id n Id holds because for all v V( ), Id v holds. (vii) This is a corollary of Lemma 4.2. Remark 4.4. Definition (10) is delicate. It seems that one cannot replace it with the simpler clause v n v = ( m < n)( v 1, v 1) v 1 m v 1 v v 1 m v v 1 and still prove part (iv) of Lemma 4.3. Theorem 4.5 (Fundamental property of the logical relation). For all v V(x), e Λ(x) and E Λ (x) x v v, x e e and x E E. Proof. By induction on the structure of v/e/e using Lemma 4.3. Lemma 4.6. If x e e and x e ciu e, then x e e. 5

Proof. It suffices to show e n e e ciu e e n e and this follows immediately from the definition of n in (11) and Definition 3.1. Lemma 4.7. If e e, then e ciu e. Proof. Suppose e e. For any E Λ ( ) we have to show E e E e. By Theorem 4.5 we have E E. So if E e holds, then by definition of, we have E n e for some n; and since E n E and e n e, by definition of n we do indeed have E e. Theorem 4.8. is equal to ciu. Proof. For any closed value substitution σ V( ) x from Theorem 4.5 we have ( n N) σ n σ. So if x e e, then ( n N) e[σ] n e [σ]. Hence by Lemma 4.7 we have e[σ] ciu e [σ]. Therefore x e ciu e holds. Conversely, if x e ciu e, since by Theorem 4.5 we have x e e, it follows from Lemma 4.6 that x e e. Lemma 4.9. For all n N, E, E Λ ( ), v, v V( ) and f V E n E v n v E ( f f v) n+2 E ( f f v ). Proof. Suppose m n + 2, v 1 m v 1, with v 1 = fun( f x = e) and v 1 = fun( f x = e ) say, and that E ( f f v) m v 1. We have to show that E ( f f v ) v 1. Since E ( f f v) m v 1, by definition of it must be the case that m 2 and E m 2 e[v 1 / f, v/x]. Note that m 2 n, so E m 2 E and v m 2 v ; also m 2 < m, so by definition of v 1 m v 1 we have e[v 1/ f, v/x] m 2 e [v 1 / f, v /x]. Therefore from E m 2 e[v 1 / f, v/x] we get E e [v 1 / f, v /x] and hence also E ( f f v ) v 1, as required. Corollary 4.10. For all n N and v, v V( ) and hence in particular v n+1 v v n v (22) v v v v. (23) Proof. Suppose v = fun( f x = e), v = fun( f x = e ) and v n+1 v. To see that v n v we have to show for any m < n and v 1 m v 1 that e[v/ f, v 1/x] m e [v / f, v 1 /x]; that is, for any k m and E k E, E k e[v/ f, v 1 /x] implies E e [v / f, v 1 /x]. But if E k e[v/ f, v 1 /x], then E ( f f v 1 ) k+2 v. Note that k + 2 n + 1; so by assumption we have v k+2 v ; and since k m we can apply Lemma 4.9 to get E ( f f v 1 ) k+2 E ( f f v 1 ). Therefore by definition of k+2, from E ( f f v 1 ) k+2 v we get E ( f f v 1 ) v and hence also E e [v / f, v 1 /x], as required. Lemma 4.11. ciu is contained in ctx. 6

Proof. It suffices to show that ciu is an adequate, compatible pre-order, because ctx is the greatest such. It is immediate from its definition that ciu is an adequate pre-order. For its compatibility properties we use the fact that it coincides with (Theorem 4.8). Compatibility with fun( f x = _) is thus a consequence of parts (ii) and (iii) of Lemma 4.3; and compatibility with let x = _ in _ is part (v) of that lemma. Compatibility with application, that is, the property x v ciu v x v 1 ciu v 1 x v v 1 ciu v v 1 (24) is not a direct consequence of part (iv) of the lemma even though we know that ciu coincides with. However, note that to prove (24) it suffices to prove the particular case when x =, because of the way ciu is defined for open expressions; and by Theorem 4.8 this is equivalent to proving v v v 1 v 1 v v 1 v v 1. Now we can apply Corollary 4.10 to deduce this from Lemma 4.3(iv). Lemma 4.12 (value-substitutivity for ctx ). If x, x e ctx e and x v ctx v, then x e[v/x] ctx e [v/x]. Proof. If x, x e ctx e and x v ctx v, then by the compatibility properties of ctx we have x (fun( f x = e)) v ctx (fun( f x = e )) v, where f / x, x. So the result follows by transitivity on ctx once we know x e[v/x] ctx (fun( f x = e)) v and x (fun( f x = e )) v ctx e [v /x]. It is easy to see from the definition of the CIU pre-order that these hold up to ciu ; so we can apply Lemma 4.11. Proof of CIU Theorem 3.2. We have already shown that ciu is contained in ctx (Lemma 4.11). For the converse, in view of Lemma 4.12 it suffices to show that e ctx e implies e ciu e. Given e ctx e, we prove E e E e by induction on the length of frame stack E Λ ( ). The base case E = Id holds because ctx is an adequate relation. For the induction step for a non-empty frame stack E (x e 1 ), note that let x = e in e 1 ctx let x = e in e 1 holds by the compatibility (and pre-order) property of ctx. So the result follows from ( E, e, e ) E (x e ) e E let x = e in e, which is a consequence of the definition of. 5 Toward abstract sense In this note I have purposely kept things as concrete as possible. However, to understand what is really going on (as a category theorist would say) and apply step-indexing techniques in more complicated situations, the level of mathematical sophistication needs to rise. We need to do some category theory. 7

Recall SIR(X) from Definition 4.1. It becomes a complete Heyting algebra once endowed with the ordering R R ( n N) R n R n. (25) Furthermore, given a function f : X Y, taking inverse images of subsets along f yields a morphism of complete Heyting algebras f : SIR(Y) SIR(X): ( f R) n {x X f (x) R n }. This makes SIR(_) into a Set-based tripos [8]; indeed it is isomorphic to the tripos of H- valued sets where H is the complete linear order F < p 0 < p 1 < p 2 < < T. (Exercise: show that SIR(X) is isomorphic to H X, naturally in X.) Thus the topos associated with the tripos SIR(_) is the category Sh(H) of sheaves on the complete Heyting algebra H. The internal higher-order logic of this topos is probably a good place to study step-indexing from an abstract point of view. Here are two little pieces of evidence. 1. The structure of implication. Binary meet in SIR(X) is given by index-wise binary intersection. The Heyting implication R R of two elements of SIR(X) by definition satisfies ( R ) R R R R R R and a simple calculation shows that is it given by (R R ) n {x S ( m n) x R m x R m} (n N). Compare this with the various uses of the bounded quantifier ( m n)(_) in Sect. 4. 2. The later modality. The crucial definition Sect. 4 is (10); it makes use of the bounded quantifier ( m < n)(_). Since Appel et al [3], we realize that this has to do with the provability logic of Gödel-Löb. The monotone function : SIR(_) SIR(_) is given by { ( R) n X if n = 0 R m = R n 1 if n > 0. m<n For example, we can restate Corollary 4.10 as saying ( ). The operation satisfies the Gödel-Löb rule: R R R =. (For if R R, then X R 0 and R n 1 R n for n > 0; in view of (6), it follows by induction on n that R n = X for all n; and thus R =.) The aim is to replace induction over step-indexes by use of this rule; see [6] for how this can work in practice. 8

6 Conclusion Where is this development headed? The aim is similar to recent work of Birkedal et al on relational methods using complete, 1-bounded ultrametric (CBU) spaces. In practice it seems that only bisected CBU spaces [5, Defintion 2.2] are needed; and the latter are closely connected with SIR(_). It should be possible to develop a theory of types and relations defined by guarded recursion in the tripos SIR(_) (or maybe better, in the topos Sh(H)) so that the construction of in Sect. 4 and its fundamental properties, such as Lemma 4.3 and Corollary 4.10, fall out automatically from a fixed point specification. References [1] A. Ahmed. Step-indexed syntactic logical relations for recursive and quantified types. In P. Sestoft, editor, Programming Languages and Systems, 15th European Symposium on Programming, ESOP 2006, Vienna, Austria, volume 3924 of Lecture Notes in Computer Science, pages 69 83. Springer, 2006. [2] A. Appel and D. McAllester. An indexed model of recursive types for foundational proof-carrying code. Transactions on Programming Languages and Systems, 23(5):657 683, 2001. [3] A. W. Appel, P.-A. Melliès, C. D. Richards, and J. Vouillon. A very modal model of a modern, major, general type system. In POPL 07: Proceedings of the 34th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 109 122, New York, NY, USA, 2007. ACM. [4] N. Benton and C.-K. Hur. Biorthogonality, step-indexing and compiler correctness. In ICFP 09: Proceedings of the 14th ACM SIGPLAN International Conference on Functional Programming, pages 97 108, New York, NY, USA, 2009. ACM. [5] L. Birkedal, B. Reus, J. Schwinghammer, K. Støvring, J. Thamsborg, and H. Yang. Step-indexed kripke models over recursive worlds. In POPL 11: Proceedings of the 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages??, New York, NY, USA, 2011. ACM. [6] D. Dreyer, A. Ahmed, and L. Birkedal. Logical step-indexed logical relations. Submitted for publication, January 2010. [7] D. Dreyer, G. Neis, and L. Birkedal. The impact of higher-order state and control effects on local relational reasoning. In ICFP 2010: Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming, pages 143 156, New York, NY, USA, 2010. ACM. [8] J. M. E. Hyland, P. T. Johnstone, and A. M. Pitts. Tripos theory. Math. Proc. Cambridge Philos. Soc., 88:205 232, 1980. [9] P.-A. Melliès and J. Vouillon. Recursive polymorphic types and parametricity in an operational framework. In 20th Annual IEEE Symposium on Logic in Computer Science (LICS 05), pages 82 91. IEEE Computer Society Press, June 2005. 9

[10] A. M. Pitts. Parametric polymorphism and operational equivalence. Mathematical Structures in Computer Science, 10:321 359, 2000. [11] A. M. Pitts. Typed operational reasoning. In B. C. Pierce, editor, Advanced Topics in Types and Programming Languages, chapter 7, pages 245 289. The MIT Press, 2005. [12] A. M. Pitts. Howe s method for proving congruence properties in higher-order languages. In D. Sangiorgi and J. Rutten, editors, Bisimulation and Coinduction: Advanced Topics, pages?? Cambridge University Press, 2011. To appear. 10