6 (4:7) 2010 1–31 Nov. 16, 2009 Dec. 18, 2010
*This is a revised and extended version of a paper with the same title appeared in the Proceedings of the Ninth International Conference on Typed Lambda Calculi and Applications
Bounded Linear Logic, Revisited\rsuper*
Abstract.
We present QBAL, an extension of Girard, Scedrov and Scott’s bounded linear logic. The main novelty of the system is the possibility of quantifying over resource variables. This generalization makes bounded linear logic considerably more flexible, while preserving soundness and completeness for polynomial time. In particular, we provide compositional embeddings of Leivant’s RRW and Hofmann’s LFPL into QBAL.
Key words and phrases:
linear logic, proof theory, implicit computational complexity1991 Mathematics Subject Classification:
F.4.11. Introduction
After two decades from the pioneering works that started it [Bellantoni92, Leivant91, Leivant93], implicit computational complexity is now an active research area at the intersection of mathematical logic and computer science. Its aim is the study of machine-free characterizations of complexity classes. The correspondence between an ICC system and a complexity class holds only extensionally, i.e., the class of functions (or problems) which are representable in the system equals the complexity class. Usually, the system is a fragment or subsystem of a larger programming language or logical system, the base system, in which other functions besides the ones in the complexity class can be represented. Sometimes, one of the two inclusions is shown by proving that any program (or proof) can be reduced with a bounded amount of resources; in this case, we say that the system is intensionally sound. On the other hand, ICC systems are very far from being intensionally complete: there are many programs (or proofs) in the base system which are not in the ICC system, even if they can be evaluated with the prescribed complexity bounds. Observe that this does not contradict extensional completeness, since many different programs or proofs compute the same function.
Of course, a system that captures all and only the programs of the base system running within a prescribed complexity bound will in all but trivial cases (e.g., empty base system) fail to be recursively enumerable. Thus, in practice, one strives to improve intensional expressivity by capturing important classes of examples and patterns.
An obstacle towards applying ICC characterizations of complexity classes to programming language theory is their poor intensional expressive power: most ICC systems do not capture natural programs and therefore are not useful in practice. This problem has been already considered in the literature. Some papers try to address the poor intensional expressive power of ICC systems by defining new languages or logics allowing to program in ways which are not allowed in existing ICC systems. This includes quasi-interpretations [Marion00] and LFPL, by the second author [Hofmann03]. Other papers analyze the intensional expressive power of existing systems either by studying necessary conditions on captured programs or, more frequently, by studying relations between existing ICC systems. One nice example is Murawski and Ong’s paper [Murawski04], in which the authors prove that a subsystem of Bellantoni and Cook’s function algebra BC [Bellantoni92] can be embedded into light affine logic [Asperti02] and that the embedding cannot be extended to the whole BC. In this work, we somehow combine the two approaches, by showing that:
-
A new logical system, called Quantified Bounded Affine Logic (QBAL for short) can be defined as a generalization of Girard, Scedrov and Scott’s bounded linear logic (BLL, [Girard92]), itself the first characterization of polynomial time computable functions as a fragment of Girard’s linear logic [Girard87].
-
QBAL is intensionally at least as expressive as two heterogeneous, existing systems, namely Leivant’s RRW [Leivant93] and LFPL.
Bounded linear logic has received relatively little attention in the past [Hofmann04, Schoepp07]. This is mainly due to its syntax, which is more involved than the one of other complexity-related fragments of linear logic appeared more recently [Girard98, Lafont04, Danos03]. In bounded linear logic, polynomials are part of the syntax and, as a consequence, computation time is controlled explicitly; in other words, BLL cannot be claimed to be a truly implicit characterization of polynomial time. Moreover, it seems that BLL is not expressive enough to embed any existing ICC system corresponding to polynomial time (except Lafont’s SLL [Lafont04], which anyway was conceived as a very small fragment of BLL).
QBAL is obtained by endowing BLL with bounded quantification on resource variables. In other words, formulas of QBAL includes the ones of BLL, plus formulas like or . Rules governing bounded quantification can be easily added to BLL, preserving its good properties: QBAL is still a characterization of the polytime functions in an extensional sense. Bounded quantification on resource variables, on the other hand, has tremendous consequences from an intensional point of view: both RRW and LFPL can be compositionally embedded into QBAL. This means, arguably, that programs in either RRW or LFPL can be rewritten in QBAL without major changes, i.e., by mimicking their syntactic structure. Similar results are unlikely to hold for BLL, as argued in sections LABEL:sect:emlfpl and LABEL:sect:emrrw below.
Logical systems like QBAL or BLL cannot be considered as practical programming languages, although proofs can be interpreted as programs in the sense of Curry and Howard: the syntax is too complicated and the potential programmer would have to provide quantitative information in the form of polynomials while writing programs. On the other hand, considering BLL or QBAL as type systems for the (linear) lambda calculus is interesting, although type inference would be undecidable in general. In this paper, we advocate the usefulness of QBAL as an intermediate language in which to prove soundness results about other ICC systems.
For all these reasons, QBAL is not just another system capturing polynomial time computable functions.
The rest of this paper is organized as follows:
-
In Section 2 the syntax of QBAL is introduced, and some interesting properties of the system are proved, together with some examples on how to write programs as proofs of QBAL.
-
Section LABEL:sect:sts introduces a set-theoretic semantics for QBAL, which is exploited in Section LABEL:sect:qpt to show polytime soundness of the system.
-
Section LABEL:sect:oce contains some informal discussion about compositional embeddings.
-
Section LABEL:sect:emlfpl and LABEL:sect:emrrw present compositional embeddings of LFPL and RRW into QBAL, respectively.
2. Syntax
In this section, we present the syntax of QBAL, together with some of its main properties. In the following, we adhere to the notation adopted in the relevant literature on BLL [Girard92, Hofmann04].
2.1. Resource Polynomials and Constraints
Polynomials appears explicitly in the formulas of QBAL, exactly as in BLL. A specific notation for polynomials was introduced in [Girard92], and will be adopted here. In the following, is the set of natural numbers. Sometimes, we use the vector notation , which stands for the sequence , where is assumed to be known from the context. {defi}
-
Given a set of resource variables, a resource monomial over is any finite product of binomial coefficients
where the resource variables are pairwise distinct and are natural numbers.
-
A resource polynomial over is any finite sum of monomials over . denotes the set of resource variables in a resource polynomial .
Resource polynomials are notations for polynomials with rational coefficients. However, by construction, every resource polynomial maps natural numbers to natural numbers. An example of a resource polynomial on (actually a monomial) is
Resource polynomials satisfy some nice closure properties:
Lemma 1.
All constant functions and the identity are resource polynomials. Moreover, resource polynomials are closed under binary sums, binary products, composition, and bounded sums.
Proof 2.1.
Every constant function is simply the resource polynomial
The identity is the resource polynomial
Closure under binary sums is trivial. To prove closure under products, it suffices to show that the product of two monomials (on the same variable) is a resource polynomial, but this boils down to show that the product of two binomial coefficients and can be expressed itself as a resource polynomial. Actually, if , then
where
is a multinomial coefficient. The bounded sum
where is a resource polynomial not mentioning the variable (but possibly mentioning ) can be formed by observing that
Closure by composition can be proved similarly.∎
As a consequence, every polynomial with natural number coefficients is a resource polynomial. The main reason why resource polynomials were originally chosen as a notation for polynomials in BLL [Girard92] was closure under bounded sums, a property which is not true in more traditional notation schemes. We follow the original paper here.
Already in BLL, an order relation on resource polynomials is an essential ingredient in defining the syntax of formulas and proof. In QBAL, the notion is even more important: two polynomials can be compared unconditionally or with an implicit assumption in the form of a set of constraints. {defi}[Constraints]
-
A constraint is an inequality in the form , where and are resource polynomials. A constraint holds (and we write ) if it is true in the standard model. The expression stands for the constraint . Variables in appear negatively, while those in appear positively in every constraint .
-
A constraint set is a finite set of constraints. Constraint sets are denoted with letters like , or . A constraint is a consequence of a constraint set (and we write ) if is logical consequence of . For every constraint sets and , iff for every constraint in .
-
For each constraint set , we define an order on resource polynomials by imposing iff .
Resource polynomials are ordered extensionally: holds if is smaller than in the standard model of arithmetic. This definition is different from the one from [Girard92] which is weaker but syntactical, defining to be smaller or equal to if and only if is itself a resource polynomial. This choice is motivated by the necessity of reasoning about resource polynomials under some assumptions in a constraint set. On the other hand, it has some consequences for the decidability of type checking, discussed in Section LABEL:sect:typechecking.
The following is a useful technical result about constraints:
Lemma 2.
If occur positively (negatively, respectively) in , for every and , then (, respectively).