May 2, 2008 - I would like to thank William Lovas for insightful discussion and ...... [9] Leaf Petersen, Robert Harper, Karl Crary, and Frank Pfenning. A type.
A Hybrid Formulation of the Ordered Logical Framework Chris Martens May 2, 2008 Abstract The logical framework LF is a powerful tool for encoding and carrying out the metatheory of logics and programming languages in a mechanized way. However, current work on LF has yielded little support for the metatheory of certain kinds of logic that are useful for reasoning about state. One fruitful approach (for the case of linear logic) has been to use hybrid logic, inspired by Kripke modal logic and temporal logic, to give the metareasoning tool access to how the object language context is being manipulated. The goal of this thesis is to apply the same approach to ordered logic, an setting capable of expressing even more constraints.
Contents 1 Introduction 1.1 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 3
2 Background 2.1 Logical Frameworks 2.2 Substructural Logics 2.3 Ordered LF . . . . . 2.4 The Problem . . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
3 3 4 7 8
3 Language 3.1 Hybrid LF . . . . . . . . 3.2 Ordered Worlds . . . . . 3.3 Spine form . . . . . . . . 3.3.1 Spine form HLF 3.3.2 Type checking . 3.3.3 Spine Typing . . 3.3.4 Spine form OLF
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
8 8 10 12 12 13 14 14
. . . .
1
4 Metatheory of Hybrid OLF 4.1 A conservative extension . . . . . . . . . . . . . . . . 4.1.1 Soundness . . . . . . . . . . . . . . . . . . . . 4.2 Definitions and lemmas for soundness/completeness 4.2.1 Translating contexts . . . . . . . . . . . . . . 4.2.2 Lemmas about worlds . . . . . . . . . . . . . 4.2.3 Completeness . . . . . . . . . . . . . . . . . . 4.3 Other Theorems . . . . . . . . . . . . . . . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
15 15 15 16 16 16 25 26
5 Conclusion 26 5.1 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 5.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2
1
Introduction
The logical framework LF [8] can be used to encode and reason within and about logical systems defined by the user. It and similar tools are widely used among the programming language research community for carrying out the metatheory of their systems. But as the systems people wish to express become more expressive, so too must the metalogic in order to provide the most natural encodings. One would like to believe, however, that “more expressive” does not necessarily mean “more complicated”. If something seems complex to express, it would be nice to try to generalize the problem, understand why it is so complex, and build an equally general, clear, and powerful solution that not only solves the problem under scrutiny but also many similar problems. State and resources are examples of such notoriously difficult-to-reasonabout concepts. We know of systems that model them well, but LF in its original formulation does not provide an elegant way of reasoning about such systems. We explore one particular attempt to extend LF with such a general reasoning mechanism. This mechanism is termed hybrid logic, inspired by Kripke modal logic and temporal logic. It allows the framework direct access on the metalanguage level to the resources being manipulated in the object language. So far it has been primarily explored for the case of linear logic [14]. The goal of this thesis is to apply the same approach to ordered logic, an setting capable of expressing even more constraints. In some sense this is just pushing the envelope a step further to see just to what extent in the substructural hierarchy the approach can be applied. It involves redefining only a small fragment of the type theory; namely the simple algebraic calculus of worlds (or labels). We investigate the faithfulness of the embedding of an existing ordered logical gramework into a fragment of this system. We also explore some of the potential practical applications of such a framework.
1.1
Acknowledgments
I would like to thank William Lovas for insightful discussion and LF-related explanations, Jason Reed for helping me get through the grittier technical details, and Frank Pfenning for his excellent guidance and advisorship.
2 2.1
Background Logical Frameworks
Logical frameworks have many purposes. They provide a way of formalizing the definitions of logics and programming languages that we would otherwise write by hand; moreover, they allow us to prove things about these definitions, such as type safety, in a machine-checkable way. The practice of writing down proofs
3
about formal systems and having a computer check them is called mechanizing metatheory [11]. They are sometimes also used as theorem provers, logic programming languages, and educational proof assistants. The particular logical framework this work extends is LF, which has a particular niche in programming language research, mainly due to the unique way it handles variable binding (that is, as part of the metalanguage) [10]. LF follows the methodology of “judgments-as-types”, meaning the judgments of the object language one writes down correspond to types in LF, and an object-language derivation of a judgment is an LF term with the type corresponding to that judgment.
2.2
Substructural Logics
Linear and ordered logics are called “substructural” because they lack certain structrual properties a logic is generally assumed to have. We typically use the metavariables Γ an A, B to denote, respectively, sets of assumptions, and propositions; we use a judgment like Γ ⊢ A to mean “the set of assumptions in Γ entail A” (permit A to be proved). The structural rules, then, are as follows: • Weakening - If a context Γ proves a proposition A, adding an extra assumption B to Γ still allows us to prove A • Contraction - If Γ contains two copies of A and proves B, then Γ with only one copy of A can still prove B • Exchange - If Γ proves A, we can arbitrarily reorder the elements of Γ and still be able to prove A. What we will call unrestricted logic has all three structural properties, and it is what most people would recognize as “ordinary” propositional logic. Linear logic [6] lacks the first two of these; thus, every assumption in its context must be used exactly once. For this reason it has been called the “logic of resources” – linear logic sequents model exactly what resources must go in for the consequent to come out. Note that in the absense of contraction, having many copies of an assumption around is a different thing from having only one copy around – our context now resembles not a set but a multiset. Because linear logic has a different notion of truth (that treats it more like a resource), it has a different notion of logical consequence. Given a linear context ∆, ∆ ⊢linear A does not mean the same thing as if the context and the entailment were unrestricted. Linear entailment is captured in the object language with the linear implication connective, ⊸. A ⊸ B can be thought of as meaning “the resources A produce exactly B” in the same way that A → B (where → is unrestricted implication) can be thought of as “A being true yields that B is true” (but is not necessarily needed for its proof, and may be used more than once!).
4
To argue by example that eliminating weakening and contraction models resources, consider a vending machine modeled by the rule “quarter AND quarter ⊸ can of soda”. If instead we had “quarter AND quarter → can of soda”, we could go on to prove “quarter AND quarter → can of soda AND can of soda AND can of soda ...”. We could also notice that we have redundant assumptions (“quarter AND quarter”) and use contraction to get “quarter → can of soda”, or we could weaken to get “quarter AND a million dollars → can of soda”. Ordered logic, the system actually in the spotlight of this thesis, lacks all three structural rules. Not only must each resource in the context be consumed, but it must be done in order. This yields two implication connectives, ։ and , read “right implication” and “left implication”. The context more closely resembles a list of assumptions rather than a set (as in the unrestricted case) or multiset (as in the linear case). The order in which the pieces of the context are put together matters; for left implication, we make the assumption on the left of the current context, and analogously for right implication. Note that implication associates to the right (by syntactic convention), so A → B → C actually means A → (B → C), for any form of implication discussed in this document. For some intuition, consider propositions as resources again, but imagine an ATM instead of a vending machine: there’s a sequence of steps (insert credit card, enter PIN, select options) that must be performed in order to yield the withdrawal of money. The proposition “insert credit card ։ enter PIN ։ select options ։ cash” enforces this ordering. One could also express it in left implications: “select options enter pin insert credit card cash”, or in some combination of left and right: “enter PIN ։ insert credit card select options ։ cash”. 1 The two forms of ordered implication are defined as follows in natural deduction style (similar to the formulation presented in Polakow’s thesis): Ω, A ⊢ B ։I Ω⊢A։B To introduce a right implication, prove the consequent from the context along with the assumption attached to the right side. Ω ⊢ A ։ B ΩA ⊢ A ։E Ω, ΩA ⊢ B To eliminate a right implication, prove the antecedent under some context ΩA , and plug in those assumptions on the right hand side of the context that yields the implication to get the consequent. A, Ω ⊢ B I Ω⊢AB 1 Note, however, that these different formulations are only equivalent in the sense that they entail each other linearly or unrestrictedly – they do not entail one another in the ordered system.
5
To introduce a left implication, now we assume the antecedent on the lefthand side. Ω ⊢ A B ΩA ⊢ A E ΩA , Ω ⊢ B To eliminate a left implication, plug in the resources used to produce it on the left hand side of the context with the implication to derive the consequent. It is important to note that although we say ordered logic “lacks” more structural rules, we are actually working toward a more expressive system. What we ultimately want is the ability to talk about many different kinds of provability (ordered, linear, unrestricted) and a way to move between them. Once we have “hit bottom”, so to speak, in terms of a restricted structure, we can introduce modalities to mobilize or unconstrain hypotheses, moving them between levels of restrictedness. As an example of why one might wish for the constraints present in purely ordered logic, consider parsing natural language sentences. (This approach could be used for formal languages as well.) We can write down a rule for sentence formation: np ։ vp ։ snt That is, a sentence is a verb phrase to the right of a noun phrase. We can add a few more rules, using tv to denote a verb with an object (e.g. “eat”) and det to denote a determiner like “a” or “the” : tv ։ np ։ vp det ։ np ։ np dog ։ np cat ։ np the ։ det chased ։ tv The sentence “the dog chased the cat” indeed produces a snt under these rules; the order that words must come in is restricted by the right implication. If one were to think of these as types and write expressions to inhabit them, it should be clear that the unrestricted notion of → would allow you to arbitrarily permute, duplicate or discard the argument terms such that all notion of grammar is lost. One can then define a logic that combines all three reasoning approaches (unrestricted, linear, and ordered) to engender powerful programming or reasoning abilities. Consider the rules for linear implication, written with a ⊸: ∆, A, ∆′ ⊢ B ∆, ∆′ ⊢ A ⊸ B
6
∆ ⊢ A ⊸ B ∆A ⊢ A ∆ ⊲⊳ ∆A ⊢ B The ⊲⊳ here indicates “nondeterministic merge”, meaning that the contexts are put together in an order-agnostic manner. Our placement of the hypothesis A in the introduction rule is arbitrary, so we can assume it to be in the middle of some (possibly empty) contexts. In a combined reasoning system, we have unrestricted hypothesis in Γ, linear ones in ∆, and ordered ones in Ω, so the basic typing judgment turns into something like Γ; ∆; Ω ⊢ M : A. The exact specifications of such a system, however, are not important for getting a feel for how combined reasoning works. If we revisit our natural language parsing example, we can consider relative clauses rel, such as “whom the dog chased” – the word “whom” (for example) precedes what is essentially a sentence missing a noun phrase. We can express this with (np ⊸ snt) ։ whom rel The ⊸ indicates that the noun phrase can be missing from anywhere in the sentence; the indicates that the relativizer (“whom”) should go on the left of the incomplete sentence.
2.3
Ordered LF
Jeff Polakow’s thesis work [12] was a conservative extension of LF with the combined reasoning described above. He introduced many examples of applications of such a framework, wherein one can leverage the combined reasoning power of the metalanguage to do unprecedented things with object languages. One example is simply to use the framework as a logic programming tool in which one could easily write the parsing example above. Other examples of the logic programming tool (called Olli) leverage the fact that the ordered OLF context can behave very naturally as a stack or a queue, including • translating between λ-calculus terms and deBruijn-indexed terms • constructing an abstract machine for evaluating Mini-ML • mergesort A more compelling example for using OLF as a metatheoretic tool is a CPS (continuation passing style) language analysis. CPS-translated terms reflect the evaluation order of the source language, and in a left-to-right, call-by-value direct style, the CPS terms are such that continuation variables are used linearly, and local parameters to continuations form a stack. Polakow gives an encoding of CPS terms in OLF in which these occurrence invariants are captured implicitly in the ordered types. For a more in-depth explanation of this example, see [13]. 7
2.4
The Problem
OLF is a suitable framework for carrying out the metatheory of other logics and languages using the power of ordered logic. However, it has the unfortunate limitation of being unable to express the statements of ordered (and other substructural) metatheory itself. Consider, for example, the cut elimination theorem for ordered logic: Theorem 1 (Ordered Cut Admissibility). If ΩA ⊢ A and Ω1 , A, Ω2 ⊢ C, then Ω1 , ΩA , Ω2 ⊢ C. Encoding this theorem in OLF turns out to be difficult because we have no way to explicitly capture the structure of the context. It is the eventual hope that the Hybrid LF formulation we are about to present can solve this problem. Even without that, however, the hybrid formulation gives us access to a lot of power not present in OLF. We will visit examples of such possibilities at the end of this document.
3
Language
The language of LF is essentially the simply typed λ-calculus with dependent function types and kinds. Its syntax is given as terms M, N ::= types A ::= kinds K
::=
λx.N | M N | c | x Πx : A.A′ | a M1 . . . Mn Πx : A.K | type
where kinds classify type families in the way that types classify terms, and Πx : A. is the dependent form of types and kinds. We will use → as an abbreviation for the degenerate case of Π types and kinds where the body does not use the bound variable. Most of this syntax is not needed to understand the new concepts introduced in hybrid LF; it is here mainly for completeness.
3.1
Hybrid LF
Hybrid logic [3, 4, 2] was inspired by a combination of temporal logic and Kripke modal logic. The key notion of Hybrid LF is the notion of a world or label (this document will use these terms interchangeably). The basic typing judgment, rather than Γ ⊢ M : A, becomes Γ ⊢ M : A[p], where p is a world. This judgment can be read “M has type A under Γ and uses the resources described by p”. Consider the following example: if we have x:A, y:B, z:C ⊢ c x z z : D
8
we may wish to express that the term uses the hypothesis x once, z twice, and y no times – indeed, we may wish to express that it uses x and the two zs in the order that it does. Now the idea is to attach a label to the type (D in this case) that does this. The initial thought might be just to say x:A, y:B, z:C ⊢ c x z z : D[x, z, z] but this has the problem that the label’s well formedness (since it depends on terms) could depend on the current context, and the whole problem in the beginning was the inability to quantify over contexts. So we create a new syntactic class of worlds: p, q ::= α | p ∗ q | ǫ where ǫ is the empty world and α is a world variable. For now we leave it vague what ∗ should be other than joining two worlds together (this is not the final definition of worlds for the ordered case; this is a pedagogical example of what worlds can look like). If we want to carry through with our example above, we need some way of attaching worlds to resources. First of all, we need to allow world variable assumptions into our context: Γ ::= . . . | Γ, α : world Next, we need a type constructor that internalizes the notion of A[p], called @, defined as Γ ⊢ M : A[p] Γ ⊢ M : (A@p)[q] Γ ⊢ M : (A@p)[q] Γ ⊢ M : A[p] Now we can express the notion of a variable in the context being attached to a world by adding α : world, x : A@α to the context. Going back to our example, we can now say something like α : world, β : world, γ : world, x:A@α, y:B@β, z:C@γ ⊢ c x z z : D[α ∗ γ ∗ γ] to show that the term consumes x, z, and z.
9
3.2
Ordered Worlds
The missing piece now is what these worlds need to look like, and how they need to behave, to be expressive enough for ordered (and in particular, combined) metareasoning. At the very least we would like a system with the same expressiveness as OLF. In the formulation of HLF for linear logic, the ∗ operator is defined to form a commutative monoid with ǫ; that is, it is associative and commutative, and p, ǫ ∗ p, and p ∗ ǫ are all equivalent. Our first attempt at adapting this system to combined reasoning with ordered logic was to introduce a new world connective, •, the same as ∗ but noncommutative. This turns out to work for expressing the orderedness of the context, but it does not work well in conjunction with commutative ∗, at least for the purposes of encoding OLF. Instead, our only binary operator is •, and we have a unary “mobility” operator on worlds, ¡, which allows the world it’s applied to to move around freely in the otherwise ordered structure. Formally, our world grammar is now p, q ::= α | p • q | ¡p | ǫ and we have the following equivalence axioms: (p • q) • r p•ǫ
≡ p • (q • r) ≡ p
ǫ•p ≡ p ¡p • q ≡ q • ¡p ¡ǫ ¡¡p ¡(¡p • ¡q)
≡ ǫ ≡ ¡p ≡ ¡p • ¡q
The first three axioms give associativity of • and unity of ǫ; the rest of the axioms detail how the ¡ operator works. Its defining characteristic is that any world under a ¡ can commute with any world adjacent to it. Additionally, any world under a ¡ that consists of only other worlds under ¡s is equivalent to the same world without the outer ¡. Now we can encode right, left, linear, and unrestricted implication in our system, in natural deduction style, as follows: Γ, α : world, x : A@α ⊢ M : B[p • α] ։I Γ ⊢ λx.AM : A ։ B[p] Γ, α : world, x : A@α ⊢ M : B[α • p] I Γ ⊢ λx.AM : A B[p]
10
Γ, α : world, x : A@(¡α) ⊢ M : B[p • ¡α] ⊸I Γ ⊢ λx.AM : A ⊸ B[p] Γ, x : A@ǫ ⊢ M : B[p] →I Γ ⊢ λx.AM : A → B[p] Γ ⊢ M1 : A ։ B[p] Γ ⊢ M2 : A[q] ։E Γ ⊢ M1 M2 : B[p • q] Γ ⊢ M1 : A B[p] Γ ⊢ M2 : A[q] E Γ ⊢ M1 M2 : B[q • p] Γ ⊢ M1 : A ⊸ B[p] Γ ⊢ M2 : A[¡q] ⊸E Γ ⊢ M1 M2 : B[p • ¡q] Γ ⊢ M1 : A → B[p] Γ ⊢ M2 : A[ǫ] →E Γ ⊢ M1 M2 : B[p] These rules are presented here initially in natural deduction style for pedagogical reasons. Later in the document we will present the real formal system in spine form. In addition to the addition of labels and the @ type operator, we add two more type operators: A ::= . . . | ∀p.A | ↓p.A Intuitively, the ∀ operator quantifies over all worlds, and the ↓ operator binds the “current” world. They are defined formally as follows. Γ, α : world ⊢ M : A[p] Γ ⊢ M : ∀α.A[p] Γ ⊢ M : ∀α.A[p] Γ ⊢ q : world Γ ⊢ M : [q/α]A[p] Γ ⊢ M : ([p/α]A)[p] Γ ⊢ M : ↓α.A[p] Γ ⊢ M : ↓α.A[p] Γ ⊢ M : [p/α]A[p] Additionally, we add the universal quantification to kinds: K ::= . . . | ∀p.K 11
defined analogously to the ∀ type operator. This completes the definition of the extension to the logical framework. It should be noted that the inclusion of the ∀ and ↓ type operators makes the inclusion of ⊸, ։, and redundant. We can define them in the following way: A ։ B ≡def ∀α ↓ β.A@α → B@β • α A B ≡def ∀α ↓ β.A@α → B@α • β A ⊸ B ≡def ∀α ↓ β.A@¡α → B@β • ¡α
3.3
Spine form
To give a formal account of the system, I am using a piece of logical frameworks machinery known as spine form [5]. This is a different way of formulating LF terms wherein all arguments to a function (and projections from pairs, if we had them) are contrained to appear in a spine, and all expressions of function applications take the form of a head (variable or constant) applied to a spine. As an example, the term λx.λy.(c x) y would turn into λx.λy.c · (x; y). The motivation for using spine form draws from the idea of focussing in theorem proving ([1], [7]) and allows us to perform eliminations all at once. 3.3.1
Spine form HLF
Our complete type theory with spines is as follows. Syntax: worlds kinds types terms spines contexts
p, q, r K A M, N S Γ
::= ::= ::= ::= ::= ::=
α | p • q | ¡p | ǫ Πx : A.K | ∀α.K | type Πx : A.A′ | a · S | ∀α.B | ↓α.B | A@p λx.N | M N | c · S | x · S () | (M ; S) · | Γ, x : A | Γ, α : world
World formation rules: α : world ∈ Γ Γ ⊢ α : world Γ ⊢ p ⇐ world Γ ⊢ ¡p : world Γ ⊢ p ⇐ world Γ ⊢ q ⇐ world Γ ⊢ p • q : world 12
The rest of the type theory is identical to (a subset of) that in [14], reproduced here for posterity. There are four judgments: Γ ⊢ p : world Γ ⊢ M : A[p] Γ ⊢ A : type Γ ⊢ S : A[p] > C[r] The first and third check well-formedness of worlds and types, respectively. The second is a type checking judgment parameterized by a world. The fourth is a spine typing judgment that says S is a spine which, if a head of type A@p is applied to it, will produce a term C that uses resources r. 3.3.2
Type checking
We write R to stand for either x · S or c · S. Γ ⊢ R : a · S[p] S =α S ′ Γ ⊢ R : a · S ′ [q]
p ≡E q
Γ, x : A ⊢ M : B[p] Γ ⊢ λx.M : Πx:A.B[p] Γ, α:world ⊢ M : B[p] Γ ⊢ M : ∀α.B[p] Γ ⊢ M : [p/a]B[p] Γ ⊢ M : ↓α.B[p] Γ ⊢ M : A[q] Γ ⊢ M : A@q[p] x:A ∈ Γ Γ ⊢ S : A[ǫ] > C[r] Γ ⊢ x · S : C[r] c:A ∈ Σ Γ ⊢ S : A[ǫ] > C[r] Γ ⊢ c · S : C[r]
13
3.3.3
Spine Typing Γ ⊢ () : a · S[p] > a · S[p] Γ ⊢ M : A[ǫ] Γ ⊢ S : [M/x]B[p] > C[r] Γ ⊢ (M ; S) : Πx:A.B[p] > C[r] Γ ⊢ q : world Γ ⊢ S : [q/α]B[p] > C[r] Γ ⊢ S : ∀α.B[p] > C[r] Γ ⊢ S : [p/α]B[p] > C[r] Γ ⊢ S : ↓α.B[p] > C[r] Γ ⊢ S : A[q] > C[r] Γ ⊢ S : A@q[p] > C[r]
3.3.4
Spine form OLF
Jeff Polakow’s formulation of OLF does not use spines, so here we write down formulation in order to illustrate how spines should work in an ordered framework and also for the sake of the embedding in the next section. Basic typing judgment for spines in OLF: Γ; ∆; Ω1 − Ω2 ⊢OLF S : A > B ∆1 ⊲⊳ ∆2 is the nondeterministic merge operation from before. Rules: Nil Γ; ·; · − · ⊢OLF () : a · S > a · S Ordered right spine cons Γ; ∆1 ; Ω12 ⊢OLF M : A Γ; ∆2 ; Ω1 − Ω2 ⊢OLF S : B > C Γ; ∆1 ⊲⊳ ∆2 ; Ω1 − Ω12 Ω2 ⊢OLF (M ; S) : A ։ B > C Ordered left spine cons Γ; ∆1 ; Ω12 ⊢OLF M : A Γ; ∆2 ; Ω1 − Ω2 ⊢OLF S : B > C Γ; ∆1 ⊲⊳ ∆2 ; Ω1 Ω12 − Ω2 ⊢OLF (M ; S) : A B > C Linear spine cons Γ; ∆1 ; · ⊢OLF M : A Γ; ∆2 ; Ω1 − Ω2 ⊢OLF S : B > C Γ; ∆1 ⊲⊳ ∆2 ; Ω1 − Ω2 ⊢OLF (M ; S) : A ⊸ B > C
14
Unrestricted spine cons Γ; ·; · ⊢OLF M : A Γ; ∆; Ω1 − Ω2 ⊢OLF S : B > C Γ; ∆; Ω1 − Ω2 ⊢OLF (M ; S) : A → B > C Ordered variable Γ; ∆; Ω1 − Ω2 ⊢OLF S : A > C Γ; ∆; Ω1 x : AΩ2 ⊢OLF x · S ⇐ C Linear variable Γ; ∆; Ω1 − Ω2 ⊢OLF S : A > C Γ; ∆, x : A; Ω1 Ω2 ⊢OLF x · S ⇐ C
4
Metatheory of Hybrid OLF
This section addresses properties we would like to prove of the framework we’ve just defined.
4.1
A conservative extension
We would like to show that Hybrid OLF is a conservative extension of OLF. To do this, we define an encoding of each OLF connective, and prove this encoding “correct” with respect to OLF. “Correct” means two things: first, that everything derivable in the image of the translation into Hybrid OLF is similarly derivable in the domain (soundness); second, that everything derivable in OLF is similarly derivable in the image of its translation (completeness). 4.1.1
Soundness
We have a translation (not defined here) from any of a set of OLF contexts (Γ, ∆, Ω) to an HLF context (Γ) that defines a world for each variable in the appropriate way, and similarly a translation from HLF contexts to eac OLF context, relative to some world, that takes the relevant world variables and pulls out from the context the term variables that are attached to them. Given these, we can say the following: Theorem 2 (Soundness). If a term M translated from OLF has type A[p] in HLF, then in OLF it has type A under a context related to p. A formal statement and proof of soundness follows. First, we need several auxilliary definitions and lemmas.
15
4.2 4.2.1
Definitions and lemmas for soundness/completeness Translating contexts
Given OLF contexts ∆ and Ω, Ω@ is defined as (x1 : A1 , . . . , xn : An )@ = (α1 : world, x1 : A1 @α1 , . . . , αn : world, xn : An @αn ) ∆¡ is defined as (x1 : A1 , . . . , xn : An )¡ = (α1 : world, x1 : A1 @¡α1 , . . . , αn : world, xn : An @¡αn ) Given p ; (o[p], u[p]), the OLF context Ω⇂o[p] = (x1 : A1 , . . . , xm : Am ) such that o[p] ≡ α1 . . . αm for distinct i such that xi : Ai @αi ∈ Ω for every i ∈ 1 . . . m, and the OLF context ∆⇂u[p] = (x1 : A1 , . . . , xm : Am ) such that u[p] ≡ ¡α1 . . . ¡αm for distinct i such that xi : Ai @¡αi ∈ ∆ for every i ∈ 1 . . . m. 4.2.2
Lemmas about worlds
Separation In the embedding of OLF, we will make use of a canonical separation of worlds into ordered parts and unordered parts. The details of this separation will not be filled in here; we will demand certain axioms of this operation for the proof, with the belief that such an operation can be constructed (although this was not fully fleshed out, as it was not the primary focus of the work). The basic idea: every world in the codomain of the OLF translation can be “flattened” into (o[p], u[p]) (an ordered part and an unordered part) where the former can be treated as a list of atoms and the latter as a multiset of mobile atoms. Formally, this means we will require (where p ; (o[p], u[p]) means “p separates as ordered part o[p] and u[p]”) • p • q ; (o[p]o[q], u[p]u[q]) • ¡p ; (ǫ, o[p]u[p]) • If p ≡ p′ , then o[p] ≡ o[p′ ] up to associativity and unity of nil, and u[p] ≡ u[p′ ] up to multiset equality (ACU). • If p ; (o, u) and p′ ; (o′ , u′ ), where o′ ≡AU o and u ≡ACU u′ , then p ≡ p′ .
16
We will treat o[p] and u[p] as opaque functions that project out the appropriate component of the pair that results from separation. The image of the o and u “functions” is opaque but for the fact that we know we can list-append os and multiset union us in the expected way (both represented by adjacency in my notation). Factorization If A is an OLF type, and Γ, ∆@ , Ω¡ ⊢ S : A[p] > C[r], then there exist worlds q1 and q2 such that r ≡E q1 • p • q2 . Proof proceeds by induction over the formation of worlds. Statement (general): If Γ, ∆¡ , Ω@ ⊢ M : A[p] then there exists a world p′ such that p ≡ p′ and Γ; ∆⇂u[p′ ] ; Ω⇂o[p′ ] ⊢OLF M : A Statement (spines): If
Γ, ∆¡ , Ω@ ⊢ S : A[p] > B[r] then there exist q1 and q2 such that o[r] u[r]
≡ o[q1 ]o[p]o[q2 ] ≡ u[q2 ]u[p]u[q2 ]
and Γ; ∆⇂u[q1 ]u[q2 ] ; Ω⇂o[q1 ] − Ω⇂o[q2 ] ⊢OLF S : A > B Proof by induction on the typing derivation. Case: Nil Assume Γ, ∆¡ , Ω@ ⊢ () : a · S[p] > a · S[p]
o[p]
≡AU
o[ǫ]o[p]o[ǫ]
u[p]
≡ACU
u[ǫ]u[p]u[ǫ]
and by the OLF nil spine rule, Γ; ·; · − · ⊢OLF () : a · S > a · S By definition, ∆⇂ǫ and Ω⇂ǫ are ·, so by letting q1 and q2 be ǫ, we have Γ; ∆⇂u[q1 ]u[q2 ] ; Ω⇂o[q1 ] − Ω⇂o[q2 ] ⊢OLF () : a · S > a · S as needed.
17
Case: Ordered-right spine cons Assume Γ, ∆¡ , Ω@ ⊢ (M ; S) : ∀α.↓β.A@α → B@(β • α)[p] > C[r] By inversion, Γ, ∆¡ , Ω@ ⊢ M ⇐ A[s] Γ, ∆¡ , Ω@ ⊢ S : B[p • s] > C[r] Γ, ∆¡ , Ω@ ⊢ (M ; S) : A@s → B@(p • s)[p] > C[r] Γ, ∆¡ , Ω@ ⊢ (M ; S) : ↓β.A@s → B@(β • s)[p] > C[r] Γ, ∆¡ , Ω@ ⊢ (M ; S) : ∀α.↓β.A@α → B@(β • α)[p] > C[r] By inductive hypothesis on the top left sequent, there exists a world s′ such that s ≡ s′ and Γ; ∆⇂u[s] ; Ω⇂o[s′ ] ⊢OLF M ⇐ A By rule, o[s] ≡ o[s′ ] u[s] ≡ u[s′ ] q2′
By induction hypothesis on the top right sequent, there exist some q1′ and such that Γ; ∆⇂u[q1′ ]u[q2′ ] ; Ω⇂o[q1′ ] − Ω⇂o[q2′ ] ⊢OLF S : B > C and o[r] u[r]
≡ o[q1′ ]o[p • s]o[q2′ ] ≡ u[q1′ ]u[p • s]u[q2′ ]
By OLF spine typing rule, Γ; ∆⇂u[s] ; Ω⇂o[s] ⊢OLF M ⇐ A Γ; ∆⇂u[q1′ ]u[q2′ ] ; Ω⇂o[q1′ ] − Ω⇂o[q2′ ] ⊢OLF S : B > C Γ; ∆⇂u[q1′ ]u[s]u[q2′ ] ; Ω⇂o[q1′ ] − Ω⇂o[s]o[q2′ ] ⊢OLF (M ; S) : A ։ B > C By rule, u[s]u[q2′ ] ≡ u[s • q2′ ] and o[s]o[q2′ ] ≡ o[s • q2′ ] so by letting q1 = q1′ and q2 = s • q2′ , we have 18
o[r] ≡ o[q1 ]o[p]o[q2 ] and Γ; ∆⇂u[q1 ]u[p]u[q2 ] ; Ω⇂q1 − Ω⇂q2 ⊢OLF (M ; S) : A ։ B > C as needed.
Case: Ordered-left spine cons Assume Γ, ∆¡ , Ω@ ⊢ (M ; S) : ∀α.↓β.A@α → B@(α • β)[p] > C[r] By inversion, Γ, ∆¡ , Ω@ ⊢ M ⇐ A[s] Γ, ∆¡ , Ω@ ⊢ S : B[s • p] > C[r] Γ, ∆¡ , Ω@ ⊢ (M ; S) : A@s → B@(s • p)[p] > C[r] Γ, ∆¡ , Ω@ ⊢ (M ; S) : ↓β.A@s → B@(s • β)[p] > C[r] Γ, ∆¡ , Ω@ ⊢ (M ; S) : ∀α.↓β.A@α → B@(α • β)[p] > C[r] By inductive hypothesis on the top left sequent, Γ; ∆⇂u[s] ; Ω⇂o[s] ⊢OLF M ⇐ A q2′
By induction hypothesis on the top right sequent, there exist some q1′ and such that Γ; ∆⇂u[q1′ ]u[q2′ ] ; Ω⇂o[q1′ ] − Ω⇂o[q2′ ] ⊢OLF S : B > C and o[r] u[r]
≡ o[q1′ ]o[s • p]o[q2′ ] ≡ u[q1′ ]u[s • p]u[q2′ ]
By OLF spine typing rule, Γ; ∆⇂u[s] ; Ω⇂o[s] ⊢OLF M ⇐ A Γ; ∆⇂u[q1′ ]u[q2′ ] ; Ω⇂o[q1′ ] − Ω⇂o[q2′ ] ⊢OLF S : B > C Γ; ∆⇂u[q1′ ]u[s]u[q2′ ] ; Ω⇂o[q1′ ]o[s] − Ω⇂o[q2′ ] ⊢OLF (M ; S) : A ։ B > C By rule, u[q1′ ]u[s] ≡ u[q1′ • s] and o[q1′ ]o[s] ≡ o[q1′ • s] 19
so by letting q1 = q1′ • s and q2 = q2′ , we have o[r] ≡ o[q1 ]o[p]o[q2 ] and Γ; ∆⇂u[q1 ]u[p]u[q2 ] ; Ω⇂q1 − Ω⇂q2 ⊢OLF (M ; S) : A ։ B > C as needed.
Case: Linear spine cons Assume Γ, ∆¡ , Ω@ ⊢ (M ; S) : ∀α.↓β.A@¡α → B@(β • ¡α)[p] > C[r] By inversion Γ, ∆¡ , Ω@ ⊢ M ⇐ A[¡s] Γ, ∆¡ , Ω@ ⊢ S : B[p • ¡s] > C[r] Γ, ∆¡ , Ω@ ⊢ (M ; S) : A@¡s → B@(p • ¡s)[p] > C[r] Γ, ∆¡ , Ω@ ⊢ (M ; S) : ↓β.A@¡s → B@(β • ¡s)[p] > C[r] Γ, ∆¡ , Ω@ ⊢ (M ; S) : ∀α.↓β.A@¡α → B@(β • ¡α)[p] > C[r] By inductive hypothesis on the top left sequent, Γ; ∆⇂u[¡s] ; Ω⇂o[¡s] ⊢OLF M ⇐ A o[¡s] is empty, so Γ; ∆⇂u[¡s] ; · ⊢OLF M ⇐ A By IH on the top right sequent, there exist worlds q1′ and q2′ such that Γ; ∆⇂u[q1′ ]u[q2′ ] ; Ω⇂q1′ − Ω⇂q2′ ⊢OLF S : B > C and o[r]
≡ o[q1′ ]o[p • ¡s]o[q2′ ] ≡ o[q1′ ]o[p]o[q2′ ] ≡ o[q1′ ]o[p]o[¡s]o[q2′ ] ≡ o[q1′ ]o[p]o[¡s • q2′ ]
u[r]
≡ u[q1′ ]u[p • ¡s]u[q2′ ] ≡ u[q1′ ]u[p]u[¡s]u[q2′ ] ≡ u[q1′ ]u[p]u[¡s • q2′ ]
By OLF linear spine cons rule,
20
Γ; ∆⇂u[¡s] ; · ⊢OLF M ⇐ A Γ; ∆⇂u[q1′ ]u[q2′ ] ; Ω⇂q1′ − Ω⇂q2′ ⊢OLF S : B > C Γ; ∆⇂u[¡s] ⊲⊳ ∆⇂u[q1′ ]u[q2′ ] ; Ω⇂o[q1′ ] − Ω⇂o[q2′ ] ⊢OLF (M ; S) : A ⊸ B > C By the definition of ∆⇂, ∆⇂u[¡s] ⊲⊳ ∆⇂u[q1′ ]u[q2′ ] = ∆⇂u[¡s]u[q1′ ]u[q2′ ] and u[¡s]u[q1′ ]u[q2′ ] ≡ u[q1′ ]u[¡s]u[q]′2 ≡ u[q1′ ]u[¡s • q2′ ] so we have Γ; ∆⇂u[q1′ ]u[¡s•q2′ ] ; Ω⇂o[q1′ ] − Ω⇂o[¡s•q2′ ] ⊢OLF (M ; S) : A ⊸ B > C Set q1 = q1′ and q2 = ¡s • q2′ : Γ; ∆⇂u[q1 ]u[q2 ] ; Ω⇂o[q1 ] − Ω⇂o[q2 ] ⊢OLF (M ; S) : A ⊸ B > C
o[r] u[r]
≡ o[q1 ]o[p]o[q2 ] ≡ u[q1 ]u[p]u[q2 ]
as needed.
Case: Ordinary spine cons
Assume Γ, ∆¡ , Ω@ ⊢ (M ; S) : A → B[p] > C[r] By inversion, Γ, ∆¡ , Ω@ ⊢ M ⇐ A[ǫ] Γ, ∆¡ , Ω@ ⊢ S : B[ǫ] > C[r] Γ, ∆¡ , Ω@ ⊢ (M ; S) : A → B[p] > C[r] By IH on the top left sequent, since o[ǫ] and u[ǫ] are nil and ∆⇂ǫ and Ω⇂ǫ are both ·, Γ; ·; · ⊢OLF M ⇐ A By IH on the top right sequent, there exist q1′ and q2′ such that
21
o[r]
≡ o[q1′ ]o[ǫ]o[q2′ ] ≡ o[q1′ ]o[q2′ ]
u[r]
≡ u[q1′ ]u[ǫ]u[q2′ ] ≡ u[q1′ ]u[q2′ ]
and Γ; ∆⇂u[q1′ ]u[q2′ ] ; Ω⇂q1′ − Ω⇂q2′ ⊢OLF S : B > C By OLF ordinary spine cons rule, and by setting q1 = q1′ and q2 = q2′ , we get Γ; ∆⇂u[q1 ]u[q2 ] ; Ω⇂q1 − Ω⇂q2 ⊢OLF (M ; S) : A → B > C as needed.
Case: Ordered lambda right Γ, ∆¡ , Ω@ , αx : world, x : A@αx ⊢ M ⇐ B[p • αx ] Γ, ∆¡ , Ω@ ⊢ λx.M ⇐ A ։ B[p] By inductive hypothesis, Γ; ∆⇂u[p•αx ] ; Ω⇂o[p•αx ] ⊢OLF M ⇐ B Since u[αx ] is nil and Ω⇂o[p•αx ] is Ω⇂o[p] , x : A, we have Γ; ∆⇂u[p] ; Ω⇂o[p] , x : A ⊢OLF M ⇐ B Γ; ∆⇂u[p] ; Ω⇂o[p] ⊢OLF λx.M ⇐ A ։ B as needed.
Case: Ordered lambda left Γ, ∆¡ , Ω@ , αx : world, x : A@αx ⊢ M ⇐ B[αx • p] Γ, ∆¡ , Ω@ ⊢ λx.M ⇐ A B[p] By inductive hypothesis, Γ; ∆⇂u[αx •p] ; Ω⇂o[αx •p] ⊢OLF M ⇐ B Since u[αx ] is nil and Ω⇂o[αx •p] is x : A, Ω⇂o[p] , we have Γ; ∆⇂u[p] ; Ω⇂x:A,o[p] ⊢OLF M ⇐ B Γ; ∆⇂u[p] ; Ω⇂o[p] ⊢OLF λx.M ⇐ A B 22
as needed.
Case: Linear lambda Γ, ∆¡ , αx : world, x : A@¡αx , Ω@ ⊢ M ⇐ B[p • ¡αx ] Γ, ∆¡ , Ω@ ⊢ λx.M ⇐ A ⊸ B[p] By inductive hypothesis, Γ; ∆⇂u[p•αx ] ; Ω⇂o[p•¡αx ] ⊢OLF M ⇐ B Since o[¡αx ] is nil and ∆⇂u[p•¡αx ] is ∆⇂u[p] , x : A, we have Γ; ∆⇂u[p] , x : A; Ω⇂o[p] ⊢OLF M ⇐ B Γ; ∆⇂u[p] ; Ω⇂o[p] ⊢OLF λx.M ⇐ A ⊸ B as needed.
Case: Ordinary lambda Γ, x : A, ∆¡ , Ω@ ⊢ M ⇐ B[p] Γ, ∆¡ , Ω@ ⊢ λx.M ⇐ A → B[p] By inductive hypothesis, Γ, x : A; ∆⇂u[p] ; Ω⇂o[p] ⊢OLF M ⇐ B Γ; ∆⇂u[p] ; Ω⇂o[p] ⊢OLF λx.M ⇐ A → B as needed.
Case: Ordered variable x : A@αx ∈ Ø@
Γ, ∆¡ , Ω@ ⊢ S : A[αx ] > C[r] Γ, ∆¡ , Ω@ ⊢ S : A@α [ǫ] > C[r] x
Γ, ∆¡ , Ω@ ⊢ x · S ⇒ C[r] By IH, there exist q1 and q2 such that o[r] u[r]
≡ o[q1 ]o[αx ]o[•q2 ] ≡ u[q1 ]u[αx ]u[q2 ]
and Γ; ∆⇂u[q1 ]u[q2 ] ; Ω⇂o[q1 ] − Ω⇂o[q2 ] ⊢OLF S : A > C Γ; ∆⇂u[q1 ]u[q2 ] ; Ω⇂o[q1 ] x : AΩ⇂o[q2 ] ⊢OLF x · S ⇒ C 23
Ω⇂o[q1 ] x : AΩ⇂o[q2 ] is Ω⇂o[r] , and ∆⇂u[q1 ]u[q2 ] is ∆⇂u[r] because u[αx ] is nil, so this is as needed.
Case: Linear variable x : A@¡αx ∈ ∆¡
Γ, ∆¡ , Ω@ ⊢ S : A[¡αx ] > C[r] Γ, ∆¡ , Ω@ ⊢ S : A@¡α [ǫ] > C[r] x
Γ, ∆¡ , Ω@ ⊢ x · S ⇒ C[r] By IH, there exist q1 and q2 such that o[r]
≡ o[q1 ]o[¡αx ]o[q2 ] ≡ o[q1 ]o[q2 ] ≡ o[q1 ]o[q2 • ¡αx ]
u[r]
≡ u[q1 ]u[¡αx ]u[q2 ] ≡ u[q1 ]u[q2 ]u[¡αx ] ≡ u[q1 ]u[q2 • ¡αx ]
and Γ; ∆⇂u[q1 ]u[q2 ] ; Ω⇂o[q1 ] − Ω⇂o[q2 ] ⊢OLF S : A > C Γ; ∆⇂u[q1 ]u[q2 ] , x : A; Ω⇂o[q1 ] Ω⇂o[q2 ] ⊢OLF x · S ⇒ C Since ∆⇂u[q1 ]u[q2 ] , x : A is ∆⇂r , this is as needed. Case: Ordinary variable Γ, ∆¡ , Ω@ ⊢ S : A[ǫ] > C[r] Γ, ∆¡ , Ω@ ⊢ x · S ⇒ C[r]
x:A∈Γ
By IH, there exist worlds q1 and q2 such that o[r]
≡ o[q1 ]o[ǫ]o[q2 ] ≡ o[q1 ]o[q2 ] ≡ o[q1 • q2 ]
u[r]
≡ u[q1 ]u[ǫ]u[q2 ] ≡ u[q1 ]u[q2 ] ≡ u[q1 • q2 ]
and 24
Γ; ∆⇂u[q1 ]u[q2 ] ; Ω⇂o[q1 ] − Ω⇂o[q2 ] ⊢OLF S : A > C Γ; ∆⇂u[q1 ]u[q2 ] ; Ω⇂o[q1 ]o[q2 ] ⊢OLF x · S ⇒ C Since o[r] u[r]
≡ o[q1 • q2 ] ≡ u[q1 • q2 ]
by rule, r ≡ q1 • q2 , so this is as needed.
This concludes the proof of soundness. 4.2.3
Completeness
Given similar context translations and similar caveats about generality as above: Theorem 3 (Completeness). Given a term M well-typed with A in OLF, the translation of M is well-typed as A[p] in HLF, for all p correctly constructed from the OLF context. Statement (general): If Γ; ∆; Ω ⊢OLF M : A then
Γ, ∆¡ , Ω@ ⊢ M : A[p]
where o[p] = αΩ and u[p] = α∆ . Statement (spines): If Γ; ∆; Ω1 − Ω2 ⊢OLF S : A > C @ then for all ∆′ , Ω′1 , Ω′2 extending ∆¡ , Ω@ 1 , Ω2 respectively, and for any world p ′ ′ ′ such that ∆ , Ω1 , Ω2 ⊢ p world, there exsists a q such that o[q] ≡ αΩ1 o[p]αΩ2 and u[q] ≡ u[p]u[αD elta] such that Γ, ∆′ , Ω′ ⊢ S : A[p] > C[q] Proof by induction on the typing derivation. The proof of completeness is unfinished; a later version of this document will contain it in full. 25
4.3
Other Theorems
We have conjectured decidability of typechecking, which is to say that the typechecking process will always terminate. It is clear that this holds for at least the fragment of our system in the image of the translation from OLF, since typechecking of OLF has been proven decidable. The remainder is conjectured to be decidable, given that a similar problem, namely the word problem for semigroups, is decidable, but whether this works in the expected way is not yet known.
5 5.1
Conclusion Contributions
I have presented a formulation of an ordered logical framework within the hybrid logical framework, constructing evidence for the feasibility of the extension of the hybrid logic approach to more expressive settings. I have worked out the necessary algebra on worlds for this extension and proven that they provide a faithful embedding of OLF into the framework. I have worked on several examples to show the potential applications of such a framework.
5.2
Future Work
We have shown that our hybrid logical framework is a conservative extension of OLF, and thus it has the full power to express the OLF examples described in the introduction. However, we would also like to know that we have gained something over OLF. In particular, there are objects of this framework outside of the image of the translation of OLF, given the ¡ operator on worlds, the ↓ operator on types and then ∀ operators on types and kinds. In particular, I am hoping to explore how this framework can express something akin to the memory layout system described in [9]. This system uses a mobility operator, similar to ¡ but on types, to express pointers into the heap – data whose address in memory is arbitrary – whereas the adjacency properties given of the ordered fuse (•) allow representation of structs and ordered pairs whose adjacency in memory is critical. Finally, the main projected goal for future work is to describe the metatheory of ordered logic in this system.
26
References [1] J. M. Andreoli. Logic programming with focusing proofs in linear logic. Journal of Logic and Computation, 2(3):297–347, 1992. [2] C. Areces, P. Blackburn, and M. Marx. Hybrid logics: Characterization, interpolation and complexity. Journal of Symbolic Logic, 66(3):977–1010, 2001. [3] T. Bra¨ uner and V. de Paiva. Towards constructive hybrid logic. Elec. Proc. of Methods for Modalities, 3, 2003. [4] Torben Bra¨ uner and Valeria de Paiva. Intuitionistic hybrid logic. To appear., 2006. [5] Iliano Cervesato and Frank Pfenning. A linear spine calculus. Technical Report CMU-CS-97-125, Department of Computer Science, Carnegie Mellon University, April 1997. [6] Jean-Yves Girard. Linear logic. Theoretical Computer Science, 50:1–102, 1987. [7] J.Y. Girard. Locus Solum: From the rules of logic to the logic of rules. Mathematical Structures in Computer Science, 11(03):301–506, 2001. [8] Robert Harper, Furio Honsell, and Gordon Plotkin. A framework for defining logics. Journal of the Association for Computing Machinery, 40(1):143– 184, January 1993. [9] Leaf Petersen, Robert Harper, Karl Crary, and Frank Pfenning. A type theory for memory allocation and data layout. In G. Morrisett, editor, Conference Record of the 30th Annual Symposium on Principles of Programming Languages (POPL’03), pages 172–184, New Orleans, Louisiana, January 2003. ACM Press. Extended version available as Technical Report CMU-CS-02-171, December 2002. [10] Frank Pfenning and Conal Elliott. Higher-order abstract syntax. In Proceedings of the ACM SIGPLAN ’88 Symposium on Language Design and Implementation, pages 199–208, Atlanta, Georgia, June 1989. [11] Frank Pfenning and Carsten Sch¨ urmann. System description: Twelf — a meta-logical framework for deductive systems. In H. Ganzinger, editor, Proceedings of the 16th International Conference on Automated Deduction (CADE-16), pages 202–206, Trento, Italy, July 1999. Springer-Verlag LNAI 1632. [12] Jeff Polakow. Ordered Linear Logic and Applications. PhD thesis, School of Computer Science, Carnegie Mellon University, May 2001. Available as Technical Report CMU-CS-01-152.
27
[13] Jeff Polakow and Frank Pfenning. Properties of terms in continuationpassing style in an ordered logical framework. In Jo¨elle Despeyroux, editor, 2nd Workshop on Logical Frameworks and Meta-languages (LFM’00), Santa Barbara, California, June 2000. Proceedings available as INRIA Technical Report. [14] Jason Reed. A hybrid metalogical framework. Thesis Proposal Working Draft, 2007.
28