A Proof Theory for Generic Judgments

Dale Miller INRIA-Futurs & École polytechnique and Alwen Tiu École polytechnique & Penn State University

The operational semantics of a computation system is often presented as inference rules or, equivalently, as logical theories. Specifications can be made more declarative and high-level if syntactic details concerning bound variables and substitutions are encoded directly into the logic using term-level abstractions (λ-abstraction) and proof-level abstractions (eigenvariables). When one wishes to use such logical theories to support reasoning about properties of computation, the usual quantifiers and proof-level abstractions do not seem adequate: proof-level abstraction of variables with scope over sequents (global scope) as well as over only formulas (local scope) seem required for many examples. We will present a sequent calculus which provides this local notion of prooflevel abstraction via generic judgment and a new quantifier, ∇, which explicitly manipulates such local scope. Intuitionistic logic extended with ∇ satisfies cut-elimination even when the logic is additionally strengthened with a proof theoretic notion of definitions. The resulting logic can be used to encode naturally a number of examples involving abstractions, and we illustrate the uses of ∇ with the π-calculus and an encoding of provability of an object-logic.

Categories and Subject Descriptors: F.4.1 [Mathematical Logic and Formal Languages]: Mathematical Logic—Proof Theory; F.3.1 [Logics and Meanings of Programs]: Specifying and Verifying and Reasoning about Programs—Specification Techniques

General Terms: Design, Theory, Verification Additional Key Words and Phrases: proof search, reasoning about operational semantics, generic judgments, λ-tree syntax, higher-order abstract syntax, ∇-quantifier

1. EIGENVARIABLES AND GENERIC REASONING

In specifying and reasoning about computations involving abstractions, one needs to encode both the static structure of such abstractions and their dynamic structure during computation. One successful approach to such an encoding, generally called λ-tree syntax [Miller 2000] (a proof search approach to higher-order abstract syntax [Pfenning and Elliott 1988]), uses λ-terms to encode the static structure of abstractions and universally quantified judgments to encode their dynamic structure. Consider in more detail the role of the universal quantifier and eigenvariables in proof search and the specification of computations.

Authors’ address: Dale Miller, Laboratoire d’Informatique (LIX), École polytechnique, Palaiseau 91128 CEDEX, France, e-mail: dale@lix.polytechnique.fr. Alwen Tiu, INRIA Lorraine, 615 Rue du Jardin Botanique, 54602 Villers-Les-Nancy, France, e-mail: Alwen.Tiu@loria.fr. Permission to make digital/hard copy of all or part of this material without fee for personal or classroom use provided that the copies are not made or distributed for profit or commercial advantage, the ACM copyright/server notice, the title of the publication, and its date appear, and notice is given that copying is by permission of the ACM, Inc. To copy otherwise, to republish, to post on servers, or to redistribute to lists requires prior specific permission and/or a fee.

\begin{matrix}c \\ ◯ \end{matrix} 2004 ACM 1529-3785/04/1200-0001 $5.00

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004, Pages 1–34.

2 · D. Miller and A. Tiu

There are, of course, at least a few ways to prove the universally quantified formula ∀_{τ} x.B. The extensional approach attempts to prove B[t/x] for all (closed) terms t of type τ. This rule might involve an infinite number of premises if the domain of the type τ is infinite. If the type τ is defined inductively, a proof by induction can replace the need for infinite premises with finite premises (the base cases and inductive cases) but with the need to discover invariants. Another more intensional approach, however, involves introducing a new variable, say, c : τ, that has not been introduced before in the proof, and attempting to prove the formula B[c/x] instead. In natural deduction and sequent calculus proofs, such new variables are called eigenvariables, and they are used to prove universally quantified formulas generically.

In Gentzen’s original presentation of the sequent calculus [Gentzen 1969], eigenvariables are immutable during proof search: once an eigenvariable is introduced (reading proofs bottom-up), it is not used as a site for substitution. In other words, eigenvariables did not vary during proof search: rather they acted more as new, scoped constants. As we now illustrate, it is the proof of cut-elimination that generally requires substitutions for eigenvariables: Assume that the sequent Γ ⟶ ∀x.B is proved using the introduction of ∀ on the right from the premise Γ ⟶ B[c/x], where c is an eigenvariable and Π(c) is a proof of this premise. Similarly, assume that the sequent Γ′, ∀xB ⟶ C is proved using the introduction of ∀ on the left from the premise Γ′, B[t/x] ⟶ C, where t is some term. To reduce the rank of the cut formula ∀x.B between the sequents Γ ⟶ ∀x.B and Γ′, ∀xB ⟶ C, the eigenvariable c in the sequent calculus proof Π(c) must be substituted by t to yield a proof Π(t) of Γ ⟶ B[t/x]: in this way, the cut-formula is now the smaller formula B[t/x]. In Gentzen, eigenvariables are sites for substitution only in the meta-theory of proofs and not in proofs themselves.

Notice that if the proof of cut-elimination is structured as above, then the intensional interpretation of the universal quantifier entails the extensional interpretation: Given a proof of Γ ⟶ ∀x.B with premise Γ ⟶ B[c/x] proved by Π(c), then instantiating c with t yields a proof Π(t) for Γ ⟶ B[t/x].

Recent years have witnessed two different developments in the role of eigenvariables in the specification of computation systems.

Eigenvariables as new, scoped constants. Focusing on their intensional nature and guarantee of newness in proof search, eigenvariables have been used to encode name restrictions in the π-calculus [Miller 1993], nonces in security protocols [Cervesato et al. 1999], reference locations in imperative programming [Pfenning and Rohwedder 1992; Chirimar 1995; Cervesato and Pfenning 1996; Miller 1996], new assumptions in encodings of natural deduction or sequent calculi [Felty and Miller 1988], and constructors hidden within abstract data-types [Miller 1989]. Eigenvariables also provide an essential aspect of recursive programming with data encoded using λ-tree syntax [Miller 2000]: to move recursively through syntax that is an outermost binder, instantiate the bound variable with an eigenvariable: that is, replace the term-level bound variable with a proof-level bound variable.

Eigenvariables as variables to instantiate. Computation in logic programming can be seen as a (restricted) form of cut-free proof search. Cut and cut-elimination

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

A proof theory for generic judgments · 3

{Σ; (σ, y : τ) ▷ B[y/x], Γ ⟶ C \atop Σ; σ ▷ ∇_{τ} x.B, Γ ⟶ C} ∇L  {Σ; Γ ⟶ (σ, y : τ) ▷ B[y/x] \atop Σ; Γ ⟶ σ ▷ ∇_{τ} x.B} ∇R

Fig. 1. Rules for the ∇-quantifier.

can then be used to reason directly about computation: for example, if A has a cut-free proof (that is, it can be computed) and we know that A ⊃ B can be proved (possibly with cuts), cut-elimination allows us to conclude that B has a cut-free proof (that is, it can be computed). As we mentioned above, such direct reasoning on logic specification involves instantiations of eigenvariables. Similarly, focusing on their extensional nature guaranteed by cut-elimination, enrichments to the sequent calculus have been proposed by [Hallnäs and Schroeder-Heister 1991; Schroeder-Heister 1992; Girard 1992; McDowell and Miller 2000] in which eigenvariables are intended as variables to be substituted during proof search. This enrichment to proof theory (discussed here in Section 4) holds promise for providing proof systems for the direct reasoning about logic specifications (see, for example, the above mentioned papers as well as [McDowell and Miller 2002; McDowell et al. 2003]).

These two approaches are, however, at odds with each other. Consider, for example, the problem of representing restriction of names or nonces using ∀ quantification. (The following example can be dualized in the event that a logical specification uses ∃ quantification instead of ∀, as in, for example, [Cervesato et al. 1999]). A cut-free proof of the formula ∀x∀y.P (x, y) proceeds by introducing two new and distinct “names” or “nonces” whereas a proof of the expression ∀z.P (z, z) involves just one such item. Of course, in logic, the implication ∀x∀y.P (x, y) ⊃ ∀z.P (z, z) holds, so if there is a proof with the two different names, there must be one with those names identified (via cut-elimination), and this is unlikely to be the intended meaning of such quantification. This suggests that when using eigenvariables solely to provide scope and newness to names, one cannot reason directly with the specification using cut-elimination, the centerpiece of proof theory.

Another setting where the difference between the extensional and intensional approaches to universal quantification occurs is when we consider having an assumption that is universally quantified. In Gentzen’s sequent system, having ∀_{τ} x.Bx as an assumption (that is, on the left of the sequent arrow) is essentially equated to having instead all instances Bt for terms t of type τ. There are cases (one is considered in more detail in Section 6) where we would like to make inferences from an assumption of the form ∀_{τ} x.Bx that holds independent of the set of its instances: the fact that such a statement could hold generically (intensionally) provides us with information stronger than examining all instances of it. This is particularly true in many intuitionistic settings where the domain of the type τ might be empty or at least not known to be inhabited.

2. THE ∇-QUANTIFIER

One approach to solving this problem of forcing one quantifier, the ∀-quantifier, to have two behaviors that are not entirely compatible, is to extend traditional logics (intuitionistic logic in our case) with a new quantifier. In this paper, we do this by adding the ∇-quantifier: its role will be to provide for variables to be abstracted

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

with local scope. The syntax of the formula ∇_{τ} x.B is like that for the universal and existential quantifiers. Following Church’s Simple Theory of Types [Church 1940], formulas are given the type o, and for all types τ not containing o, ∇_{τ} is a constant of type (τ → o) → o. The expression ∇_{τ} λx.B is usually abbreviated as simply ∇_{τ} x.B or as ∇x.B if the type information is either simple to infer or not important.

Intuitionistic sequents without the need to account for ∇ are structures of the form

Σ; B_{1}, …, B_{n} ⟶ B_{0}.

Here, Σ is a signature containing the list of all (explicitly typed) eigenvariables of the sequent. Depending on the domains of applications, there may be an additional fixed set of non-logical constants given. But since this set of non-logical constants does not vary in proof constructions, we choose not to put it explicitly in sequents. The judgment Σ ⊢ t : τ means that t is a simply typed λ-term of type τ in which there may appear the (fixed) non-logical constants as well as those eigenvariables in Σ. In the displayed sequent above, n ≥ 0 and B_{0}, B_{1}, …, B_{n} are formulas (i.e., terms of type o), all of whose free variables are in Σ. Informally, this sequent means that for every substitution θ that maps variables x : τ ∈ Σ to terms of type τ, if B_{i}θ holds for all i = 1, …, n, then B_{0}θ holds.

To account for the ∇ quantifier, we introduce into sequents a new element of context. Sequents will now have one global signature (containing the sequent’s eigenvariables) and several local signatures, used to scope local variables. More generally, sequents have the structure

Σ; σ_{1} ▷ B_{1}, …, σ_{n} ▷ B_{n} ⟶ σ_{0} ▷ B_{0}.

Here, σ_{0}, …, σ_{n} are signatures and the other items are as above. We shall consider sequents to be binding structures in the sense that the signatures, both the global and local ones, are abstractions over their respective scopes. The variables in Σ and σ_{i} will admit α-conversion by systematically changing the names of variables in signatures as well as those in their scope, following the usual convention of the λ-calculus. In general, however, we will assume that the local signatures σ_{i} contain names different than those in the global signature Σ. The expression σ ▷ B is called a generic judgment or simply judgment. Equality between judgments follows from the notion of equality of λ-terms, that is, two judgments x̄▷B and ȳ▷C are equal if and only if λx̄.B =_{βη} λȳ.C. Since equality between terms, or between judgments, in our logic is always modulo βη, we shall often omit the subscripts βη when writing the equality symbol. We use script letters A, B, etc. to denote judgments. We write simply B instead of σ ▷ B if the signature σ is empty.

The introduction rules for ∇ are given in Figure 1. The variable y must be new to the variables in σ and Σ (implicit in the definition of sequent). The expression (σ, y : τ) denotes the signature containing the type declaration y : τ appended to the end of the list σ. Notice that since the left and right rules are essentially the same, this quantifier will be self dual: that is, ¬∇xBx is equivalent to ∇x¬Bx.

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

Σ; σ ▷ B, Γ ⟶ σ ▷ B init  {Σ; Δ ⟶ B  Σ; B, Γ ⟶ C \atop Σ; Δ, Γ ⟶ C} cut
{Σ; B, B, Γ ⟶ C \atop Σ; B, Γ ⟶ C} cL  {Σ; Γ ⟶ C \atop Σ; B, Γ ⟶ C} wL
Σ; σ ▷ ⊥, Γ ⟶ B ⊥L  Σ; Γ ⟶ σ ▷ ⊤ ⊤R
{Σ; σ ▷ B, Γ ⟶ D \atop Σ; σ ▷ B ∧ C, Γ ⟶ D} ∧L  {Σ; σ ▷ C, Γ ⟶ D \atop Σ; σ ▷ B ∧ C, Γ ⟶ D} ∧L
{Σ; Γ ⟶ σ ▷ B  Σ; Γ ⟶ σ ▷ C \atop Σ; Γ ⟶ σ ▷ B ∧ C} ∧R  {Σ; σ ▷ B, Γ ⟶ D  Σ; σ ▷ C, Γ ⟶ D \atop Σ; σ ▷ B ∨ C, Γ ⟶ D} ∨L
{Σ; Γ ⟶ σ ▷ B \atop Σ; Γ ⟶ σ ▷ B ∨ C} ∨R  {Σ; Γ ⟶ σ ▷ C \atop Σ; Γ ⟶ σ ▷ B ∨ C} ∨R
{Σ; Γ ⟶ σ ▷ B  Σ; σ ▷ C, Γ ⟶ D \atop Σ; σ ▷ B ⊃ C, Γ ⟶ D} ⊃ L  {Σ; σ ▷ B, Γ ⟶ σ ▷ C \atop Σ; Γ ⟶ σ ▷ B ⊃ C} ⊃ R
{Σ, σ ⊢ t : τ  Σ; σ ▷ B[t/x], Γ ⟶ C \atop Σ; σ ▷ ∀_{τ} x.B, Γ ⟶ C} ∀L  {Σ, h; Γ ⟶ σ ▷ B[(h σ)/x] \atop Σ; Γ ⟶ σ ▷ ∀x.B} ∀R
{Σ, h; σ ▷ B[(h σ)/x], Γ ⟶ C \atop Σ; σ ▷ ∃x.B, Γ ⟶ C} ∃L  {Σ, σ ⊢ t : τ  Σ; Γ ⟶ σ ▷ B[t/x] \atop Σ; Γ ⟶ σ ▷ ∃_{τ} x.B} ∃R

Fig. 2. The intuitionistic rules of F Oλ.

3. AN INTUITIONISTIC LOGIC WITH ∇

We now consider Gentzen’s LJ calculus [Gentzen 1969] with the addition of global and local signatures and ∇. Besides this new quantifier, the other logical connectives are ⊥, ⊤, ∧, ∨, ⊃, ∀_{τ}, and ∃_{τ} (again, the type τ does not contain o): their inference rules are given in Figure 2. Notice that no inference rule in Figure 2 requires non-empty local signatures: as a result, if all the local signatures in sequents in a derivation built from those rules are set to empty, the resulting derivation is a standard derivation in intuitionistic logic.

The interaction between the global and local signatures and the universal and existential quantifiers needs some explanations. In the rule for ∀L (and, dually, for ∃R), the quantifier appears in the scope of the global signature Σ and the local signature σ. This quantifier can be instantiated (reading the rule bottomup) with a term built from variables in both of these signatures. Similarly, in the rule for ∀R (and, dually, for ∃L), the quantifier appears in the scope of the global signature Σ and the local signature σ. This quantifier can be instantiated (reading the rule bottom-up) with an eigenvariable whose intended range is over all terms built from variables in Σ and σ. Since, however, the eigenvariable h is stored in the global scope, its dependency on σ would be forgotten unless we employ some particular encoding technique. For this purpose, we use raising [Miller 1992]: to denote a variable of type τ_{0} that can range over Σ and over the variables in σ = (x_{1} : τ_{1}, …, x_{n} : τ_{n}) (n ≥ 0), we can use instead the term (hx_{1} … x_{n}) where the variable h ranges over Σ only (the dependency on σ can be forgotten). Of course, the type of h will be τ_{1} → ⋯ → τ_{n} → τ_{0} instead of simply τ_{0}. In the

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

\begin{matrix}∇x¬Bx ≡ ¬∇xBx & ∇x(Bx ∧ Cx) ≡ ∇xBx ∧ ∇xCx \\ ∇x(Bx ∨ Cx) ≡ ∇xBx ∨ ∇xCx & ∇x(Bx ⊃ Cx) ≡ ∇xBx ⊃ ∇xCx \\ ∇x∀yBxy ≡ ∀h∇xBx(hx) & ∇x∃yBxy ≡ ∃h∇xBx(hx) \\ ∇x∀yBxy ⊃ ∀y∇xBxy & ∇x.⊤ ≡ ⊤, ∇x.⊥ ≡ ⊥ \end{matrix}

Fig. 3. Some theorems of F Oλ^{∇}.

\begin{matrix}∇x∇yBxy ⊃ ∇zBzz & (1) & ∇xBx ⊃ ∃xBx & (2) \\ ∀y∇xBxy ⊃ ∇x∀yBxy & (3) & ∀xBx ⊃ ∇xBx & (4) \\ ∃xBx ⊃ ∇xBx & (5) & B ⊃ ∇xB & (6) \\ ∇xBx ⊃ ∀xBx & (7) & ∇x∇yBxy ⊃ ∇y∇xBxy & (8) \end{matrix}

Fig. 4. Some non-theorems of F Oλ^{∇}. Here, B denotes some uninterpreted formula or abstraction over a formula. In (6), x is not free in B.

inference rules of Figure 2, we write (hσ) to denote (hx_{1} … x_{n}).

For the sake of consistency with a naming convention from the papers [McDowell 1997; McDowell and Miller 2000], we shall refer to the inference system defined with just the rules in Figure 2 as F Oλ (mnemonic for a “first-order logic for λexpressions”). The proof system resulting from the addition of the rules for ∇ (Figure 1) is called F Oλ^{∇}.

Figure 3 lists some theorems of F Oλ^{∇} involving ∇. In general, we use ¬C to abbreviate C ⊃ ⊥ and B ≡ C to abbreviate (B ⊃ C) ∧ (C ⊃ B). As a result of these equivalences, ∇ can alway be given atomic scope within formulas (with the simple cost of raising the quantified variables in its scope). Figure 4 lists some nontheorems of F Oλ^{∇} involving ∇. In the next section we will extend the core logic with a proof theoretic notion of definition. In this extension, we will be able to prove certain instances of the last three of these non-theorems (see the end of Section 7.2). The first five will not be provable in the extension, and it seems important that they are not provable. For example, in the non-theorem (4), ∀_{τ} B ⊃ ∇_{τ} B, if τ is empty then the statement would not be expected to hold and hence we do not accept it in the core logic.

4. INTRODUCTION RULES FOR DEFINITIONS

Introduction rules are, generally, restricted to logical connectives and quantifiers. The recent development of a proof theoretic notion of definitions [Hallnäs and Schroeder-Heister 1991; Schroeder-Heister 1992; Girard 1992; McDowell and Miller 2000] provides left and right introduction rules also for non-logical predicate symbols, provided that they are “defined” appropriately. Given certain restrictions on the syntax of definitions, a logic with such definition introduction rules can enjoy cut-elimination. In this section, we take the treatment of definitions from [McDowell 1997; McDowell and Miller 2000] and extend it to handle the extension of local signatures.

Definition 4.1. A definitional clause is written ∀x̄.p t̄=^{△} B, where p is a predicate constant, every free variable of the formula B is also free in at least one term in the list t̄ of terms, and all variables free in p t̄ are contained in the list x̄ of variables. The atomic formula p t̄ is called the head of the clause, and the formula B is called

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

the body. The symbol =^{△} is used simply to indicate a definitional clause: it is not a logical connective. A definition is a (perhaps infinite) set of definitional clauses. The same predicate may occur in the head of multiple clauses of a definition: it is best to think of a definition as a mutually recursive definition of the predicates in the heads of the clauses.

In this paper we shall assume that all predicate constants are defined since this addresses the applications we wish to illustrate. See [Schroeder-Heister 1994] for other approaches to treating undefined predicates. We shall also use the convention that when displaying definition clauses, tokens with an initial uppercase letter will be assumed to be universally quantified with outermost scope.

Although predicates are defined via mutual recursion, circularities through implications (negations) must be avoided. To do this, we stratify definitions by first associating to each predicate p a natural number lvl(p), the level of p. The notion of level is generalized to formulas as follows.

Definition 4.2. Given a formula B, its level lvl(B) is defined as follows:

(1) lvl(p t̄) = lvl(p)

(2) lvl(⊥) = lvl(⊤) = 0

(3) lvl(B ∧ C) = lvl(B ∨ C) = max(lvl(B), lvl(C))

(4) lvl(B ⊃ C) = max(lvl(B) + 1, lvl(C))

(5) lvl(∀x.B) = lvl(∇x.B) = lvl(∃x.B) = lvl(B).

For every definitional clause ∀x̄.p t̄=^{△} B, we shall require that lvl(B) ≤ lvl(p). This requirement allows us to prove cut-elimination for intuitionistic logic extended with definitions (see [McDowell and Miller 2000] and Section 7).

Definition rules involve the use of substitutions. We recall some basic definitions related to substitutions. A substitution θ is a mapping (with application written in postfix notation) from variables to terms, such that the set {x | xθ ≠ x} is finite. Substitutions must preserve types, that is, given a substitution θ and a variable x : τ, the result of applying θ to x, xθ, is of type τ. Although substitutions are extended to mappings from terms to terms, generic judgments to generic judgments, etc., when we refer to the domain and the range of a substitution, we refer to those sets defined on this most basic function. A substitution is extended to a function from terms to terms in the usual fashion. Composition of substitutions is defined as x(θ ∘ σ) = (xθ)σ, for all variable x. Two substitutions θ and σ are considered equal if for all variables x, xσ =_{βη} xθ (equal modulo βη-conversion). The empty substitution is written as ϵ. The application of a substitution θ to a generic judgment x_{1}, …, x_{n} ▷ B, written as (x_{1}, …, x_{n} ▷ B)θ, is y_{1}, …, y_{n} ▷ B′, if (λx_{1} … λx_{n}.B)θ is equal (modulo λ-conversion) to λy_{1} … λy_{n}.B′. If Γ is a multiset of generic judgments, then Γθ is the multiset {Jθ | J ∈ Γ}. Finally, if Σ is a signature then Σθ is the signature that results from removing from Σ the variables in the domain of θ and adding the variables that are free in the range of θ.

The introduction of a defined atom may take place in the context of a local signature. To account for this, we again use the technique of raising to code this dependency by introducing the notion of “raised” definition clause.

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

{Σ; Γ ⟶ Bθ \atop Σ; Γ ⟶ A} defR, where dfn(ϵ, A, θ, B)  {\{Σρ; Bθ, Γρ ⟶ Cρ | dfn(ρ, A, θ, B)\} \atop Σ; A, Γ ⟶ C} defL

Fig. 5. The definition introduction rules

Definition 4.3. Let ∀_{τ_{1}}x_{1} … ∀_{τ_{n}}x_{n}.H =^{△} B be a definition clause and consider a list of variables y_{1}, …, y_{m} of types α_{1}, …, α_{m}, respectively. A raised definition clause with respect to the signature {y_{1} : α_{1}, …, y_{m} : α_{m}} is defined as

∀h_{1} … ∀h_{n}.ȳ ▷ Hθ =^{△} ȳ ▷ Bθ

where θ is the substitution [(h_{1} ȳ)/x_{1}, …, (h_{n} ȳ)/x_{n}] and h_{i}, for every i ∈ {1, …, n}, is of type α_{1} → … → α_{m} → τ_{i}.

Raised definition clauses can be seen as definitions for atomic judgments (i.e., judgments which contain no occurrences of logical constants) and a definition clause is just a concise way of representing a family of definition clauses for atomic judgments. Raising a definition in this manner is similar to ∀-lifting [Paulson 1989; Miller 1992].

The following relation is useful for presenting the introduction rules for defined atomic judgments.

Definition 4.4. The four-place relation dfn(ρ, A, θ, B) holds for the atomic judgment A, the judgment B, and the substitutions ρ and θ if there is a raised clause ∀h_{1} … ∀h_{n}.H =^{△} B in the given definition such that Aρ = Hθ.

Obviously, for the relation dfn(ρ, A, θ, B) to hold, given a raised clause H =^{△} B, the judgments A, B and H must share the same local signature (up to α-conversion).

The right and left rules for atoms are given in Figure 5. Specifying a set of sequents as the premise should be understood to mean that each sequent in the set is a premise of the rule. Notice that in the defL rule, the free variables of the conclusion can be instantiated in the premises. In particular, a variable in Σ could possibly be replaced by several new variables.

These rules for definitions add considerable expressive power to intuitionistic logic. For example, defR is essentially the backchaining rule on closed atoms found in logic programming, while defL is essentially a case analysis on how an atom can be proved and can be used to establish finite failure. Together, these two rules can be used to encode simulation and bisimulation in certain abstract transition systems [McDowell et al. 2003]. Other uses involve reasoning about computational systems [McDowell and Miller 2002].

The rule defL may have an infinite number of premises since the unification of simply typed λ-terms may return infinitely many unifiers and since the domains of the substitutions ρ and θ may include variables which are not free in A and B. The latter may introduce “noise” into proof search since they can insert eigenvariables of any types in the premises. The presence of this noise does not, however, affect provability. To see why, consider the definition eq X X =^{△} ⊤ where eq : i → i → o for some base type i, and the sequent {z : i}; eq z z ⟶ ∃_{α}y.⊤ where α is some base type different from i. Assuming no other constants, this sequent should not be provable since there is no closed term of type α. One can, however, introduce

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

(during proof search) new eigenvariables of type α via defL. By applying defL, we can substitute any term into z and we are allowed to introduce new variables. In particular, among these premises are the premises {f : α → i, x : α}; ⟶ ∃_{α}y.⊤, obtained via [(f x)/z], and {z : i}; ⟶ ∃_{α}.⊤, via the empty substitution. The first sequent is provable, using ∃R with x, but the second sequent is not and hence the original sequent is not provable.

It is possible to have a finite number of premises and reduce the noises in defL, provided that we restrict the definitions to have only a finite number of clauses and to restrict the use of defL to those judgments A such that for every raised definition clause there is a finite, complete set of unifiers (CSU) [Huet 1975] of A and the head of the clause. Then the following inference rules can be shown interadmissible with defL:

{Σθ; Bθ, Γθ ⟶ Cθ | θ ∈ CSU(A, H) for some clause ∀h̄[H =^{△} B]}

Σ; A, Γ ⟶ C defL_{csu}.

This rule is originally due to [Eriksson 1991] and is also used in [McDowell and Miller 2000]. The proof of its interadmissibility with defL follows the same outline as the one in [McDowell and Miller 2000]. The meta-theoretic analysis of definitions (see Section 7) is more naturally addressed using defL while the presentation of examples (see Sections 5 and 6) is more natural using defL_{csu}.

The proof system that arises from adding together the inference rules in Figures 2 and 5 is called F Oλ^{Δ}. If we add to F Oλ^{Δ} the rules in Figure 1, the resulting proof system is called F Oλ^{Δ∇} (pronounced “fold nabla”). It is this logic that will involve us for the remainder of this paper.

Definition clauses that are similar to Horn clauses are important in our investigation. In particular, an hc-goal (named for Horn clauses) is a formula built from the base set of logic connectives ⊤, ∧, ∨, and ∃. An hc^{∀}-goal is a formula built from these connectives and ∀; an hc^{∇}-goal is a formula built from the base set and ∇; and an hc^{∀∇}-goal is a formula admitting the base set as well as both ∀ and ∇. A definition is an hc-definition (resp., hc^{∀}-definition, hc^{∇}-definition, and hc^{∀∇}- definition) if the body of all of its clauses are hc-goals (resp., hc^{∀}-goals, hc^{∇}-goals, and hc^{∀∇}-goals). Notice that all of these kinds of definitions are trivially stratifiable. Numerous interesting computer science motivated specifications are examples of hc^{∀}-definitions: we consider in more detail two such examples in Sections 5 and 6.

5. EXAMPLE: THE π-CALCULUS

Operational semantics of specification languages or programming languages are often given using inference rules, following the small-step approach (a.k.a., structured operational semantic) or big-step approach (a.k.a. natural semantics). Frequently, the proper specification of such semantics includes abstractions over names that are used for such things as nonces in security protocols [Cervesato et al. 1999], locations for reference cells [Chirimar 1995; Miller 1996], or new communication channels [Milner et al. 1992]. One declarative way to capture these features in the inference rule setting is to employ scoped (eigen)variables. Given the logic F Oλ^{∇}, we now have the ability to scope variables within sequents either globally via ∀ or locally via ∇. We illustrate these choices with a specification of the π-calculus.

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

\overline{τ.P ⟶^{τ} P} τ  \frac{P ⟶^{A} Q}{[X = X]P ⟶^{A} Q} match  \frac{P −⇀^{H} M}{[X = X]P −⇀^{H} M} match

\frac{P ⟶^{A} R}{P + Q ⟶^{A} R} sum \frac{Q ⟶^{A} R}{P + Q ⟶^{A} R} sum  \frac{P −⇀^{H} M}{P + Q −⇀^{H} M} sum \frac{Q −⇀^{H} N}{P + Q −⇀^{H} N} sum

\frac{P ⟶^{A} P′}{P | Q ⟶^{A} P′ | Q} par  \frac{Q ⟶^{A} Q′}{P | Q ⟶^{A} P | Q′} par

\frac{P −⇀^{H} M}{P | Q −⇀^{H} λn(Mn | Q)} par  \frac{Q −⇀^{H} N}{P | Q −⇀^{H} λn(P | Nn)} par

\frac{∇n(Mn ⟶^{A} M′n)}{νn.Mn ⟶^{A} νn.M′n} res  \frac{∇n(Mn −⇀^{H} Sn)}{νn.Mn −⇀^{H} λm νn.(Snm)} res  \frac{∇y(My ⟶^{↑Xy} M′y)}{νy.My −⇀^{↑X} M′} open

\overline{out X Y P ⟶^{↑XY} P} out  \frac{P −⇀^{↓X} M  Q −⇀^{↑X} N}{P | Q ⟶^{τ} νn.(Mn | Nn)} close  \frac{P −⇀^{↑X} M  Q −⇀^{↓X} N}{P | Q ⟶^{τ} νn.(Mn | Nn)} close

\overline{in X M −⇀^{↓X} M} in  \frac{P −⇀^{↓X} M  Q ⟶^{↑XY} Q′}{P | Q ⟶^{τ} (MY) | Q′} com  \frac{P ⟶^{↑XY} P′  Q −⇀^{↓X} N}{P | Q ⟶^{τ} P′ | (NY)} com

Fig. 6. The rules for the (late) π-calculus.

Consider encoding π-calculus [Milner et al. 1992] using λ-tree syntax following [Miller and Palamidessi 1999; Miller and Tiu 2002]. Since we are focused here on abstractions in syntax, we shall deal with only finite π-calculus expression; that is, expressions without ! or defined constants. Extending this work to infinite process expressions should be possible by adding induction (as in [McDowell et al. 2003]) or co-induction (as in [Momigliano and Tiu 2003; Tiu 2004b]) to our proof system. We shall require three primitive syntactic categories: n for channels, p for processes, and a for actions. The output prefix is the constructor out of type n → n → p → p and the input prefix is the constructor in of type n → (n → p) → p: the π-calculus expressions x̄y.P and x(y).P are represented as (out x y P) and (in x λy.P), respectively. We use | and +, both of type p → p → p and written as infix, to denote parallel composition and summation, and ν of type (n → p) → p to denote restriction. The π-calculus expression (x)P will be encoded as νλn.P, which itself is abbreviated as simply νx.P. The match operator, [· = ·]· is of type n → n → p → p. When τ is written as a prefix, it has type p → p. When τ is written as an action, it has type a. The symbols ↓ and ↑, both of type n → n → a, denote the input and output actions, respectively, on a named channel with a named value: e.g., ↓ xy denotes the action of inputing y on channel x.

We use two predicates to encode the one-step transition semantics for the πcalculus. The predicate · ⟶^{·} · of type p → a → p → o encodes transitions

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

(res) νn.Mn ⟶^{A} νn.M′n =^{△} ∇n(Mn ⟶^{A} M′n)
(res)  νy.My −⇀^{↑X} M′ =^{△} ∇y(My ⟶^{↑Xy} M′y)
(in)  in X M −⇀^{↓X} M =^{△} ⊤
(com) P | Q ⟶^{τ} P′ | (N Y) =^{△} ∃x.P ⟶^{↑xY} P′ ∧ Q −⇀^{↓x} N

Fig. 7. Corresponding definition clauses

involving free values and the predicate · −⇀^{·} · of type p → (n → a) → (n → p) → o encodes transitions involving bound values. Figure 6 (taken from [Miller and Tiu 2002]) contains the inference rules specifying the late version of the transitions for the π-calculus [Milner et al. 1992]. In these rules, capital letters (possibly primed) are used to denote schema variables for inference rules. We adopt the following typing convention for these scheme variables: X, Y : n, A : a, H : n → a, P, Q, R, P′, Q′ : p, M, N, M′, N′ : n → p, and S : n → n → p. These inference rules can trivially be written as definition clauses: a few such clauses are presented in Figure 7. Here, schema variables are universally quantified (implicitly) at the top-level of such clauses. Notice that the complicated side conditions in the original specification of π-calculus are no longer present, as they are now treated directly and declaratively by the meta-logic. For example, the side condition that x ≠ y in the open rule is implicit, since x is outside the scope of y and therefore cannot be instantiated with y.

To illustrate the expressiveness that the ∇ quantifier adds to logic, consider the following presentations of the transition system for the π-calculus. Let L be the complete definition for the one step transitions for the π-calculus. Clearly, L is an hc^{∇}-definition. Let L′ be the result of replacing all occurrences of ∇ in L with ∀. Furthermore, let L′′ be the result of replacing all occurrences of the symbol =^{△} in the definition clauses of L′ by reverse implication: thus, L′′ is a set of formulas and is not a definition. Finally, assume that we are only interested in computing the one-step transitions of the late π-calculus, that is, proving atomic formulas such as

P ⟶^{A} P′ or P −⇀^{H} P′ (let B range over such atomic formulas).

As we shall see in Section 7.2, when we restrict ourselves to Horn definitions (no implications and, hence, no negations in the body of definitions), then it is not possible to distinguish between uses of ∇ and ∀ in the body of clauses. In particular, Proposition 7.10 implies that ·; · ⟶ B is provable in F Oλ^{Δ∇} using definition L if and only if ·; · ⟶ B is provable in F Oλ^{Δ} using definition L′. Furthermore, a cutfree proof of ·; · ⟶ B in F Oλ^{Δ} using definition L′ does not contain occurrences of defL, and, as a result, the definition mechanism itself can be replaced: the sequent ·; · ⟶ B is provable in F Oλ^{Δ} with the definition L′ if and only if the sequent Σ; L′′ ⟶ B is provable in F Oλ. Thus, to compute with this specification of onestep transitions for the π-calculus, ∇ and definitions do not add expressive power and only a standard logic programming language, such as λProlog, is needed to automate proof search.

To illustrate what expressive power is contributed by both ∇ and definitions in a proof system, we will need to consider the problem of dealing with negative

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

information about transitions in the π-calculus. Such information is often needed when proving simulation of processes, e.g., in showing that a process can make certain transitions and no more. We shall see that the encoding of the restriction operator using the ∀-quantifier is not appropriate in this case while the use of ∇ is appropriate.

Consider the process νy.[x = y]x̄y.0. This process cannot make any transition since the bound variable y denotes a name different from x. We would therefore expect that the following is provable.

∀x∀z∀Q∀α.[(νy.[x = y](out x z 0) ⟶^{α} Q) ⊃ ⊥]

If we had used ∀ in encoding restriction (that is, in the premises of inference rules res and open in Figure 6), attempting to prove the above formula would have reduced to attempting to prove the sequent

{x, z, Q, α}; ∀y.([x = y](out x z 0) ⟶^{α} Q) ⟶ ⊥.

The only applicable rule (given the cut-elimination result in Corollary 7.6) is ∀L, followed by defL_{csu}. For the sequent to be provable, y would have to be instantiated with some term t such that t is distinct from all possible instantiation of x, so that the defL_{csu} rule will produce an empty premise. More precisely, suppose we instantiate y with some constant a different from x, then we are left with proving the sequent

{x, z, Q, α}; ([x = a](out x z 0) ⟶^{α} Q) ⟶ ⊥.

However, we see that no matter with which closed term a we choose to instantiate y, applying defL_{csu} to this sequent will result in a premise in which x is identified with a, that is,

{z, α, Q}; ((out a z 0) ⟶^{α} Q) ⟶ ⊥

via the unifier {a/x}. Applying another defL_{csu} to this sequent leaves us with the sequent .; . ⟶ ⊥, which is clearly not provable. Hence, the scoping of variables at the object-level is lost at the meta-level. Fortunately, this scoping constraint is captured precisely by ∇, as it is shown in the derivation in Figure 8. The success of the topmost instance of defL_{csu} depends on the failure of the unification problem λw.x = λw.w. Notice that the scoping of object variables is maintained at the meta-level by the separation of (global) eigenvariables and (locally bound) generic variables. The “newness” of w is internalized as λ-abstraction and hence it is not subject to any instantiation.

A more complete picture of the differences between ∇ and ∀ is illustrated in the definition clause for simulation in Figure 9. Notice the when checking simulation for bounded inputs, the ∀ quantifier is used while for bounded outputs, the ∇ quantifier is used.

In the following illustration, we shall use the original syntax of the π-calculus for readability purpose: when we mix that original syntax with logic, we will assume that the reader encodes it directly into logic following the encoding mentioned above.

It is important to note that in encoding late (bi)simulation, the free names in the processes being checked for (bi)similarity should be interpreted in such a way

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

{x, z, Q, α}; w ▷ ([x = w](out x z 0) ⟶^{α} Q) ⟶ ⊥ defL_{csu}

{x, z, Q, α}; . ▷ ∇y.([x = y](out x z 0) ⟶^{α} Q) ⟶ ⊥ ∇L

{x, z, Q, α}; . ▷ (νy.[x = y](out x z 0) ⟶^{α} Q) ⟶ ⊥ defL^{csu}

{x, z, Q, α}; ⟶ . ▷ (νy.[x = y](out x z 0) ⟶^{α} Q) ⊃ ⊥ ⊃ R

Fig. 8. The proof of a negation.

sim P Q =^{△} ∀A∀P′ [(P ⟶^{A} P′) ⊃ ∃Q′.(Q ⟶^{A} Q′) ∧ sim P′ Q′] ∧ ∀X∀P′ [(P −⇀^{↓X} P′) ⊃ ∃Q′.(Q −⇀^{↓X} Q′) ∧ ∀w.sim (P′w) (Q′w)] ∧ ∀X∀P′ [(P −⇀^{↑X} P′) ⊃ ∃Q′.(Q −⇀^{↑X} Q′) ∧ ∇w.sim (P′w) (Q′w)]

Fig. 9. Definition of π-calculus simulation

that they are not subject to meta-level instantiation. One way of realizing this is to encode free names as some fixed non-logical constants of type n; another is to treat free names as ∇-quantified variables. These two approaches are equivalent, as far as the adequacy result for late bisimulation is concerned. However, the former is relatively simple to present, which is the reason we adopt this approach in the following discussion. The latter approach is more uniform, since newly generated free names and the existing free names are represented in the same way. This approach is also interesting in that it relates certain aspects of names to the way they are quantified, in particular, it is shown in [Tiu and Miller 2004] (where precise connections between this style specification and open and late bisimulations are given) that different ways of quantifying free names result in different bisimulation relations. Note that in encoding late (bi)simulation, free names in processes should not be interpreted as universally quantified variables, since otherwise we lose the adequacy of the encoding. For instance, x|ȳ is simulated by x.ȳ+ȳ.x, but x|x̄ is not simulated by x.x̄+x̄.x. However, if we interpret the free names x and y as universally quantified, then ∀x∀y.sim (x|ȳ) (x.ȳ + ȳ.x) implies ∀x.sim (x|x̄) (x.x̄ + x̄.x).

Let us consider the following four π-calculus expressions. (Here we are using the usual abbreviations: when only a name, say d, is used as a prefix, it denotes the prefix d(w), where w is vacuous in its scope; when the bar’ed name, say d̄, is used as a prefix, it denotes the prefix d̄a, where a is some fixed value; the expression c̄(y).P abbreviates (y)c̄y.P; and when a prefix is written without a continuation, the continuation 0 is assumed. Thus, for example, ȳ | d denotes ȳa.0 | d(w).0.)

\begin{matrix}P_{1} = c(y).(ȳ | d) & P_{2} = c(y).((ȳ.d) + (d.ȳ)) \\ P_{3} = c̄(y).(ȳ | d) & P_{4} = c̄(y).((ȳ.d) + (d.ȳ)) \end{matrix}

The process P_{2} is simulated by P_{1} but the converse is not true since after P_{1} performs an (↓ cd), it is possible for the resulting process to take a τ step. The sequence of actions (↓ cd) and τ is not possible with P_{2}. The processes P_{3} and P_{4} do, however, simulate each other (they are, in fact, bisimilar). The only difference between these pairs of processes is, of course, that the first is prefixed with a

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

bounded input prefix while the second is prefixed with a bounded output prefix. These different bounded prefixes are handled in the simulation definition in Figure 9 using, in one case, ∀ and the other case ∇.

For example, consider proving the sequent

·; · ⟶ sim (c(y).(ȳ | d)) (c(y).((ȳ.d) + (d.ȳ))),

which, as we discussed above, should not be provable. Here, the free names c and d are encoded as non-logical constants c and d of type n. We argue informally why the above sequent has no proof (for the formal statements and proofs of the adequacy of the more general encoding of bisimulation, see [Tiu 2004b]). The attempt to prove this sequent reduces (via defR, ∀R, and ⊃ R) to needing to prove the three sequents (1-3) in Figure 10. By Corollary 7.8 (see Section 7), if a sequent with an atom on the left has a proof, it has a proof with an instance of the defL_{csu} rule that introduces that atom. Thus, we can conclude that sequents (1) and (3) are trivially provable since the required unification problem in defL_{csu} fails for all clauses in the definition. The second sequent is the consequence of a non-trivial occurrence of the defL_{csu} rule, giving rise to the need to prove sequent (4) in Figure 10 (here, the variable X is instantiated to c and M is instantiated to λy.(ȳ | d)). Proving this requires making the appropriate substitution for N (obvious) and then proving the sequent

·; · ⟶ ∀w.sim (w̄ | d) ((w̄.d) + (d.w̄))

Similarly to our first step, proving this reduces to the three sequents (5), (6), and (7). Both sequents (6) and (7) have simple proofs (which we leave as an exercise to the reader). A proof of (5) using defL_{csu} has two premises: one with A instantiated to τ, w to d, and P to 0 | 0, and one with A instantiated to ↑ wa and P to 0 | d (w is not instantiated). The first of these premise sequents is

·; · ⟶ ∃Q[((d̄.d) + (d.d̄)) ⟶^{τ} Q ∧ sim (0 | 0) Q]

This is not provable since there is no τ transition from ((d̄.d) + (d.d̄)). As a result, since this sequent is not provable we may conclude that the original sequent is not provable. The reason for this failure is also clear from this attempt of a proof construction: although both P_{1} and P_{2} make an initial input step, the first of the resulting pair of processes can make a τ step but the second cannot.

Turning to the case of expressions P_{3} and P_{4}, consider proving the sequent

·; · ⟶ sim (c̄(y).(ȳ | d)) (c̄(y).((ȳ.d) + (d.ȳ))),

which, as we discussed above, should be provable. A proof attempt of this sequent proceeds similar to the previous example, yielding the sequent (4′) in Figure 10. Proving this reduces to the three sequents (5′), (6′), and (7′): notice that w is not given global scope in the sequents but local scope and that the eigenvariables (H, M, Z, and S) are raised with respect to their counterparts in (5), (6), and (7). Sequents (6′) and (7′) are proved as in (6) and (7). In this case, however, a proof of (5′) using defL_{csu} has exactly one premise, where H is instantiated to λw. ↑ wa and M to λw.0 | d. The resulting sequent is

·; · ⟶ w ▷ ∃Q[((w̄.d) + (d.w̄)) ⟶^{↑wa} Q ∧ sim (0 | d) Q]

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

A, P; (c(y).(ȳ | d)) ⟶^{A} P ⟶ ∃Q[(c(y).(ȳ.d + d.ȳ)) ⟶^{A} Q ∧ sim P Q] (1)
X, M; (c(y).(ȳ | d)) −⇀^{↓X} M ⟶ ∃N[(c(y).(ȳ.d + d.ȳ)) −⇀^{↓X} N ∧ ∀w.sim (Mw) (Nw)] (2)
X, M; (c(y).(ȳ | d)) −⇀^{↑X} M ⟶ ∃N[(c(y).(ȳ.d + d.ȳ)) −⇀^{↑X} N ∧ ∇x.sim (Mx) (Nx)] (3)
·; · ⟶ ∃N[(c(y).(ȳ.d + d.ȳ)) −⇀^{↓c} N ∧ ∀w.sim (w̄ | d) (Nw)] (4)
w, A, P; (w̄ | d) ⟶^{A} P ⟶ ∃Q[(w̄.d + d.w̄) ⟶^{A} Q ∧ sim P Q] (5)
w, X, M; (w̄ | d) −⇀^{↓X} M ⟶ ∃N[(w̄.d + d.w̄) −⇀^{↓X} N ∧ ∀u.sim (Mu) (Nu)] (6)
w, X, M; (w̄ | d) −⇀^{↑X} M ⟶ ∃N[(w̄.d + d.w̄) −⇀^{↑X} N ∧ ∇u.sim (Mu) (Nu)] (7)
·; · ⟶ ∃N[(c̄(y).(ȳ.d + d.ȳ)) −⇀^{↑c} N ∧ ∇w.sim (w̄ | d) (Nw)] (4′)
H, M; w ▷ (w̄ | d) ⟶^{(Hw)} (Mw) ⟶ w ▷ ∃Q[(w̄.d + d.w̄) ⟶^{(Hw)} Q ∧ sim (Mw) Q] (5′)
Z, S; w ▷ (w̄ | d) −⇀^{↓(Zw)} (Sw) ⟶ w ▷ ∃N[(w̄.d + d.w̄) −⇀^{↓(Zw)} N ∧ ∀u.sim (Swu) (Nu)] (6′)
Z, S; w ▷ (w̄ | d) −⇀^{↑(Zw)} (Sw) ⟶ w ▷ ∃N[(w̄.d + d.w̄) −⇀^{↑(Zw)} N ∧ ∇u.sim (Swu) (Nu)] (7′)

Fig. 10. Some sequents

This sequent, like all the remaining ones in this proof attempt, now has a simple proof.

Notice that although we have now encountered higher-order unification problems and higher-order substitutions, the unification problems generated from this particular example fall within L_{λ}-unification or higher-order pattern unification [Miller 1991; Nipkow 1993]. This subset of the unification of simply typed λ-terms has complexity similar to that of first-order unification, in that it is decidable and has most general unifiers when unifiers exist.

Certain substitution theorems are easy to prove from our specification of the π-

calculus. For example, if the atomic formula νn.Mn ⟶^{A} νn.Nn is provable from the definition in Figure 6, then it must be the case that (since there is only one way to prove this formula), we must have a proof of

∇n.Mn ⟶^{A} Nn.

Proposition 7.10 tells us that when we have a hc^{∀∇}-definition and a hc^{∀∇}-goal, interchanging ∇ and ∀ in the goal and the body of definition clauses does not affect

provability. Thus, we conclude that we have a proof of ∀n.Mn ⟶^{A} Nn, and thus,

for any particular t of type n, we know that Mt ⟶^{A} Nt.

The encoding of π-calculus above can also be extended to include the mismatch operator by using negation.

\begin{matrix}x = y ⊃ ⊥ & P ⟶^{A} Q \\ [x ≠ y]P ⟶^{A} Q \end{matrix} mismatch

Operationally, mismatch is modeled as failure of unification at the logic level. Notice that the resulting definition is not Horn anymore since we have an implication in the body of the clause representing the above inference rule. As a consequence, Proposition 7.10 is not applicable to this definition and such substitution results as

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

pv ˆ⊤ =^{△} ⊤
pv (G & G′) =^{△} pv G ∧ pv G′
pv (ˆ∀ G) =^{△} ∇x.pv (Gx)
pv (ˆ∃ G) =^{△} ∃x.pv (Gx)  X = X =^{△} ⊤
pv A =^{△} ∃D.atom A ∧ prog D ∧ bc D A  atom (q X Y Z) =^{△} ⊤
bc A A =^{△} atom A  prog (ˆ∀ X ˆ∀ Y q X X Y) =^{△} ⊤
bc (G ⇒ D) A =^{△} bc D A ∧ pv G  prog (ˆ∀ X ˆ∀ Y q X Y X) =^{△} ⊤
bc (ˆ∀ D) A =^{△} ∃t. bc D t A  prog (ˆ∀ X ˆ∀ Y q Y X X) =^{△} ⊤

Fig. 11. Interpreter for an object-level logic and additional clauses.

mentioned above are either no longer true or require different proofs.

6. EXAMPLE: AN OBJECT-LOGIC ENCODING

Consider the problem of proving the formula

∀u∀v[q ⟨u, t_{1}⟩ ⟨v, t_{2}⟩ ⟨v, t_{3}⟩],

where q is a three place predicate, ⟨·, ·⟩ is used to form pairs, t_{1} and t_{2} are some first-order terms, and the only assumptions for the predicate q are the (universal closure of the) three atomic formulas: q X X Y, q X Y X and q Y X X. Clearly, this query succeeds only if terms t_{2} and t_{3} are equal [Miller and Tiu 2002]. One natural way to formalizing this reasoning involves first encoding provability of an object-level first-order logic in F Oλ^{Δ∇} and then to reason directly on this encoding. Let obj be the type of object-level logic, let ˆ⊤ : obj be object-level true, let & and ⇒ be object-level conjunction and implication (both at type obj → obj → obj), and let ˆ∀ and ˆ∃ be object-level quantifiers at type (i → obj) → obj (for some fixed type i ranging over first-order object-level terms). To encode provability, we use two main predicates pv of type obj → o to indicate first-order provability and bc of type obj → obj → o to specify “backchaining”. The definition clauses on the left side of Figure 11 encodes provability for logic programming in a subset of first-order hc^{∀} and is parametrized by the predicates atom (describing object-level atomic formulas) and prog (describing object-level logic programs clauses). The definition clauses on the right side of the figure contains encodes the object-level logic program we are considering here.

Notice that while the object-level logic here is hc^{∀} (since our motivating example is concerned with the provability of a universally quantified formula), the meta-level definition is hc^{∇}.

Given the definition in Figure 11, the following query encodes our intended theorem about object-level provability.

∀x, y, z[pv (ˆ∀ u ˆ∀ v[q ⟨u, x⟩ ⟨v, y⟩ ⟨v, z⟩]) ⊃ y = z]

Attempting a proof of this formula leads to the following sequent (after applying some right rules and a pair of defL_{csu} and ∇L rules):

X, Y, Z; (s, r) ▷ pv (q ⟨s, X⟩ ⟨r, Y ⟩ ⟨r, Z⟩) ⟶ ▷Y = Z.

A series of defL_{csu} rules will now need to be applied in order to work through

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

the encoding of the object-level interpreter. In the end, three separate unification problems will be attempted, one for each of the three ways to prove the predicate q. In particular, the defL_{csu} rule will attempt to unify λsλr.(q ⟨s, X⟩ ⟨r, Y ⟩ ⟨r, Z⟩) with each of the following three terms:

λsλr.(q (X′ s r) (X′ s r) (Y′ s r))
λsλr.(q (X′ s r) (Y′ s r) (X′ s r))
λsλr.(q (Y′ s r) (X′ s r) (X′ s r))

The first two unification problems fail and hence the corresponding occurrences of defL_{csu} succeed. The third of these unification problems is solvable, however, with X′ instantiated to λsλr.⟨r, Z⟩, Y′ instantiated to λsλr.⟨s, Z⟩, Y instantiated to Z (or vice versa), and X uninstantiated. As a result, this third premise is the sequent ·; · ⟶ Y = Y, which is provable using defR.

The more common approach to encoding object-logic provability into a meta-logic uses the meta-level universal quantifier instead of the ∇ for the clause encoding the provability of object-level universal quantification: that is, the clause

pv (ˆ∀ x.G x) =^{△} ∀x[pv (G x)].

is used instead. In this case, attempting a proof of this formula reduces to an attempt to prove the sequent

X, Y, Z; ▷pv (q ⟨s_{1}, X⟩ ⟨s_{2}, Y ⟩ ⟨r, Z⟩) ⟶ ▷Y = Z,

and were s_{1} and s_{2} are two terms. To complete the proof, these two terms must be chosen to be different. While this sequent can be proved, doing so requires the assumption that there are two such distinct terms (the domain is non-empty and not a singleton). Our encoding using ∇ allows the (meta-level) proof to be completed in a more natural and “internal” way without this “external” assumption.

The encoding of ˆ∀ using ∇ reflects the intensional use of object-logic eigenvariables in object-logic proofs for universally quantified goals; that is, (object-logic) eigenvariables are not instantiated in the proofs. The encoding using ∇, however, does come with a price: the extensional aspect of ˆ∀ — that is, if ˆ∀ G is provable then G t is provable for every closed term t — cannot be directly proved in F Oλ^{Δ∇}. That is, the formula ∀G. pv (ˆ∀ G) ⊃ ∀t. pv (G t) is not a theorem in F Oλ^{Δ∇}, although it is valid as a meta-level observation about the encoding of the object-logic provability. Recall that the definition for the object-logic in Figure 11 is hc^{∇}, hence by Proposition 7.10, if we are only concerned with proving positive goals (no implication), ∇ and ∀ can be interchanged. As a consequence, if pv (ˆ∀ G) is provable in F Oλ^{Δ∇}, then ∇x. pv (G x) is provable, and by interchanging ∇ with ∀, we have ∀x. pv (G x) is provable, and hence pv (G t) is also provable.

7. META THEORY

We now present some meta-theoretic results concerning the logic F Oλ^{Δ∇}. The main such result is, of course, that it satisfied cut-elimination.

7.1 Cut Elimination

The proof of cut-elimination for F Oλ^{ΔIN} that we present here is similar to the one given by Gentzen [Gentzen 1969] in that the main induction involves the heights of

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

proofs and an additional measure involving the level of cut formulas. The stratification of definitions makes sure that the level of cut formulas does not increase when permuting up cut over definition rules, while other measures decrease. Central to the proof is the following substitution lemma about F Oλ^{Δ∇} proofs: if Σ; Γ ⟶ C has a proof and θ be a substitution, then there is a derivation of Σθ; Γθ ⟶ Cθ such that certain measures are not increased. The precise statement will follow.

We define several measures on derivation that are needed to show termination of cut reduction.

Definition 7.1. Given a derivation Π with premise derivations {Π_{i}}_{i}, the height of the derivation Π, denoted by ht(Π), is lub({ht(Π_{i})}_{i}) + 1, where lub(S) is the least upper bound of the set S. The measure def(Π) which indicates the depth of applications of defL rule is defined as follows.

def(Π) = \{ \begin{matrix}lub(\{def(Π_{i})\}_{i}) + 1, & if Π ends with a defL rule \\ lub(\{def(Π_{i})\}_{i}), & otherwise. \end{matrix}

Similary, the depth of cL rules is defined as

contr(Π) = \{ \begin{matrix}lub(\{contr(Π_{i})\}_{i}) + 1, & if Π ends with a cL rule \\ lub(\{contr(Π_{i})\}_{i}), & otherwise. \end{matrix}

Note that given the possible infinite branching of defL rule, the measures defined above can, in general, be ordinals. Therefore in proofs involving induction on those measures, transfinite induction is needed. In the following inductive proofs, we often do case analyses on the last rule of a derivation. In such situation, the inductive cases for both successor ordinals and limit ordinals are basically covered by the case analyses on the inference figures involved, and we shall not make explicit use of transfinite induction.

Lemma 7.2. Let Π be a derivation of Σ; Γ ⟶ C. Then there is a derivation Π′ of Σ, x; Γ ⟶ C, where x ∉ Σ, such that ht(Π′) ≤ ht(Π), def(Π′) ≤ def(Π) and contr(Π′) ≤ contr(Π).

Proof. By induction on ht(Π).

Lemma 7.3. Let Π be a derivation of Σ; Γ ⟶ C and θ be a substitution. Then there is a derivation Πθ of Σθ; Γθ ⟶ Cθ such that ht(Πθ) ≤ ht(Π), def(Πθ) ≤ def(Π) and contr(Πθ) ≤ contr(Π).

Proof. By induction on ht(Π). Most cases follow immediately from induction hypothesis. We show the interesting cases involving defL and defR. Suppose Π ends with the defL rule

\left\{{Π^{(ρ,B)} \atop Σρ; Bγ, Γ′ρ ⟶ Cρ}\right\}_{dfn(ρ,A,γ,B)}

Σ; A, Γ′ ⟶ C defL,

and suppose that dfn(ρ′, Aθ, γ′, B) holds for some ρ′ and γ′. We have (Aθ)ρ′ = Hγ′, given a raised definition clause ∀ȳ.[H =^{△} B], where ȳ are chosen to be distinct from the variables in Σ and the variables free in the range of θ. Then, obviously,

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

dfn(θ ∘ ρ′, A, γ′, B) holds as well. Therefore we construct Πθ as the derivation

\left\{{Π^{(θ∘ρ′,B)} \atop Σθρ′; Bγ′, Γ′θρ′ ⟶ Cθρ′}\right\}_{dfn(ρ′,Aθ,γ′,B)}

Σθ; Aθ, Γ′θ ⟶ Cθ defL.

Otherwise, suppose Π ends with the defR rule

{Π′ \atop Σ; Γ ⟶ Bρ} ; Σ; Γ ⟶ A defR,

where A and B are the judgments, and dfn(ϵ, A, ρ, B) holds for a given raised definition clause ∀ȳ.[H =^{△} B]. By Definition 4.4, this means A = Hρ. Obviously, Aθ = (Hρ)θ and therefore dfn(ϵ, Aθ, ρ ∘ θ, B) holds as well. We can then construct Πθ as the derivation

{Π′θ \atop Σθ; Γθ ⟶ Bρθ} ; Σθ; Γθ ⟶ Aθ defR,

where Π′θ is obtained from Π′ by inductive hypothesis.

Since each transformation step from Π to Πθ does not introduce extra applications of rules, ht(Πθ), def(Πθ) and contr(Πθ) are less than or equal to ht(Π), def(Π) and contr(Π), respectively. They can be smaller than the corresponding measures of Π because in the case of defL there could be fewer premises.

In proving cut-elimination, we use a more general form of cut rule, called the multicut rule,

\begin{aligned}Δ_{1} ⟶ B_{1} & … & Δ_{n} ⟶ B_{n} & B_{1}, …, B_{n}, Γ ⟶ C \\ & Δ_{1}, …, Δ_{n}, Γ ⟶ C \end{aligned} mc  (n ≥ 0).

This generalization is due to Slaney [Slaney 1989], and it is used to simplify the presentation of the cut-elimination proof.

We associate a measure to a derivation ending with mc and show that the measure decreases as we permute up the mc rule. The general cut-elimination theorem is proved by successively removing the topmost cut instances. The measure involves a multiset as one of its component. We use ⊎ to denote multiset union.

Definition 7.4. Let Ξ be the following derivation ending with a multicut rule:

{Π_{1} \atop Σ; Δ_{1} ⟶ B_{1}} ⋯ {Π_{n} \atop Σ; Δ_{n} ⟶ B_{n}} {Π \atop Σ; B_{1}, …, B_{n}, Γ ⟶ C}

Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ C mc.

Assume also that the proofs Π_{1}, …, Π_{n}, Π are (multi)cut-free. We define a measure μ(Ξ) to be the tuple

⟨max{lvl(B_{1}), …, lvl(B_{n})}, def(Π), contr(Π), ∑ | B_{i} |, M(Ξ)⟩ ,

where M(Ξ) is the multiset {ht(Π_{1}), …, ht(Π_{n}), ht(Π)} and | B_{i} | is the number of occurrences of logical connectives in B_{i}. The ordering on the measure μ is defined lexicographically on the ordering of its components.

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

Theorem 7.5. Let Ξ be a derivation of Σ; Γ ⟶ C ending with a multicut, which is the only cut in the derivation. Then there exists a cut-free derivation of the same sequent.

Proof. Let Ξ be the derivation

{Π_{1} \atop Σ; Δ_{1} ⟶ B_{1}} ⋯ {Π_{n} \atop Σ; Δ_{n} ⟶ B_{n}} {Π \atop Σ; B_{1}, …, B_{n}, Γ ⟶ C}

Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ C mc.

If n = 0, Ξ reduces to the premise derivation Π.

For n > 0 we specify the reduction relation based on the last rule of the premise derivations. If the rightmost premise derivation Π ends with a left rule acting on a cut formula B_{i}, then the last rule of Π_{i} and the last rule of Π together determine the reduction rules that apply. We classify these rules according to the following criteria: we call the rule an essential case when Π_{i} ends with a right rule; if it ends with a left rule, it is a right-commutative case; if Π_{i} ends with the init rule, then we have an axiom case. When Π does not end with a left rule acting on a cut formula, then its last rule is alone sufficient to determine the reduction rules that apply. If Π ends in a rule acting on a formula other than a cut formula, then we call this a left-commutative case. A structural case results when Π ends with a contraction or weakening on a cut formula. If Π ends with the init rule, this is also an axiom case. For simplicity of presentation, we always show i = 1 and we often abbreviate judgments like σ ▷ B and σ ▷ C as B and C when the local signature σ is irrelevant to the context of discussion.

Essential cases:

∧R/ ∧ L. If Π_{1} and Π are

{Π′_{1} \atop Σ; Δ_{1} ⟶ σ ▷ B′_{1}} {Π′′_{1} \atop Σ; Δ_{1} ⟶ σ ▷ B′′_{1}} Σ; Δ_{1} ⟶ σ ▷ B′_{1} ∧ B′′_{1} ∧R  {Π′ \atop Σ; σ ▷ B′_{1}, …, Γ ⟶ C} ; Σ; σ ▷ B′_{1} ∧ B′′_{1}, …, Γ ⟶ C ∧L

then Ξ reduces to the derivation Ξ′

{Π′_{1} \atop Σ; Δ_{1} ⟶ B′_{1}} ⋯ {Π_{n} \atop Σ; Δ_{n} ⟶ B_{n}} {Π′ \atop Σ; B′_{1}, …, B_{n}, Γ ⟶ C}

Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ C mc.

The measure μ(Ξ) is smaller than μ(Ξ′), since

max{lvl(B′_{1}), lvl(B_{2}), …, lvl(B_{n})} ≤ max{lvl(B_{1}), …, lvl(B_{n})},
def(Π′) = def(Π), contr(Π) = contr(Π′) and | B′_{1} |<| B_{1} | .

Therefore we can apply the inductive hypothesis to Ξ′ to obtain a cut free derivation. The case for the other ∧L rule is symmetric.

∨R/ ∨ L. If Π_{1} and Π are

{Π′_{1} \atop Σ; Δ_{1} ⟶ σ ▷ B′_{1}} ; Σ; Δ_{1} ⟶ σ ▷ B′_{1} ∨ B′′_{1} ∨R

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

{Π′ \atop Σ; σ ▷ B′_{1}, B_{2}, …, B_{n}, Γ ⟶ C} {Π′′ \atop Σ; σ ▷ B′′_{1}, B_{2}, …, B_{n}, Γ ⟶ C}

Σ; σ ▷ B′_{1} ∨ B′′_{1}, B_{2}, …, B_{n}, Γ ⟶ C ∨L,

then Ξ reduces to a derivation Ξ′

{Π′_{1} \atop Σ; Δ_{1} ⟶ B′_{1}} ⋯ {Π_{n} \atop Σ; Δ_{n} ⟶ B_{n}} {Π′ \atop Σ; B′_{1}, …, B_{n}, Γ ⟶ C}

Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ C mc.

As in previous case, the size of cut formulas decreases, and therefore inductive hypothesis applies to the reduct Ξ′. The case for the other ∨R rule is symmetric.

⊃ R/ ⊃ L:. Suppose Π_{1} and Π are

{Π′_{1} \atop Σ; σ ▷ B′_{1}, Δ_{1} ⟶ σ ▷ B′′_{1}} ; Σ; Δ_{1} ⟶ σ ▷ B′_{1} ⊃ B′′_{1} ⊃ R

{Π′ \atop Σ; B_{2}, …, B_{n}, Γ ⟶ σ ▷ B′_{1}} {Π′′ \atop Σ; σ ▷ B′′_{1}, B_{2}, …, B_{n}, Γ ⟶ C}

Σ; σ ▷ B′_{1} ⊃ B′′_{1}, B_{2}, …, B_{n}, Γ ⟶ C ⊃ L.

Let Ξ_{1} be the derivation

\left\{{Π_{i} \atop Σ; Δ_{i} ⟶ B_{i}}\right\}_{i∈\{2..n\}} {Π′ \atop Σ; B_{2}, …, B_{n}, Γ ⟶ B′_{1}}

Σ; Δ_{2}, …, Δ_{n}, Γ ⟶ B′_{1} mc.

The derivation Ξ_{1} has a smaller size of cut formula than Ξ, while other measures remain non-increasing. Therefore, the inductive hypothesis can be applied to eliminate the multicut in Ξ_{1}. Let Ξ′_{1} denote the cut-free proof obtained by cut-elimination on Ξ_{1} and let Ξ_{2} be the derivation

{Ξ′_{1} \atop Σ; Δ_{2}, …, Δ_{n}, Γ ⟶ B′_{1}} {Π′_{1} \atop Σ; B′_{1}, Δ_{1} ⟶ B′′_{1}}

Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ B′′_{1} mc.

The measure μ(Ξ_{2}) is strictly smaller than μ(Ξ) because

lvl(B′_{1}) < lvl(B_{1}) ≤ max{lvl(B_{1}), …, lvl(B_{n})}.

Recall that lvl(B′_{1} ⊃ B′′_{1}) = max{lvl(B′_{1}) + 1, lvl(B′′_{1})}. Therefore, the multicut in Ξ_{2} can be eliminated by inductive hypothesis to get a cut-free derivation Ξ′_{2}.

The derivation Ξ then reduces to the following derivation Ξ′:

{Ξ′_{2} \atop Σ; … ⟶ B′′_{1}} \left\{{Π_{i} \atop Σ; Δ_{i} ⟶ B_{i}}\right\}_{i∈\{2..n\}} {Π′′ \atop Σ; B′′_{1}, \{B_{i}\}_{i∈\{2..n\}}, Γ ⟶ C}

Σ; Δ_{1}, …, Δ_{n}, Γ, Δ_{2}, …, Δ_{n}, Γ ⟶ C mc. cL

Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ C

We use the double horizontal lines to indicate that the relevant inference rule (in this case, cL) may need to be applied zero or more times. Again, since the cut

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

formulas size decreases, we have μ(Ξ′) < μ(Ξ) and therefore inductive hypothesis can be applied to eliminate the multicut in Ξ′.

∀R/∀L. If Π_{1} and Π are

{Π′_{1} \atop Σ, h; Δ_{1} ⟶ σ ▷ B′_{1}[(h σ)/x]} ; Σ; Δ_{1} ⟶ σ ▷ ∀_{τ} x.B′_{1} ∀R  \begin{matrix}Σ, σ ⊢ t : τ & {Π′ \atop Σ; σ ▷ B′_{1}[t/x], …, Γ ⟶ C} \\ Σ; σ ▷ ∀_{τ} x.B′_{1}, …, Γ ⟶ C \end{matrix} ∀L

then Ξ reduces to the derivation Ξ′

{Π′_{1}[λσ.t/h] \atop Σ; Δ_{1} ⟶ σ ▷ B′_{1}[t/x]} \left\{{Π_{i} \atop Σ; Δ_{i} ⟶ B_{i}}\right\}_{i∈\{2..n\}} {Π′ \atop Σ; … ⟶ C}

Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ C mc.

The size of cut formulas decreases while other measures are non-increasing, therefore μ(Ξ′) < μ(Ξ) and the cut in Ξ′ can be removed by induction hypothesis.

∃R/∃L. If Π_{1} and Π are

\begin{matrix}Σ, σ ⊢ t : τ & {Π′_{1} \atop Σ; Δ_{1} ⟶ σ ▷ B′_{1}[t/x]} \\ Σ; Δ_{1} ⟶ σ ▷ ∃_{τ} x.B′_{1} \end{matrix} ∃R  {Π′ \atop Σ, h; σ ▷ B′_{1}[(h σ)/x], …, Γ ⟶ C} ; Σ; σ ▷ ∃x_{τ} .B′_{1}, …, Γ ⟶ C ∃L

then Ξ reduces to the derivation Ξ′

{Π′_{1} \atop Σ; Δ_{1} ⟶ σ ▷ B′_{1}[t/x]} \left\{{Π_{i} \atop Σ; Δ_{i} ⟶ B_{i}}\right\}_{i∈\{2..n\}} {Π′[λσ.t/h] \atop Σ; σ ▷ B′_{1}[t/x], … ⟶ C}

Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ C mc.

As in the previous case, we can apply the induction hypothesis to remove the cut in Ξ′.

∇R/∇L. Suppose Π_{1} and Π are

{Π′_{1} \atop Σ; Δ_{1} ⟶ (σ, y) ▷ B′_{1}[y/x]} ; Σ; Δ_{1} ⟶ σ ▷ ∇x.B′_{1} ∇R  {Π′ \atop Σ; (σ, y) ▷ B′_{1}[y/x], …, , Γ′ ⟶ C} ; Σ; σ ▷ ∇x.B′_{1}, …, Γ ⟶ C ∇L.

Then Ξ reduces to the derivation Ξ′

{Π′_{1} \atop Σ; Δ_{1} ⟶ (σ, y) ▷ B′_{1}[y/x]}  ⋯  {Π′ \atop Σ; (σ, y) ▷ B′_{1}[y/x], … ⟶ C}

Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ C mc.

The size of the cut formula decreases while other measures remain non-increasing, therefore the multicut in Ξ′ can be eliminated by applying the inductive hypothesis.

defR/defL. Suppose Π_{1} and Π are

{Π′_{1} \atop Σ; Δ_{1} ⟶ B′_{1}θ} ; Σ; Δ_{1} ⟶ B_{1} defR  \begin{matrix}\{ & {Π^{ρ,D} \atop Σρ; Dγ, B_{2}ρ, …, B_{n}ρ, Γρ ⟶ Cρ} & \} \\ Σ; B_{1}, B_{2}, …, B_{n}, Γ ⟶ C \end{matrix} defL.

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

By the defR rule in Π_{1}, dfn(ϵ, B_{1}, θ, B′_{1}) holds. Then Ξ reduces to Ξ′

{Π′_{1} \atop Σ; Δ_{1} ⟶ B′_{1}θ} \left\{{Π_{i} \atop Σ; Δ_{i} ⟶ B_{i}}\right\}_{i∈\{2..n\}} {Π^{ϵ,B′_{1}} \atop Σ; B′_{1}θ, B_{2}, …, B_{n}, Γ ⟶ C}

Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ C mc.

By the definition of definition clause, we have lvl(B′_{1}) ≤ lvl(B_{1}), and therefore the maximum level of cut formulas is non-increasing. However, def(Π^{ϵ,B′_{1}}) < def(Π), therefore μ(Ξ′) < μ(Ξ) and inductive hypothesis can be applied to remove the multicut in Ξ′. Left-commutative cases:

•L/ ∘ L. Suppose Π ends with a left rule other than cL and wL acting on B_{1}, and Π_{1} is

\begin{matrix}\{ & {Π_{1}^{i} \atop Σ′; Δ_{1}^{i} ⟶ B_{1}} & \} \\ Σ; Δ_{1} ⟶ B_{1} \end{matrix} •L,

where •L is any left rule except ⊃ L, defL, and Σ is a subset of Σ′. Then Ξ reduces to the derivation Ξ′

\{{Π_{1}^{i} \atop Σ′; Δ_{1}^{i} ⟶ B_{1}} \left\{{Π′_{j} \atop Σ′; Δ_{j} ⟶ B_{j}}\right\}_{j∈\{2..n\}} {Π′ \atop Σ′; B_{1}, …, B_{n}, Γ ⟶ C} Σ′; Δ_{1}^{i}, Δ_{2}, …, Δ_{n}, Γ ⟶ C mc\}

Σ; Δ_{1}, Δ_{2}, …, Δ_{n}, Γ ⟶ C •L,

where Π′_{j} and Π′ are obtained from Π_{j} and Π by applying Lemma 7.2. Let Ξ′_{i} be a premise derivation of Ξ′. Since for each Π_{1}^{i}, ht(Π_{1}^{i}) < ht(Π_{1}) and since ht(Π′_{j}) ≤ ht(Π_{j}) and ht(Π′) ≤ ht(Π), the multiset M(Ξ′_{i}) is strictly smaller (in the multiset ordering) than the multiset M(Ξ). Since other measures remain unchanged, μ(Ξ′_{i}) < μ(Ξ) (and this applies to arbitrary premise derivations of Ξ′) and therefore by induction hypothesis all the multicuts in Ξ′ can be eliminated.

⊃ L/ ∘ L. Suppose Π ends with a left rule other than cL and wL acting on B_{1} and Π_{1} is

{Π′_{1} \atop Σ; Δ′_{1} ⟶ σ ▷ D′_{1}} {Π′′_{1} \atop Σ; σ ▷ D′′_{1}, Δ′_{1} ⟶ B_{1}}

Σ; σ ▷ D′_{1} ⊃ D′′_{1}, Δ′_{1} ⟶ B_{1} ⊃ L.

Let Ξ_{1} be

{Π′′_{1} \atop Σ; σ ▷ D′′_{1}, Δ′_{1} ⟶ B_{1}} ⋯ {Π_{n} \atop Σ; Δ_{n} ⟶ B_{n}} {Π \atop Σ; B_{1}, …, B_{n}, Γ ⟶ C}

Σ; σ ▷ D′′_{1}, Δ′_{1}, Δ_{2}, …, Δ_{n}, Γ ⟶ C mc.

The multicut in Ξ_{1} can be eliminated by inductive hypothesis since M(Ξ_{1}) < M(Ξ) and other measures are equal. We let Ξ′_{1} denote the resulting cut-free proof from

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

applying cut-elimination to Ξ_{1}. Then Ξ reduces to

{Π′_{1} \atop Σ; Δ′_{1} ⟶ σ ▷ D′_{1}} Σ; Δ′_{1}, Δ_{2}, …, Δ_{n}, Γ ⟶ σ ▷ D′_{1} wL {Ξ′_{1} \atop Σ; σ ▷ D′′_{1}, Δ′_{1}, Δ_{2}, …, Δ_{n}, Γ ⟶ C}

Σ; σ ▷ D′_{1} ⊃ D′′_{1}, Δ′_{1}, Δ_{2}, …, Δ_{n}, Γ ⟶ C ⊃ L.

defL/ ∘ L. If Π ends with a left rule other than cL and wL acting on B_{1} and Π_{1} is

\begin{matrix}\{ & {Π_{1}^{ρ,D} \atop Σρ; Dθ, Δ′_{1}ρ ⟶ B_{1}ρ} & \} \\ Σ; A, Δ′_{1} ⟶ B_{1} \end{matrix} defL.

By the definition of defL rule, the relation dfn(ρ, A, θ, D) holds for a given raised definition clause ∀x̄.[H =^{△} D] where x̄ are chosen to be different from the variables in Σ. Then Ξ reduces to the derivation Ξ′

\{{Π_{1}^{ρ,D} \atop Σρ; Dρ, Δ′_{1}ρ ⟶ B_{1}ρ} \left\{{Π_{j}ρ \atop Σρ; Δ_{j}ρ ⟶ B_{j}ρ}\right\}_{j} {Πρ \atop Σρ; … ⟶ Cρ} Σρ; Dθ, Δ′_{1}ρ, …, Δ_{n}ρ, Γρ ⟶ Cρ mc\}

Σ; A, Δ′_{1}, …, Δ_{n}, Γ ⟶ C defL,

where j ranges over {2, …, n}. Let Ψ be an arbitrary premise derivation of Ξ′. Since ht(Π_{1}^{ρ,D}) < ht(Π_{1}) and ht(Πρ) ≤ ht(Π) and for each j, ht(Π^{j}ρ) ≤ ht(Π^{j}ρ), the multiset M(Ψ) is smaller than M(Ξ) and therefore induction hypothesis can be applied to eliminate the multicut in Ψ (and consequently, all multicuts in Ξ′). Right-commutative cases:

−/ ∘ L. Suppose Π is

\begin{matrix}\{ & {Π^{i} \atop Σ′; B_{1}, …, B_{n}, Γ^{i} ⟶ C} & \} \\ Σ; B_{1}, …, B_{n}, Γ ⟶ C \end{matrix} ∘L,

where Σ′ ⊇ Σ and ∘L is any left rule other than ⊃ L, defL, acting on a judgment other than B_{1}, …, B_{n}. Then Ξ reduces to the derivation Ξ′

\{{Π′_{1} \atop Σ′; Δ_{1} ⟶ B_{1}} ⋯ {Π′_{n} \atop Σ′; Δ_{n} ⟶ B_{n}} {Π^{i} \atop Σ′; B_{1}, …, B_{n}, Γ^{i} ⟶ C} Σ′; Δ_{1}, …, Δ_{n}, Γ^{i} ⟶ C mc\}

Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ C ∘L.

The height of Π^{i} is smaller than the height of Π, therefore using the same argument as in the case defL/ ∘ L we can eliminate the multicuts in Ξ′.

−/ ⊃ L. Suppose Π is

{Π′ \atop Σ; B_{1}, …, B_{n}, Γ′ ⟶ σ ▷ D′} {Π′′ \atop Σ; B_{1}, …, B_{n}, σ ▷ D′′, Γ′ ⟶ C}

Σ; B_{1}, …, B_{n}, σ ▷ D′ ⊃ D′′, Γ′ ⟶ C ⊃ L.

Let Ξ_{1} be

{Π_{1} \atop Σ; Δ_{1} ⟶ B_{1}} ⋯ {Π_{n} \atop Σ; Δ_{n} ⟶ B_{n}} {Π′ \atop Σ; B_{1}, …, B_{n}, Γ′ ⟶ σ ▷ D′}

Σ; Δ_{1}, …, Δ_{n}, Γ′ ⟶ σ ▷ D′ mc

and Ξ_{2} be

{Π_{1} \atop Σ; Δ_{1} ⟶ B_{1}} ⋯ {Π_{n} \atop Σ; Δ_{n} ⟶ B_{n}} {Π′′ \atop Σ; B_{1}, …, B_{n}, σ ▷ D′′, Γ′ ⟶ C}

Σ; Δ_{1}, …, Δ_{n}, σ ▷ D′′, Γ′ ⟶ C mc.

Then Ξ reduces to

{Ξ_{1} \atop Σ; Δ_{1}, …, Δ_{n}, Γ′ ⟶ σ ▷ D′} {Ξ_{2} \atop Σ; Δ_{1}, …, Δ_{n}, σ ▷ D′′, Γ′ ⟶ C}

Σ; Δ_{1}, …, Δ_{n}, σ ▷ D′ ⊃ D′′, Γ′ ⟶ C ⊃ L.

By similar arguments to the previous cases, i.e., the multiset of heights decreases in Ξ_{1} and Ξ_{2}, the multicuts in Ξ′ can be eliminated.

−/defL. If Π is

\begin{matrix}\{ & {Π^{ρ,D} \atop Σρ; B_{1}ρ, …, B_{n}ρ, Dθ, Γ′ρ ⟶ Cρ} & \} \\ Σ; B_{1}, …, B_{n}, A, Γ′ ⟶ C \end{matrix} defL.

Then Ξ reduces to

\{\left\{{Π_{i}ρ \atop Σρ; Δ_{i}ρ ⟶ B_{i}ρ}\right\}_{i∈\{1..n\}} {Π^{ρ,D} \atop Σρ; \{B_{i}ρ\}_{i∈\{1..n\}}, Dθ, Γ′ρ ⟶ Cρ} Σρ; Δ_{1}ρ, …, Δ_{n}ρ, Dθ, Γ′ρ ⟶ Cρ mc\}

Σ; Δ_{1}, …, Δ_{n}, A, Γ′ ⟶ C defL.

Since def(Π^{ρ,D}) < def(Π), we can apply the inductive hypothesis to remove the multicuts.

−/ ∘ R. If Π is

\begin{matrix}\{ & {Π^{i} \atop Σ′; B_{1}, …, B_{n}, Γ^{i} ⟶ C^{i}} & \} \\ Σ; B_{1}, …, B_{n}, Γ ⟶ C \end{matrix} ∘R,

where ∘R is any right rule, then Ξ reduces to

\{{Π′_{1} \atop Σ′; Δ_{1} ⟶ B_{1}} ⋯ {Π′_{n} \atop Σ′; Δ_{n} ⟶ B_{n}} {Π^{i} \atop Σ′; B_{1}, …, B_{n}, Γ^{i} ⟶ C^{i}} Σ′; Δ_{1}, …, Δ_{n}, Γ^{i} ⟶ C^{i} mc\}

Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ C ∘R.

Here the derivation Π′_{i} is obtained from Π_{i} by Lemma 7.2 and hence ht(Π′_{i}) ≤ ht(Π_{i}) < ht(Π). Therefore the multicuts in the reduct can be then eliminated by induction hypothesis.

Structural cases:

−/cL. If Π is

{Π′ \atop Σ; B_{1}, B_{1}, B_{2}, …, B_{n}, Γ ⟶ C} ; Σ; B_{1}, …, B_{n}, Γ ⟶ C cL,

then Ξ reduces to

{Π_{1} \atop Σ; Δ_{1} ⟶ B_{1}} \left\{{Π_{i} \atop Σ; Δ_{i} ⟶ B_{i}}\right\}_{i∈\{1..n\}} {Π′ \atop Σ; B_{1}, B_{1}, B_{2}, …, B_{n}, Γ ⟶ C}

Σ; Δ_{1}, Δ_{1}, Δ_{2}, …, Δ_{n}, Γ ⟶ C mc. cL

Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ C

The measure contr(Π′) < contr(Π), while the maximum level of cut formulas does not change and def(Π) = def(Π′). Therefore μ(Ξ′) < μ(Ξ) and we can apply the inductive hypothesis to remove the multicut in the reduct.

−/wL. If Π is

{Π′ \atop Σ; B_{2}, …, B_{n}, Γ ⟶ C} ; Σ; B_{1}, B_{2}, …, B_{n}, Γ ⟶ C cL,

then Ξ reduces to

\left\{{Π_{i} \atop Σ; Δ_{i} ⟶ B_{i}}\right\}_{i∈\{2..n\}} {Π′ \atop Σ; B_{2}, …, B_{n}, Γ ⟶ C}

Σ; Δ_{2}, …, Δ_{n}, Γ ⟶ C mc. wL

Σ; Δ_{1}, Δ_{2}, …, Δ_{n}, Γ ⟶ C

The total size of cut formulas decreases in the reduct, therefore we can apply the inductive hypothesis to remove the multicut.

\underline{Axiom cases:}

init/−. If Π_{1} ends with the init rule, that is, B_{1} ∈ Δ_{1}, then Ξ reduces to

{Π_{2} \atop Σ; Δ_{2} ⟶ B_{2}} ⋯ {Π_{n} \atop Σ; Δ_{n} ⟶ B_{n}} {Π \atop Σ; B_{1}, B_{2}, …, B_{n}, Γ ⟶ C}

Σ; B_{1}, Δ_{2}, …, Δ_{n}, Γ ⟶ C mc.

Σ; Δ_{1}, Δ_{2}, …, Δ_{n}, Γ ⟶ C wL

The size of cut formulas decreases, while other measures are non-increasing, therefore the multicut can be eliminated by induction hypothesis.

−/init. If Π ends with the init rule and C is a judgment in Γ, then Ξ reduces to

Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ C init.

If Π ends with the init rule, but C is not a judgment in Γ, then C must be one of

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

the cut judgments, say B_{1}. In this case Ξ reduces to

{Π_{1} \atop Σ; Δ_{1} ⟶ B_{1}} ; Σ; Δ_{1}, …, Δ_{n}, Γ ⟶ B_{1} wL

The following corollary is the cut-elimination result for F Oλ^{Δ∇} and it is proved by repeatedly removing uppermost cuts in a proof.

Corollary 7.6. Given a fixed stratified definition, a sequent has a proof in F Oλ^{Δ∇} if and only if it has a cut-free proof.

Cut-elimination and Lemma 7.3 can be used to show certain permutabilities of inference rules in cut-free proofs. We show the interesting case involving the defL rule.

Proposition 7.7. Let Π be a cut-free proof of the sequent Σ; A, Γ ⟶ C, where A is an atomic judgment. Then there exists a cut-free proof Π′ of the same sequent whose last inference rule is an instance of defL applied to A.

Proof. Let Ξ be the derivation

\left\{{Ψθ \atop Σθ; Bθ, Γθ ⟶ Cθ}\right\}_{dfn(θ,A,ρ,B)}

Σ; A, Γ ⟶ C defL

where Ψθ is the derivation

Σθ; Bρ ⟶ Bρ init Σθ; Bρ ⟶ Aθ defR

Πθ Σθ; Aθ, Γθ ⟶ Cθ

Σθ; Bρ, Γθ ⟶ Cθ mc.

The premise derivation Πθ in Ψθ is obtained from Π by Lemma 7.3. The cut-free proof Π′ is obtained by applying cut-elimination procedure on Ξ. Note that the last rule of Ξ is unchanged by cut-elimination and hence Π′ ends with defL.

Since defL_{csu} is a special case of defL, the above proposition holds as well if defL is replaced by defL_{csu}.

Corollary 7.8. Let Π be a cut-free proof of the sequent Σ; A, Γ ⟶ C, where A is an atomic judgment. Then there exists a cut-free proof Π′ of the same sequent whose last inference rule is an instance of defL_{csu} applied to A.

7.2 Properties of ∇

We see from examples in Section 5 and Section 6 that ∇ and ∀ are significantly different when they are used negatively in a proof, i.e., when it appears to the left of certain implications in the proof. We shall now show that when definitions are essentially Horn clauses (recall that in Horn clauses, there are no occurrences of implication in the bodies of the clauses), the difference between ∇ and ∀ cannot actually be observed. In particular, we show that ∇ and ∀ can be interchanged

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

for hc^{∀∇}-definitions and hc^{∀∇}-goals without affecting provability. In proving this statement inductively we need a stronger hypothesis: that is, we can interchange the scope of variables in this case (either global or local) without affecting provability.

Lemma 7.9. Let D be an hc^{∀∇}-definition, and let G be an hc^{∀∇}-goal. The sequent Σ; . ⟶ (σ_{1}, x, σ_{2}) ▷ G is provable if and only if the sequent

Σ, h; . ⟶ (σ_{1}σ_{2}) ▷ G[(h σ_{1})/x]

is provable. Moreover, given a derivation Π of the first sequent, there is a derivation Π′ of the second sequent such that ht(Π′) ≤ ht(Π), and vice versa.

Proof. We show that given a derivation Π of one sequent, we can construct a derivation Π′ of the other sequent by induction on ht(Π). In the transformation, there is no extra rules introduced, therefore ht(Π′) ≤ ht(Π). We show here the non-trivial cases where the derivation Π ends with either ∀R or defR.

Let Π be a derivation of Σ; . ⟶ (σ_{1}, x, σ_{2}) ▷ G. Then we construct a derivation Π′ of Σ, h; . ⟶ (σ_{1}σ_{2}) ▷ G[(h σ_{1})/x] as follows. First, suppose that Π ends with ∀R, that is,

{Π_{1} \atop Σ, f; . ⟶ (σ_{1}, x, σ_{2}) ▷ G′[(f σ_{1} x σ_{2})/y]} ; Σ; . ⟶ (σ_{1}, x, σ_{2}) ▷ ∀y.G′ ∀R.

Applying the substitution [λσ_{1}λxλσ_{2}.f′ σ_{1} σ_{2}/f] to Π_{1}, where f′ is a new eigenvariable, we obtain a derivation Ξ of Σ, f′; . ⟶ (σ_{1}, x, σ_{2}) ▷ G′[(f′ σ_{1} σ_{2})/y]. By Lemma 7.3 substitution does not increase the height of derivation, therefore, the induction hypothesis can be applied to Ξ to get a derivation Ξ′ of

Σ, h, f′; . ⟶ (σ_{1}σ_{2}) ▷ G′[(h σ_{1} σ_{2})/x, (f′ σ_{1} σ_{2})/y].

We can, therefore, take the following derivation as Π′

{Ξ′ \atop Σ, h, f′; . ⟶ (σ_{1}σ_{2}) ▷ G′[(h σ_{1})/x, (f′ σ_{1} σ_{2})/y]} ; Σ, h; . ⟶ (σ_{1}σ_{2}) ▷ ∀y.G′[(h σ_{1})/x] ∀R.

Second, suppose that Π ends with defR

{Π_{1} \atop Σ; . ⟶ (σ_{1}, x, σ_{2}) ▷ Dθ} ; Σ; . ⟶ (σ_{1}, x, σ_{2}) ▷ A defR

where ∀w_{1} … w_{n}.[σ_{1}, x, σ_{2}▷H =^{△} σ_{1}, x, σ_{2}▷D] is the raised definition clause matching σ_{1}, x, σ_{2} ▷A, that is, λσ_{1}λxλσ_{2}.A =_{βη} (λσ_{1}λxλσ_{2}.H)θ. We can assume without loss of generality that the substitution θ is of the form

{λσ_{1}λxλσ_{2}.t_{1}/w_{1}, …, λσ_{1}λxλσ_{2}.t_{n}/w_{n}}.

Let us define a substitution γ as follows

γ = {λσ_{1}λxλσ_{2}.(u_{1} σ_{1}σ_{2})/w_{1}, …, λσ_{1}λxλσ_{2}.(u_{n} σ_{1}σ_{2})/w_{n}}.

where u_{1}, …, u_{n} are new variables different from w̄ and σ_{1}, x, σ_{2}. The corresponding raised definition clause for σ_{1}σ_{2} ▷ A[(h σ_{1})/x] is

∀u_{1} … u_{n}.[σ_{1}σ_{2} ▷ Hγ =^{△} σ_{1}σ_{2} ▷ Dγ].

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

It can be verified that the equation

(λσ_{1}λσ_{2}.A[(h σ_{1})/x]) =_{βη} (λσ_{1}λσ_{2}.Hγ)ρ

holds for ρ = {(λσ_{1}λσ_{2}.t_{1}[(h σ_{1})/x])/u_{1}, …, (λσ_{1}λσ_{2}.t_{n}[(h σ_{1})/x])/u_{n}}. Notice that Dθ[(h σ_{1})/x] =_{βη} Dγρ. Therefore, we construct Π′ as the derivation

{Π′_{1} \atop Σ, h; . ⟶ (σ_{1}σ_{2}) ▷ Dγρ} ; Σ, h; . ⟶ σ_{1}σ_{2} ▷ A[(h σ_{1})/x] defR,

where Π′_{1} is obtained by induction hypothesis.

Conversely, from the derivation Π′ we construct the derivation of Π as follows. Let us assume that x is not in Σ. We first notice that the problem can be simplified by removing the dependency of h on σ_{1}; that is, by applying the substitution [λσ_{1}.x/h] to Π′. We can, therefore, suppose a simpler case where Π′ is a derivation of Σ, x; . ⟶ σ_{1}σ_{2} ▷ G. We examine the following two non-trivial cases.

Suppose Π′ ends with ∀R

{Π_{1} \atop Σ, x, f; . ⟶ σ_{1}σ_{2} ▷ G′[(f σ_{1}σ_{2})/y]} ; Σ, x; . ⟶ σ_{1}σ_{2} ▷ ∀y.G′ ∀R.

Applying the substitution [(λσ_{1}λσ_{2}.f′ σ_{1} x σ_{2})/f] to derivation Π_{1}, we get a derivation Π_{2} of Σ, x, f′; . ⟶ σ_{1}σ_{2} ▷ G′[(f′ σ_{1} x σ_{2})/y]. The derivation Π is then

{Π′_{2} \atop Σ, f′; . ⟶ σ_{1}, x, σ_{2} ▷ G′[(f σ_{1} x σ_{2})/y]} ; Σ; . ⟶ σ_{1}, x, σ_{2} ▷ ∀y.G′ ∀R,

where Π′_{2} is obtained by applying the induction hypothesis to Π_{2}.

For the second case, suppose Π′ ends with defR

{Π_{1} \atop Σ, x; . ⟶ σ_{1}σ_{2} ▷ Dθ} ; Σ, x; . ⟶ σ_{1}σ_{2} ▷ A defR

where ∀w_{1} … ∀w_{n}.[σ_{1}σ_{2} ▷ H =^{△} σ_{1}σ_{2} ▷ D] is the matching definition clause, i.e., λσ_{1}λσ_{2}.A =_{βη} (λσ_{1}λσ_{2}.H)θ. As in the previous case we can suppose that θ is of the form

{(λσ_{1}λσ_{2}.t_{1})/w_{1}, …, (λσ_{1}λσ_{2}.t_{n})/w_{n}}.

The corresponding raised definition clause for the judgment σ_{1}, x, σ_{2} ▷ A is

∀u_{1} … ∀u_{n}.[σ_{1} x σ_{2} ▷ Hγ =^{△} σ_{1} x σ_{2} ▷ Dγ],

where γ = {(λσ_{1}λσ_{2}.u_{1} σ_{1} x σ_{2})/w_{1}, …, (λσ_{1}λσ_{2}.u_{n} σ_{1} x σ_{2})/w_{n}, }. Let ρ be the substitution

{λσ_{1}λxλσ_{2}.t_{1}, …, λσ_{1}λxλσ_{2}.t_{n}}.

It can be verified that the equation (λσ_{1}λxλσ_{2}.A) =_{βη} (λσ_{1}λxλσ_{2}.Dγ)ρ holds, and

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

that Dγρ = Dθ. Therefore, we construct Π as the derivation

{Π′_{1} \atop Σ; . ⟶ σ_{1}, x, σ_{2} ▷ Dθ} ; Σ; . ⟶ σ_{1}, x, σ_{2} ▷ A defR

where Π′_{1} is obtained from induction hypothesis.

Proposition 7.10. Let D be an hc^{∀∇}-definition and let D′ be the hc^{∀∇}-definit-ion resulting from replacing some occurrences of ∀ and ∇ in the body of clauses of D with ∇ and ∀, respectively. Similarly, let G be an hc^{∀∇}-goal and let G′ be the hc^{∀∇}-goal resulting from replacing some occurrences of ∀ and ∇ in G with ∇ and ∀, respectively. If the sequent Σ; · ⟶ σ ▷ G is provable using definition D then the sequent Σ; · ⟶ σ ▷ G′ is provable using definition D′.

Proof. Let Π be a derivation of Σ; · ⟶ σ ▷ G. We construct a derivation Π′ of Σ; · ⟶ σ ▷ G′ by induction on the measure ht(Π). The non-trivial cases are when Π ends with the introduction rule for the connective being interchanged.

Suppose G = ∀x.H, G′ = ∇x.H′ and Π ends with ∀R.

{Π_{1} \atop Σ, h; . ⟶ σ ▷ H[(h σ)/x]} ; Σ; . ⟶ σ ▷ ∀x.H ∀R

By Lemma 7.9 there is a derivation Π′_{1} of Σ; . ⟶ (σ, x) ▷ H such that ht(Π′_{1}) ≤ ht(Π_{1}). We can, therefore, apply the induction hypothesis to Π′_{1} to get a derivation Π_{2} of Σ; . ⟶ (σ, x) ▷ H′. The derivation Π′ is, therefore,

{Π_{2} \atop Σ; . ⟶ (σ, x) ▷ H′} ; Σ; . ⟶ σ ▷ ∇x.H′ ∇R

The case where G = ∇x.H, G′ = ∀x.H′ and Π ends with ∇R is done analogously, since Lemma 7.9 works on both directions.

As a consequence of this proposition, the difference between ∀ and ∇ (or, equivalently, between the global and local signatures of a sequent) cannot be seen if one is simply attempting to “evaluate” hc^{∀} logical programs by determining the atoms that they can prove. To illustrate the difference between these two quantifiers, we need to consider goals and/or definitions that contain implications. We have done this in Section 5, for example, when we illustrated the differences between ∀ and ∇ with the specification of simulation in the π-calculus.

In Figure 4 we presented eight non-theorems of F Oλ^{∇} and claimed that, with certain restrictions, the last three are provable. For a fixed noetherian definition (see the following Definition), we claim the following: formula (8) is provable and if the definition is furthermore hc^{∀∇} then formulas (6) and (7) are also provable. The fact that formula (8) is a theorem of F Oλ^{Δ∇} for noetherian definitions follows from Proposition 7.12. The proof of the provability of formulas (6) and (7) follows by similarly structured proofs.

Definition 7.11. A definition D is noetherian if for every definition clause ∀x̄.[pt̄=^{△} B] in D, it holds that lvl(p) > lvl(B).

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

Proposition 7.12. Given a noetherian definition, the sequent

Σ; Γ, σ ▷ B ⟶ σ′ ▷ B,

where σ′ is a permutation of σ, is provable in F Oλ^{Δ∇}.

Proof. We construct a derivation of Γ, σ ▷ B ⟶ σ′ ▷ B inductively. The induction is on the level of B with subordinate induction on the size of B. We can assume without loss of generality that all predicates in the definition are assigned levels greater than 0 and recall that we require all predicates to be defined. The cases where B is a non-atomic formula are straightforward; we just apply the introduction rules for the outermost connective in B, coordinated between left and right rules. In the case where B is an atomic formula, suppose that dfn(ρ, σ ▷ B, θ, σ ▷ D) holds for a clause ∀h_{1}, …, h_{n}.[σ ▷ H =^{△} σ ▷ D], that is, (λσ.B)ρ =_{βη} (λσ.H)θ. Let δ be the substitution {(λσ.h′_{1}σ′)/h_{1}, …, (λσ.h′_{n}σ′)/h_{n}}. It suffices to show that there is a substitution γ such that dfn(ϵ, (σ′ ▷ B)ρ, γ, σ′ ▷ Dδ) holds for the raised clause ∀h′_{1}, …, h′_{n}.[σ ▷ Hδ =^{△} σ ▷ Dδ]. The following substitution solves the matching:

γ(x) = \{ \begin{matrix}λσ′.(h_{i}θ) σ, if x = h_{i} for some i ∈ \{1, …, n\}, \\ θ(x), otherwise. \end{matrix}

We conjecture that if we incorporated into our proof system an appropriate induction inference rule, then the restriction of noetherian can be removed from Proposition 7.12 and from the claims made for formulas (6) and (7) of Figure 4.

8. RELATED WORK AND CONCLUSION

We have considered the approach to the specification of computation in which term-level and proof-level abstractions are used to encode abstractions both of the static structure of expressions (e.g., using meta-level λ-abstractions to encode the input prefix in the π-calculus) and the dynamic structure of computation (e.g., name generation as eigenvariables). While this style of syntactic representation has been successfully used to enumerate judgments about operational semantics and to encode object-logic provability, traditional proof-level abstractions (eigenvariables) seem inadequate when one wishes to reason about computation directly (as outlined in Section 1). We have explored a simple mechanism within sequent calculus to expand the notion of abstraction in the building of proofs. Our approach to the ∇ quantifier is thus not an attempt at a notion of name “freshness” or a semantics for “name generation”.

It is natural to ask about possible connections between the ∇-quantifier and the new quantifier of Pitts and Gabbay [Gabbay and Pitts 2001; Pitts 2003]. Both are self dual and both have similar sets of applications in mind. The focus on ∇ has been proof theoretic while the work on Pitts and Gabbay has been model theoretic. More concretely, while ∇ neither implies nor is implied by ∀ or ∃, the quantifier of Pitts and Gabbay is entailed by ∀ and entails ∃. In Pitts and Gabbay, the domain of quantification is fixed to a certain denumerably infinite set of names, while the ∇ quantifier works at any type. In their recent paper [Gabbay and Cheney 2004], Gabbay and Cheney provide some initial connections between these two quantifiers.

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

Pursuing such a connection might help provide a model theoretic semantics for ∇ and for F Oλ^{Δ∇} more generally.

Formal logic has also been used as a framework for meta-theoretic reasoning about dependent type systems. The closest such work to F Oλ^{Δ∇} is probably Schürmann’s M_{2}^{+} logic for reasoning about the LF system [Schürmann 2000]. The logic M_{2}^{+} allows richer definitions of object-systems, compared to F Oλ^{Δ∇}, since they are not subject to the stratification using levels. Instead, definitions in M_{2}^{+} are stratified using something called “regular worlds assumption”. Translated to our setting, this feature would permit, in particular, some unstratifiable definitions. Possible connections between these two systems is left for future work.

To work with interesting examples, an implementation of F Oλ^{Δ∇} is needed. An outline for such implementation is discussed in [Tiu and Miller 2004] and a prototype implementation of a subset of F Oλ^{Δ∇} following this outline has been built using the functional language Standard ML [Tiu 2004a]. Using this prover, we were able to write the specifications of the transition system of π-calculus and the open bisimulation relation given in [Tiu and Miller 2004] and automatically check for open bisimilarity for finite processes. The Isabelle theorem prover might also provide a setting for building an interactive theorem prover given the work reported in [Momigliano et al. 2002].

A natural next step involves adding directly to F Oλ^{Δ∇} both induction and coinduction. A preliminary step in that direction appears in [Tiu 2004b] and follows the earlier work on induction in the F Oλ^{ΔIN} logic [McDowell and Miller 2000]. Closely related work involving induction and co-induction but without ∇ in appears in [Momigliano and Tiu 2003].

Acknowledgments An earlier version of this paper appeared as [Miller and Tiu 2003]. The authors wish to thank Catuscia Palamidessi for valuable discussions regarding our π-calculus examples, Frank Pfenning for his comments on the general project of this paper, Gopalan Nadathur for his comments a draft of this paper, and an anonymous reviewer of this paper for many useful comments and suggestions. This work has been supported in part by NSF grant CCR-9912387 and the ACI grants GEOCAL and Rossignol. The second author gratefully acknowledges support from LIX at École polytechnique.

REFERENCES Cervesato, I., Durgin, N. A., Lincoln, P. D., Mitchell, J. C., and Scedrov, A. 1999. A meta-

notation for protocol analysis. In Proceedings of the 12th IEEE Computer Security Foundations Workshop — CSFW’99, R. Gorrieri, Ed. IEEE Computer Society Press, Mordano, Italy, 55–69.

Cervesato, I. and Pfenning, F. 1996. A linear logic framework. In Proceedings, Eleventh Annual IEEE Symposium on Logic in Computer Science. IEEE Computer Society Press, New Brunswick, New Jersey, 264–275.

Chirimar, J. 1995. Proof theoretic approach to specification languages. Ph.D. thesis, University

of Pennsylvania. Church, A. 1940. A formulation of the simple theory of types. J. of Symbolic Logic 5, 56–68. Eriksson, L.-H. 1991. A finitary version of the calculus of partial inductive definitions. In Proc.

of the Second International Workshop on Extensions to Logic Programming, L.-H. Eriksson, L. Hallnäs, and P. Schroeder-Heister, Eds. LNAI, vol. 596. Springer-Verlag, 89–134.

Felty, A. and Miller, D. 1988. Specifying theorem provers in a higher-order logic programming language. In Ninth International Conference on Automated Deduction. Springer-Verlag, Argonne, IL, 61–80.

ACM Transactions on Computational Logic, Vol. V, No. N, December 2004.

Gabbay, M. J. and Cheney, J. 2004. A sequent calculus for nominal logic. In Proc. 19th IEEE

Symposium on Logic in Computer Science (LICS 2004). 139–148. Gabbay, M. J. and Pitts, A. M. 2001. A new approach to abstract syntax with variable binding.

Formal Aspects of Computing 13, 341–363. Gentzen, G. 1969. Investigations into logical deductions. In The Collected Papers of Gerhard

Gentzen, M. E. Szabo, Ed. North-Holland Publishing Co., Amsterdam, 68–131. Girard, J.-Y. 1992. A fixpoint theorem in linear logic. Email to the linear@cs.stanford.edu

mailing list. Hallnäs, L. and Schroeder-Heister, P. 1991. A proof-theoretic approach to logic program-

ming. II. Programs as definitions. Journal of Logic and Computation 1, 5 (October), 635–660. Huet, G. 1975. A unification algorithm for typed λ-calculus. Theoretical Computer Science 1,

27–57. McDowell, R. 1997. Reasoning in a logic with definitions and induction. Ph.D. thesis, University

of Pennsylvania. McDowell, R. and Miller, D. 2000. Cut-elimination for a logic with definitions and induction.

Theoretical Computer Science 232, 91–119. McDowell, R. and Miller, D. 2002. Reasoning with higher-order abstract syntax in a logical

framework. ACM Transactions on Computational Logic 3, 1 (January), 80–136. McDowell, R., Miller, D., and Palamidessi, C. 2003. Encoding transition systems in sequent

calculus. Theoretical Computer Science 294, 3, 411–437. Miller, D. 1989. Lexical scoping as universal quantification. In Sixth International Logic Pro-

gramming Conference. MIT Press, Lisbon, Portugal, 268–283. Miller, D. 1991. A logic programming language with lambda-abstraction, function variables,

and simple unification. Journal of Logic and Computation 1, 4, 497–536. Miller, D. 1992. Unification under a mixed prefix. J. of Symbolic Computation 14, 4, 321–358. Miller, D. 1993. The π-calculus as a theory in linear logic: Preliminary results. In Proceedings

of the 1992 Workshop on Extensions to Logic Programming, E. Lamma and P. Mello, Eds. Number 660 in LNCS. Springer-Verlag, Bologna, Italy, 242–265.

Miller, D. 1996. Forum: A multiple-conclusion specification language. Theoretical Computer

Science 165, 1 (Sept.), 201–232. Miller, D. 2000. Abstract syntax for variable binders: An overview. In Computational Logic -

CL 2000, J. Lloyd and et. al., Eds. Number 1861 in LNAI. Springer, 239–253. Miller, D. and Palamidessi, C. 1999. Foundational aspects of syntax. In ACM Computing

Surveys Symposium on Theoretical Computer Science: A Perspective, P. Degano, R. Gorrieri, A. Marchetti-Spaccamela, and P. Wegner, Eds. Vol. 31. ACM.

Miller, D. and Tiu, A. 2002. Encoding generic judgments. In Proceedings of FSTTCS. Number

2556 in LNCS. Springer-Verlag, 18–32. Miller, D. and Tiu, A. 2003. A proof theory for generic judgments: An extended abstract. In

Proc. 18th IEEE Symposium on Logic in Computer Science (LICS 2003). IEEE, 118–127. Milner, R., Parrow, J., and Walker, D. 1992. A calculus of mobile processes, Part I. Infor-

mation and Computation 100, 1 (September), 1–40. Momigliano, A., Ambler, S., and Crole, R. 2002. A hybrid encoding of Howe’s method for

establishing congruence of bisimilarity. In LFM’02. ENTCS, vol. 70.2. Springer-Verlag. Momigliano, A. and Tiu, A. 2003. Induction and co-induction in sequent calculus. In Proceedings

of TYPES 2003 Workshop. LNCS, vol. 3085. Springer, 293 – 308. Nipkow, T. 1993. Functional unification of higher-order patterns. In Proc. 8th IEEE Symposium

on Logic in Computer Science (LICS 1993), M. Vardi, Ed. IEEE, 64–74. Paulson, L. C. 1989. The foundation of a generic theorem prover. Journal of Automated Rea-

soning 5, 363–397. Pfenning, F. and Elliott, C. 1988. Higher-order abstract syntax. In Proc. of the ACM-

SIGPLAN Conf. on Prog. Language Design and Implementation. ACM Press, 199–208.

Pfenning, F. and Rohwedder, E. 1992. Implementing the meta-theory of deductive systems. In Proceedings of the 1992 Conference on Automated Deduction. Number 607 in LNCS. Springer, 537–551.

Pitts, A. M. 2003. Nominal logic, a first order theory of names and binding. Information and

Computation 186, 2, 165–193. Schroeder-Heister, P. 1992. Cut-elimination in logics with definitional reflection. In Non-

classical Logics and Information Processing, D. Pearce and H. Wansing, Eds. LNCS, vol. 619. Springer, 146–171.

Schroeder-Heister, P. 1994. Cut elimination for logics with definitional reflection and restricted initial sequents. In Proceedings of the Post-Conference Workshop of ICLP 1994 on Proof-Theoretic Extensions of Logic Programming.

Schürmann, C. 2000. Automating the meta theory of deductive systems. Ph.D. thesis, Carnegie

Mellon University. Slaney, J. 1989. Solution to a problem of Ono and Komori. J. of Philosophic Logic 18, 103–111. Tiu, A. 2004a. Level 0/1 prover: A tutorial. Available via the web and from Tiu. Tiu, A. 2004b. A logical framework for reasoning about logical specifications. Ph.D. thesis,

Pennsylvania State University. Tiu, A. and Miller, D. 2004. A proof search specification of the π-calculus. In Proceedings of

the 3rd Workshop on the Foundations of Global Ubiquitous Computing.

Received November 2003; first revision August 2004; accepted November 2004.