This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

\lmcsheading

6 (4:7) 2010 1–31 Nov. 16, 2009 Dec. 18, 2010

\titlecomment\lsuper

*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*

Ugo Dal Lago\rsupera \lsuperaDipartimento di Scienze dell’Informazione, Università di Bologna dallago@cs.unibo.it  and  Martin Hofmann\rsuperb \lsuperbInstitut für Informatik, LMU München mhofmann@informatik.uni-muenchen.de
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 complexity
1991 Mathematics Subject Classification:
F.4.1

1. 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 BC\textsf{BC}^{-} 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:

  1. \bullet

    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].

  2. \bullet

    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 x:{xy2}.A\exists x:\{x\leq y^{2}\}.A or x,y:{xz,yz3}.B\forall x,y:\{x\leq z,y\leq z^{3}\}.B. 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:

  1. \bullet

    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.

  2. \bullet

    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.

  3. \bullet

    Section LABEL:sect:oce contains some informal discussion about compositional embeddings.

  4. \bullet

    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, \mathbb{N} is the set of natural numbers. Sometimes, we use the vector notation x¯\overline{x}, which stands for the sequence x1,,xnx_{1},\ldots,x_{n}, where nn is assumed to be known from the context. {defi}

  1. \bullet

    Given a set XX of resource variables, a resource monomial over XX is any finite product of binomial coefficients

    i=1m(xini)\prod_{i=1}^{m}\binom{x_{i}}{n_{i}}

    where the resource variables x1,,xmx_{1},\ldots,x_{m} are pairwise distinct and n1,,nmn_{1},\ldots,n_{m} are natural numbers.

  2. \bullet

    A resource polynomial over XX is any finite sum of monomials over XX. 𝐹𝑉(p)\mathit{FV}(p) denotes the set of resource variables in a resource polynomial pp.

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 {x}\{x\} (actually a monomial) is

(x2)=x(x1)2!=12x(x1).\binom{x}{2}=\frac{x\cdot(x-1)}{2!}=\frac{1}{2}\cdot x\cdot(x-1).

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 nn is simply the resource polynomial

1++1n times=(x0)++(x0)n times.\underbrace{1+\ldots+1}_{\mbox{$n$ times}}=\underbrace{\binom{x}{0}+\ldots+\binom{x}{0}}_{\mbox{$n$ times}}.

The identity is the resource polynomial

(x1).\binom{x}{1}.

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 (xn)\binom{x}{n} and (xm)\binom{x}{m} can be expressed itself as a resource polynomial. Actually, if mnm\leq n, then

(xm)(xn)=k=0m(m+nkk,mk,nk)(xm+nk)\binom{x}{m}\cdot\binom{x}{n}=\sum_{k=0}^{m}\binom{m+n-k}{k,m-k,n-k}\cdot\binom{x}{m+n-k}

where

(m+nkk,mk,nk)\binom{m+n-k}{k,m-k,n-k}

is a multinomial coefficient. The bounded sum

x<yp\sum_{x<y}p

where pp is a resource polynomial not mentioning the variable yy (but possibly mentioning xx) can be formed by observing that

k=0n(jk)=(n+1k+1).\sum_{k=0}^{n}\binom{j}{k}=\binom{n+1}{k+1}.

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]

  1. \bullet

    A constraint is an inequality in the form pqp\leq q, where pp and qq are resource polynomials. A constraint pqp\leq q holds (and we write pq\models p\leq q) if it is true in the standard model. The expression p<qp<q stands for the constraint p+1qp+1\leq q. Variables in pp appear negatively, while those in qq appear positively in every constraint pqp\leq q.

  2. \bullet

    A constraint set is a finite set of constraints. Constraint sets are denoted with letters like 𝒞\mathscr{C}, 𝒟\mathscr{D} or \mathscr{E}. A constraint pqp\leq q is a consequence of a constraint set 𝒞\mathscr{C} (and we write 𝒞pq\mathscr{C}\models p\leq q) if pqp\leq q is logical consequence of 𝒞\mathscr{C}. For every constraint sets 𝒞\mathscr{C} and 𝒟\mathscr{D}, 𝒞𝒟\mathscr{C}\models\mathscr{D} iff 𝒞pq\mathscr{C}\models p\leq q for every constraint pqp\leq q in 𝒟\mathscr{D}.

  3. \bullet

    For each constraint set 𝒞\mathscr{C}, we define an order 𝒞\sqsubseteq_{\mathscr{C}} on resource polynomials by imposing p𝒞qp\sqsubseteq_{\mathscr{C}}q iff 𝒞pq\mathscr{C}\models p\leq q.

Resource polynomials are ordered extensionally: pqp\leq q holds if pp is smaller than qq in the standard model of arithmetic. This definition is different from the one from [Girard92] which is weaker but syntactical, defining pp to be smaller or equal to qq if and only if qpq-p 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 x1,,xnx_{1},\ldots,x_{n} occur positively (negatively, respectively) in 𝒞\mathscr{C}, pi𝒟qip_{i}\sqsubseteq_{\mathscr{D}}q_{i} for every ii and x¯𝐹𝑉(𝒟)\overline{x}\notin\mathit{FV}(\mathscr{D}), then 𝒞{p¯/x¯}𝒟𝒞{q¯/x¯}\mathscr{C}\{\overline{p}/\overline{x}\}\cup\mathscr{D}\models\mathscr{C}\{\overline{q}/\overline{x}\} (𝒞{q¯/x¯}𝒟𝒞{p¯/x¯}\mathscr{C}\{\overline{q}/\overline{x}\}\cup\mathscr{D}\models\mathscr{C}\{\overline{p}/\overline{x}\}, respectively).