<<

University of Pennsylvania ScholarlyCommons

IRCS Technical Reports Series Institute for Research in Cognitive Science

December 1994

A Multiple-Conclusion Meta-Logic

Dale Miller University of Pennsylvania

Follow this and additional works at: https://repository.upenn.edu/ircs_reports

Miller, Dale, "A Multiple-Conclusion Meta-Logic" (1994). IRCS Technical Reports Series. 175. https://repository.upenn.edu/ircs_reports/175

University of Pennsylvania Institute for Research in Cognitive Science Technical Report No. IRCS-94-30.

This paper is posted at ScholarlyCommons. https://repository.upenn.edu/ircs_reports/175 For more information, please contact [email protected]. A Multiple-Conclusion Meta-Logic

Abstract The theory of cut-free proofs has been used to motivate and justify the design of a number of logic programming languages. Two such languages, λProlog and its refinement, Lolli [12], provide for various forms of abstraction (modules, abstract data types, higher-order programming) but lack primitives for concurrency. The logic programming language, LO (Linear Objects) [2] provides for concurrency but lacks abstraction mechanisms. In this paper we present Forum, a logic programming presentation of all of linear logic that modularly extends the languages λProlog, Lolli, and LO. Forum, therefore, allows specifications ot incorporate both abstractions and concurrency. As a meta-language, Forum greatly extends the expressiveness of these other logic programming languages. To illustrate its expressive strength, we specify in Forum a sequent calculus system and the operational of a functional programming language that incorporates such nonfunctional features as counters and references.

Comments University of Pennsylvania Institute for Research in Cognitive Science Technical Report No. IRCS-94-30.

This technical report is available at ScholarlyCommons: https://repository.upenn.edu/ircs_reports/175 The Institute For Research In Cognitive Science

A Multiple-Conclusion Meta-Logic P by

Dale Miller E University of Pennsylvania 3401 Walnut Street, Suite 400C Philadelphia, PA 19104-6228 N December 1994

Site of the NSF Science and Technology Center for Research in Cognitive Science N

University of Pennsylvania IRCS Report 94-30 Founded by Benjamin Franklin in 1740

A MultipleConclusion MetaLogic

Dale Miller

Computer Science Department UniversityofPennsylvania

Philadelphia PA USA

dalesaulcisupennedu

Abstract asequent whose righthand side is nonatomic is the

conclusion of a rightintro duction rule The b ottom

The theory of cutfree sequent pro ofs has b een used

up search for uniform pro ofs is goaldirected to the

to motivate and justify the design of a number of

extent that if the goal has a logical connectiveasits

logic programming languages Twosuch languages

head that o ccurrence of that connectivemust b e in

Prolog and its linear logic renement Lolli pro

tro duced the lefthand side of a sequent is only con

vide for various forms of abstraction mo dules ab

sidered when the goal is atomic A logic programming

stract data typ es higherorder programming but lack

language is then a logical system for which uniform

primitives for concurrency The logic programming

pro ofs are complete The logics underlying Prolog

language LO Linear Ob jects provides for con

and Lolli satisfy such a result

currency but lacks abstraction mechanisms In this

When extending this notion of goaldirected search

pap er we presentForum a logic programming pre

to multipleconclusion the following problem

sentation of all of linear logic that mo dularly extends

is encountered if the righthand side of a sequent con

the languages Prolog Lolli and LO Forum there

tains two or more nonatomic formulas how should

fore allows sp ecications to incorp orate b oth abstrac

the logical connectives at the head of those formu

tions and concurrency As a metalanguage Forum

las b e intro duced There seems to b e twochoices

greatly extends the expressiveness of these other logic

One choice simply requires that one of the p ossible in

programming languages To illustrate its expressive

tro ductions b e done This has the disadvantage

strength we sp ecify in Forum a sequent calculus pro of

that there mightbeaninterdep endency b etween right

system and the op erational semantics of a functional

intro duction rules in that one may need to app ear

programming language that incorp orates suchnon

lower in a pro of than another in which case logical

functional features as counters and references

connectives in the goal would not b e reected directly

and simply into the structure of the pro of A second

choice requires that all righthand rules should b e in

tro duced simultaneously Although the sequent calcu

Intro duction

lus cannot deal directly with simultaneous rule appli

cation reference to permutabilities of rules

In a pro of theoretic foundation for logic pro

can indirectly address simultaneity That is we

gramming was prop osed in which logic programs are

can require that if two or more rightintro duction rules

collections of formulas used to sp ecify the meaning

can b e used to deriveagiven sequent then all p ossible

of nonlogical constants and computation is identied

orders of applying those rightintro duction rules can

with goaldirecte d search for pro ofs Using the sequent

in fact b e done and the resulting pro ofs are all equal

calculus this can b e formalized byhaving the sequent

mo dulo p ermutations of rightintro duction rules

G denote the state of an idealized logic pro

gramming interpreter where the current of non Using this second approach we generalize the pre

logical constants the signature is the current logic vious denition of uniform pro of as follows a cutfree

program is the set of formulas and the formula to sequent proofisuniform if for every subpro of of

b e established called the query or goal is G All and for every non o ccurrence B in

the nonlogical constants in G and the formulas in the righthand side of the endsequentof there is

are contained in A goaldirected or uniform pro of a pro of that is equal to uptoapermutation of

is then a cutfree pro of in whichevery o ccurrence of inference rules and is such that the last inference rule

contain o ccurrences of in intro duces the toplevel logical connectiveofB Similar to the Horn

It is shown in that the calculus can b e seen clause case o ccurrences of and are restricted so

as a particular logic program in this sense that they do not o ccur to the left of an implication

The reason that Lolli do es not include LO is the

In this pap er we employ the logical connectives of

and in the latter This suggests the presence of

Girard typ eset as in that pap er and the quanti

following denition for Forum it is the linear logic

cation and term structures of Churchs Simple Theory

theory of the formulas freely generated from

of Typ es A signature is a nite set of pairs writ

and It is this denition that we study in

ten c where c is a token and is a simple typ e

the rest of this pap er

over some xed set of base typ es A closed simply

Since the logics underlying Prolog Prolog Lolli

typ ed term t isaterm if all the nonlogical con

LO and F orum dier in what logical connectives are

stants in t are declared typ es in The base typ e

allowed at what p olarityricher languages mo dularly

o is used to denote formulas and the various logical

contain weaker languages This is a direct result of

constants are given typ es over oFor example the bi

the cutelimination for linear logic Thus a

nary logical connectives have the typ e o o o and

Forum program that do es not happ en to use

the quantiers have the typ e o oA

and will in fact have the same uniform pro ofs

term B of typ e o is also called a formula The inx

as are describ ed for Prolog Similarly a program

denotes intuitionistic implication that is

containing just a few o ccurrences of these connectives

B C is equivalenttoB C and the inx symbol

can b e understo o d as a Prolog program that takes

which asso ciates to the left denotes the

a few exceptional steps but otherwise b ehaves as a

of The expression B C abbreviates the formula

Prolog program

B C C B if this formulas is provable in

Forum is a presentation of all of linear logic since

linear logic wesaythatB and C are logical ly equiva

it contains a complete set of connectives The connec

lent

tives missing from Forum are directly denable using

All of linear logic can b e seen as a logic program

the following logical equivalences

ming language since there is a presentation of linear



logic for which uniform pro ofs are complete Tomo

B B

tivate the design of this presentation whichwe call

B B B B

     

Forumwe rst describ e the four logic programming

B C B C B C B C

 

languages that it extends Horn clauses the logi

xB xB

cal foundation of Prolog are formulas of the form

ve men The other logic programming languages weha

xG A where G may contain o ccurrences of

tioned can of course capture the expressiveness of

and We shall usex as a syntactic variable ranging

full logic byintro ducing nonlogical constants and pro

over a list of variables and A as a syntactic variables

grams to describ e their meaning Feltyin uses a

ranging over atomic formulas In such clauses o c

metalogical presentation to sp ecify full logic at the

currences of and are restricted so that they do

ob jectlevel Andreoli provides a compilation

not o ccur to the left of an implication As a result of

like translation of linear logic into LinLog of which

this restriction uniform pro ofs involving Horn clauses

LO is a Forum has a more immediate relation

do not contain rightintro duction rules for and

ship to all of linear logic since no nonlogical symb ols

Hereditary Harrop formulas the logical founda

need to b e used to provide complete coverage of linear

tion of Prolog result from removing the restriction

logic

on and in Horn clauses that is suchformulas

As a presentation of linear logic Forum may app ear can b e built freely from and The logic

rather strange since it uses neither the cut rule uni at the foundation of Lolli is the result of adding

form pro ofs are cutfree nor the dualities that follow to the connectives present in hereditary Harrop for

from uses of since negation is not a primi mulas that is Lolli programs are freely built from

tive The execution of a Forum program in the logic and Some presentations of hereditary

programming sense of the search for a pro of makes Harrop formulas and Lolli allow certain o ccurrences of

no use of cut or of the basic dualities These asp ects disjunctions and existential quantiers since such

of linear logic however are imp ortant in metalevel o ccurrences can b e dened within the logic program

ab out sp ecications written in Forum For ming setting as we shall see they are not considered

example a sp ecication of a sequent calculus pro of directly here The formulas used in LO are of the

A where n and G may system for can b e transformed into A form xG

n

a pro of system by a use of linear shall use to denote provability in linear logic In

logics negation see Section The choice of primi particular means that the sequent

tives for this presentation makes it easy to keep close has a pro of in linear logic the no

to the usual computational signicance of backchain tation means that the sequent

ing and the presence of the two implications and has a pro of and the notation means that the

makes the sp ecication of ob jectlevel inference sequent hasaproof

rules natural

Theorem Let be a signature and let G bea

formula of linear logic al l of whose logical connectives

g Then G if areinthesetf

Pro of Search

G is provable in the and only if the sequent

proof system in Figure

Inference rules in cutfree pro ofs over formulas con

taining only the logical constants

Pro of follows quickly from the enco ding

and havenumerous opp ortunities to b e p ermuted

describ ed ab ove of the two sequents used in Figure

over each other In particular anytwo o ccurrences

into linear logic sequents Completeness follows by

of rightrules p ermute over each other anytwooc

showing that any cutfree pro of in linear logic over Fo

currences of leftrules p ermute over each other and

rums connectives can b e transformed via p ermutation

any left rule o ccurring immediately b elow a rightrule

of inference rules into a pro of that corresp onds directly

can b e p ermuted up These observations ab out p er

to pro ofs built using the rules in Figure Similar style

mutabilities can b e integrated into a sp ecial pro of

completeness pro ofs can b e found in

system given in Figure Here twostyles of se

The completeness result could also b e proved us

quents are considered These sequents are written as

ing a result of Andreoli ab out fo cusing pro ofs An

B

and where is a

dreoli considered onesided sequents and classied all

signature is a set of formulas is a multiset

the logical connectives of linear logic as b eing either

of formulas is a list of formulas and B is a

asynchronous or synchronous In our setting an o c

formula The in tended meanings of these twosequents

currence of a connective on the right of a sequent ar

in linear logic are and B re

rowisasynchronous and on the left is synchronous

sp ectively Here denotes the multiset that results

As is shown in asynchronous connectives can b e

from placing on each of the formulas in the set

intro duced in any order without reference to context

In the pro of system of Figure the only rightrules

and with no need to backtrack Here this corre

are those for sequents of the form

sp onds to the fact that the righthand side of a se

In fact the only formula in that can b e intro duced

quent can b e decomp osed until there are only atomic

is the leftmost nonatomic formula in This style

formulas remaining on the rightwe are of course

of selection is sp ecied by using the syntactic variable

reading pro of rules b ottomup Also since the or

A to denote a p ossibly empty list of atomic formu

der of decomp osition is not imp ortant formulas on

las Thus the righthand side of a sequent matches

the right can pro ceed in a lefttoright fashion Syn

AB C ifitcontains a formulas that is a toplevel

chronous connectives can b e intro duced after all asyn

for which only atomic formulas o ccur to its left

chronous connectives have b een intro duced and syn

Both A and may b e empty Left rules are applied

chronous subformulas of synchronous formulas can b e

only to the formula B that lab els the sequent arrow

pro cess immediately that is when pro cessing a syn

B

chronous formula we can fo cus the pro cessing on in A The notation A A matches a



its immediate synchronous subformulas Pro cessing list A if A and A are lists that can b e interleaved



of synchronous formulas can in general require back to yield A that is the order of members in A and

tracking It has b een known that backchaining is a A is as in A and ignoring the order of elements A



fo cused event for example Pfenning has describ ed

denotes the multiset set union of the multisets repre

backchaining as immediate implication Andreolis sented by A and A



results nicely formalizes and generalizes this observa

Notice that all the rightrules treat the context

tion The pro of system in Figure was motivated in and Aasblackboxes they either discard the

large part by a pro of system in context R copy it R or retain it all other

An analogy exists b etween the emb edding of all of rightrules

linear logic into F orum and the emb edding of classical The following theorem yields as an immediate corol

logic into intuitionistic logic via the double negation lary that Forum is a logic programming language We

AB AC

R R

A AB C

A ABC

R R

A AB C

B AC B AC

R R

AB C AB C

B B

A B A y AByx

R decide decide

A xB B A B A

B C

A A

initial L L L

A  B C B C

A A A

 B tx

B C

A A A t is a term of typ e

 

L L

 xB

C B

A

A A

 

C C

B A B A A

 

L L

B  C B C

A A A

 

Figure The rule R has the proviso that y is not declared in the signature

in Forum are logically equivalent to formulas of the translation In contraction and weak

form C C n where each C is of the ening can b e used on b oth the left and rightofthe

n i

form sequent arrow in intuitionistic logic they can only

b e used on the left The familiar double negation

yG G A A m p

m p

translation of classical logic into intuitionistic logic



makes it p ossible for the formula B on the right

Here o ccurrences of are either o ccurrences of



to b e moved to the left as B where contractions

or An empty is written as and an empty

and weakening can b e applied to it and then moved

is written as Formulas of this form will b e called

back to the rightas B Inthisway classical reasoning

clausesGiven that the formulas in the p ortion of

can b e regained indirectly Similarly in linear logic

the sequents in Figure are implicitly ed and given

when there are for example nonp ermutable right

the linear logic equivalence A B A B we

rules one of the logical connectives involved can b e

can further assume that all formulas in are clauses

rewritten so that the nonp ermutability is transfer to

Certain o ccurrences of logical connectives that are

one b etween a left rule ab ovearightruletheonly

not primitivetoForum can b e removed from clauses

kind of nonp ermutabilityinForum pro ofs For ex

using the following linear logic equivalences

ample the b ottomup construction of a pro of of the

 



b must rst intro duce the sequent a b a

A B C A B C A B A B

prior to the the context splitting required by

A B C A C B C

is intro duced If must b e delayed until after the

xAx B xAx B

this sequent is translated into Forum wewould have

A B A B B B

   

the sequent a b In this case b a

These equivalences can b e used at times to avoid us

and can b e intro duced in any order giving rise

ing the indirect equivalences mentioned earlier that

   

to the sequent a b a b Intro ducing the

y negation emplo

now causes the context to b e split but this o ccurs

We shall not discuss here practical considerations

Thus the enco ding after the rightintro duction of

of how search for pro ofs using the inference rules in

of some of the linear logic connectives into the set used

Figure can b e done except to note a problem in us

byForum essentially amounts to moving any oend

ing clauses with an empty head a head that is

ing nonp ermutabilities to where they are allowed

For example consider attempting to prove a sequent

Using various linear logic equivalences all formulas with righthand side A and with the clause xG

on the lefthand side This clause can b e used in a

right B left A right A B

backchaining step regardless of As structure yield

A B right A left B left

ing the new righthand side G A for some substi

right A B right A right B

tution over the variablesx Such a clause provides

left A B left A

no overt clues as to when it can b e eectively used to

left A B left B

prove a given goal See for a discussion of a simi

right B C right B

lar problem when negated clauses are allowed in logic

right B C right C

programming based on minimal or intuitionistic logic

left B C right E left B right E

As we shall see b elow the sp ecication of the cut rule

right E left C

for an ob jectlevel logic employs just such a clause the

right B left B

well known problems of searching for pro ofs involving

left B right B

cut thus apply equally well to the search for uniform

pro ofs involving such clauses

Figure Sp ecication of LJ sequent calculus

Sp ecifying ob jectlevel provability

ere dropp ed it would b e p ossi the heads of clauses w

bletoprove metalevel goals that do not corresp ond

Given the pro oftheoretic motivations of Forum and

to any LJ sequent such goals could contain leftatoms

its inclusion of quantication at higherorder typ es it

that are not prexed with the mo dal Of course

is not surprising that it can b e used to sp ecify pro of

the actual Forum clauses result from replacing byits

systems for various ob jectlevel logics Belowweil

denition this example and some others suggest that

lustrate how a sequent calculus pro of system can b e

there are advantages to allowing as an additional

sp ecied and showhow prop erties of linear logic can

primitive

b e used to infer prop erties of the ob jectlevel pro of

Notice that with the leftintro duction of the for

systems

mula on the righthere E must b e copied since such

Provabilityinintuitionistic logic has well known

formulas are not under a mo dal the inference rule

presentations using sequent calculus and natural de

must explicitly copy the righthand formula This is

duction b oth of whichwere given by Gen tzen in

done by synchronizing with a multipleconclusion

as pro of systems LJ and NJ resp ectively The LJ se

clause b oth the disjunction that is b eing intro duced

quent B B B n can b e represented

n 

and the righthand formula and then explicitly copy

by the metalevel formula

ing the righthand formula within the rule hence the

two copies of right E on the rightside of that clause

left B left B right B

n 

The p enultimate clause in Figure sp ecies the ini

tial sequent rule while the nal clause sp ecies the cut

where left and right are two metalevel predicates To

rule The well known problems of searching for pro ofs

capture ob jectlevel contraction and weakening on the

containing cut rules are transferred to the metalevel

lefthand side we employ the mo dal Since no struc

as problems of using a clause with for a head within

tural rules are available on the righthand side of LJ

the search for cutfree pro ofs see Section

sequents no mo dal is used to enco de that formula

Let LJ b e the set of clauses displayed in Figure

Figure is a sp ecication of Gentzens LJ calculus

and let b e the set of constants of the ob jectlogic

Expressions displayed as they are in Figure are ab

along with the two predicates left and right

breviations for closed formulas the intended formulas

are those that result by applying to their universal

Prop osition Correctness of LJ The sequent

closure The op erational reading of these clauses is

B B B n has an LJ proof if and

n 

quite natural For example the rst clause in Figure

left B right B only if LJ left B

 n

enco des the rightintro duction of op erationally an

Pro of For the forward direction an LJ pro of can o ccurrence of A B on the right is removed and re

be converted in to a uniform pro of of the corresp ond placed with an o ccurrence of B on the right and a

ing metalevel formula by mapping the sequence of mo dalized o ccurrence of A on the left reading the

inference rules in the LJ pro of to the sequence of rightintro duction rule for from the b ottom Notice

clauses used in backchaining Additionally right that all o ccurrences of the left predicate in Figure

intro ductions for and and weakening contrac are in the scop e of If o ccurrences of such mo dals in

n

right A B right A right B

right B right A right A B

NJ right B right B right B

n 

right A B right A right B

A pro of of this Prop osition can b e done similar

right A right A B

to the pro of of Prop osition The discussion of the

right B right A B

derivation of the natural deduction pro of system from

right B C right B

the sequent calculus pro of system provides a pro of of

right B C right C

the following Prop osition For convenience if is a

right E right B C

nite non of formulas let denote the

right B right E

formula that is the tensor of all the formula in in

right C right E

some xed but arbitrary order

Figure Sp ecication of NJ natural deduction

Prop osition Let Eq be the tensor of the last two

formulas in Figure Then LJ NJ

Eq

tion and dereliction for will need to b e inserted in a

The following theorem rst proved by Gentzen in

straightforward fashion The converse direction is as

is an almost immediate consequence of the preced

simple the sequence of backchaining steps determines

ing prop ositions

the application of inference rules in a corresp onding LJ

pro of In the pro cess of establishing this corresp on

Theorem The sequent B B B has an

n 

dence it is imp ortant to observehow o ccurrences of

LJ proof if and only if B hasanNJproof from the



atoms with the predicate right app ear within uniform

assumptions B B n

n

pro ofs a simple induction on uniform pro ofs shows

that if a multipleconclusion goal is provable from LJ

Pro of If B has an NJ pro of from the assumptions



that goal contains exactly one o ccurrence of right

B B thenby Prop osition

n

So far wehave only discussed the op erational in

terpretation of the sp ecication in Figure It is de

NJ right B right B right B

n 

lightful however to note that this sp ecication has

Using Prop osition and cut wehave

some metalogical prop erties that go b eyond its op

erational reading In particular the sp ecications

LJ right B right B right B

n 

for the initial and cut inference rules together are



logically equivalent to the prop osition right B

Since Eq follows from LJ and since Eq implies

left B This equivalence implies the equivalence



the equivalences Bright B left B and

right B right B That is wehave the not to o

Bright B right B additional uses of cut at

surprising fact that left and right are essentially du

the metalevel yield a pro of of LJ left B

als and that this is guaranteed by reference only to

right B left B Thus by Prop osition it

 n

the sp ecications for the initial and cut rules If we

follows that the sequent B B B has an LJ

n 

replace some o ccurrences of left B in Figure with

pro of

right B and replace other o ccurrences with the equiva

For the converse assume that B B B

n 

lentright B and rewrite the resulting clauses using

has an LJ pro of Thus

linear logic equivalences we get the clauses in Fig

ure Since the results of rewriting the last two clauses

right B left B LJ left B

 n

of in Figure are linear tautologies they are dropp ed

Figure contains a sp ecication of Gentzens natural

and using cut and Prop osition wehave

deduction system NJ This sp ecication is similar to

those given using intuitionistic metalogics and

right B left B NJ Eq left B

 n

dep endenttyp ed calculi Let NJ b e the set of

clauses displayed in Figure

and NJ Eq right B right B right B

n 

The additional assumption of Eq stops us from using

Prop osition immediately It is straightforward to

Prop osition Correctness of NJ The formula show however that any uniform pro of that uses this

B has an NJ proof from the assumptions B B additional assumption can b e converted to a uniform

 n

pro of that do es not use that assumption As as result



E r r

we can conclude that

rV rV K K V eval read VK

K V eval inc VK rV K r V

NJ right B right B right B

n 



E r r

and by Prop osition that B has an NJ pro of from





rV K rV K V eval read V K the assumptions B B

n

rV K K V eval inc V K r V

Most logical or typ etheoretic systems that have

b een used for metalevel sp ecications of pro of sys

E r r



tems have b een based on intuitionistic principles for

K V eval read VK rV rV K

example Prolog Isab elle LF Although these sys

K V eval inc VK rV r V K

tems have b een successful at sp ecifying numerous log

ical systems they have imp ortant limitations For ex

Figure Three sp ecications of a global counter

ample while they can often provide elegantspeci

cations of natural deduction pro of systems sp ecica

tions of sequent calculus pro ofs are often unachievable

the ab ove clause A familiarwa y to represent these

without the addition of various nonlogical constants

inference rules in metalogic is to enco de them as the

for the sequent arrow and for forming lists of formulas

following two clauses using the predicate eval of typ e

see for example Furthermore these systems of

tm tm o see for example

ten have problems capturing substructural logics such

as linear logic that do not contain the usual comple

eval app MN V eval M abs R

ment of structural rules It should b e clear from the

eval NU eval RU V

ab ove example that Forum allows for b oth the natural

eval abs Rabs R

sp ecication of sequent calculus and the p ossibilityof

In order to add sideeecting features this sp ecica

handling substructural ob jectlogics

tion must b e made more explicit in particular the

exact order in which M N and RU are evaluated

must b e sp ecied Using a continuationpassing

Op erational Semantics Examples

technique from logic programming this order

ing can b e made more explicit using the following

Evaluation of pure functional programs has b een

two clauses this time using the predicate eval at typ e

successfully sp ecied in intuitionistic metalogics

tm tm o o

and typ e theories using structured op erational

VK eval app MN

semantics and natural semantics These sp ecication

eval M abs Reval NU eval RU VK

systems are less successful at providing natural sp eci

eval abs Rabs R K K

cations of languages that incorp orate references con

trol op erators and concurrencyWenow consider how

From these clauses the goal eval MV isprov

evaluation incorp orating references can b e sp ecied in

able if and only if V is the callbyvalue value of M

Forum

It is this singlethreaded sp ecication of evaluation

Consider the presentation of callbyvalue evalua

that we shall mo dularly extend with a couple of non

tion given by the following inference rules in natural

functional features

semantics style

Consider adding to this sp ecication a single global

counter that can b e read and incremented To sp ecify

M abs R N U RU V

suchacounter weaddtheintegers to typ e tm sev

app MN V

eral simple functions over the integers and the two

symbols read and inc of typ e tm The intended mean

abs R abs R

ing of these constants is that evaluating the rst re

turns the currentvalue of the counter and evaluating Here we assume that there is a typ e tm representing

the second increments the counters value and returns the domain of ob jectlevel untyp ed terms and that

the counters old value W e also assume that inte app and abs denote application at typ e tm tm

gers are values that is for every integer i the clause tm and abstraction at typ e tm tm tm

k eval iik k ispartoftheevaluators sp ecica Ob jectlevel substitution is achieved at the metalevel

tion by reduction of the metalevel application RUin

Figure contains three sp ecications E E and variable to instantiate the existential quantier on the



E of suchacounter all three sp ecications store the lefthand sp ecication and then by instantiating the



counters value in a atomic formula as the righthand existential quantier with some term in

of the predicate r In these three sp ecications the volving that eigenvariable Assume that in all three

predicate r is existentially quantied over the sp eci cases the eigenvariable selected is the predicate sys

cation in which it is used so that the atomic formula tem s The the rst entailmentisproved by instanti

that stores the counters value is itself lo cal to the ating the righthand existential with xs x the

counters sp ecication such existential quantication tailmentisproved using the substitution second en



of predicates is a familiar technique for implement xs x and the third entailment is proved us



ing abstract data typ es in logic programming ing the substitution xsx The pro of of the rst

The rst two sp ecications store the counters value twoentailments must also use the equations

on the right of the sequent arrow and reading and

f x x x x g

incrementing a counter o ccur via a synchronization

between evaluation and the atom storing the counter

The pro of of the third entailment requires no such

In the third sp ecication the counter is stored as a

equations

linear assumption on the left of the sequentarrow

Clearly logical equivalence is a strong equivalence

and synchronization is not used instead the linear

it immediately implies that evaluation cannot tell the

assumption is destructively read and then rewritten

dierence b etween any of these dierent sp ecica

in order to sp ecify the read and inc functions coun

tions of a counter For example assume E



ters such as these are describ ed in Finallyin

eval MV Thenby cut and the ab ove prop osition

the rst and third sp ecications evaluating the inc

we immediately have E eval MV

 

symb ol causes to b e added to the counters value

It is p ossible to sp ecify a more general notion of ref

In the second sp ecication evaluation the inc symbol

erences from which a counter such as that describ ed

causes to b e subtracted from the counters value to

ab ove can b e built Consider the sp ecication in Fig

comp ensate for this unusual choice reading a counter

ure Here the typ e lo c is intro duced to denote the lo

in the second sp ecication returns the minus of the

cation of references and three constructors have b een

current counters value

added to the ob jectlevel calculus to manipulate ref

The use of and negation in Figure all of

erences one for reading a reference read one for set

which are not primitive connectives of Forum is for

ting a reference set and one for intro ducing a new

convenience in displaying these abstract data typ es

reference within a particular lexical scop e new For

The equivalence

example let m and n b e expressions of typ e tm that



r R R R R G r R R G

do not contain free o ccurrences of r and let F b e the

   

expression

directly converts a use of such a sp ecication into a

formula of Forum given conversion wemay assume

new r set r app m r ead r n

that r is not free in G

Although these three sp ecications of a global

This expression represents the program that rst eval

counter are dierent they should b e equivalentin

uates n then allo cates a new scop ed reference cell

the sense that evaluation cannot tell them apart Al

which is initialized with ns value then overwrites this

though there are several ways that the equivalence of

new reference cell with the result of applying m to the

such counters can b e proved for example op erational

value currently stored in that cell Since m do es not

equivalence the sp ecications of these counters are

contain a reference to r it should b e the case that

in fact logical ly equivalent

this expression has the same op erational b ehavior as

the expression F dened as



Prop osition Let be the signaturecontaining



eval along with the constants of the objectlevel pro

app abs xapp m x n

gramming language namely app abs inc readthe

integers and the various integer operations We then

Belowwe illustrate the use of metalevel prop erties of

have the fol lowing three entailments

linear logic to prove the fact that F and F havethe



same op erational b ehaviors

E E E E and E E

      

Let Ev b e the set of formulas from Figure plus the

twoformulas displayed ab ovefortheevaluation of app Pro of The pro of of each of these entailments pro

and abs and let b e the set of constants o ccurring in ceeds in a b ottomup fashion bycho osing an eigen



read lo c tm

that is this expression can b e evaluated in an y store

set lo c tm tm

without changing it Because of their quantication

new lo c tm tm tm

garbaged stores are inexcessible op erationally but

assign lo c tm o o

not logically href h can b e considered the same

ref lo c tm o

as in a manner similar to the identication of xxy

with the null pro cess in the calculus

eval set LN VK eval NV assign LV K

We can now return to the problem of establishing

eval new RE VK

how the programs F and F are related They b oth



eval EU href hU eval Rh VK

contain the program phrases m and nsowe rst as

eval read L VK ref LV ref LV K

sume that if n is evaluated in store S it yields value



ref LV assign LV K ref LU K

v and mutates the store into S leaving the garbaged

store G Similarly assume that if m is evaluated in

Figure Sp ecication of references

store S it yields value abs uandmutates the store

into S with garbaged store G That is assume the

 

formulas

and in Ev An ob jectlevel program mayhave b oth



avalue and the sideeect of changing a store Let S

G eval nv k S and S k k



b e a syntactic variable for a store that is a formula

k k S S G eval m abs u k

 

of the form ref h u ref h u n

n n

where all the constants h h are distinct Of

n

From these formulas and those in Ev we can infer that

course we can think of a store as a nite function that

G S G W k eval uv Wk href hv

maps lo cations to values stored in those lo cations The

 

eval F Wk S and

domain of a store is the set of lo cations it assigns in



S G G W k eval uv Wk

h gA the ab ove case the domain of S is fh

 

n

S eval F Wk

garbaged state is a formula of the form hS where

 

S is a state and h is the universal quantication of

That is if the expression uv has value W in store S



all the variables in the domain of S Consider for

then b oth expressions F and F yield value W in store



example the program expression F given as



S Clearly at the metalevelcanbeusedto

new r read r

comp ose the meaning of dierent program fragments

into the meaning of larger fragments Hop efullysuch

This program has the value and the sideeect of

a comp ositional approach to program meaning can b e

leaving b ehind a garbaged store More preciselythe

used to aid the analysis of programs using references

evaluation of a program M in a store S yields a value V

and new store S and garbaged store G if the formula

G eval MV k S k k S

Conclusions

is provable from the clauses in Ev and the signa

Wehavegiven a presentation of linear logic whose

ture extended with the domain of S Animme



pro of theory mo dularly extends the pro of theory of

diate consequence of this forumula is that the formula

several known logic programming languages The re

S is provable that is the value of M eval MV

sulting sp ecication language named Forum provides

is V if the store is initially S The references sp eci

the abstract and higherorder judgments avail

ed here ob ey a blo ck structured discipline that is

able in intuitionisticbased metalogics as well as prim

the domains of S and S are the same and anynew

itives for synchronization and communications We

references that are created in the evaluation of M are

have sp ecify directly various tasks in pro of theory and

collected in the garbaged store GFor example a con

the op erational semantics of programming languages

sequence of the formulas in Ev is the formula

Since the resulting sp ecications are natural and sim

href h eval F k k k

ple prop erties of the metalogic can b e meaningful



employed to provide interesting prop erties ab out the

That is evaluating expression F yields the value



sp ecied ob jectlanguages

and the garbaged store h ref h An immediate

consequence of this formula is the formula

Acknowledgements I b eneted greatly from dis

S href h S eval F k k k cussions with Jawahar Chirimar and Bob Harp er and



from comments of the conference reviewers and Eva S C Kleene Permutabilities of in

Ma The author has b een funded in part byONR Gentzens calculi LK and LJ Memoirs of the

N NSF CCR NSF CCR American Mathematical Society

and DARPA NK

D Miller Lexical scoping as universal quanti

cation In Sixth International Logic Programming

Conference pp Lisb on Portugal June

References

MIT Press

JM Andreoli Logic programming with fo cusing

D Miller A logical analysis of mo dules in logic

pro ofs in linear logic J of Logic and Computa

programming J of Logic Programming

tion

JM Andreoli and R Pareschi Linear ob jects

D Miller The calculus as a theory in linear

Logical pro cesses with builtin inheritance New

logic Preliminary results In E Lamma and

Generation Computing

P Mello editors Proc of the Workshop

on Extensions to Logic Programming Springer

A Avron F Honsell I A Mason and R Pol

erlag LNCS pp V

lack Using typ ed lamb da calculus to implement

formal systems on a machine J of Automated

D Miller G Nadathur F Pfenning and A Sce

Reasoning

drov Uniform pro ofs as a foundation for logic

programming Annals of Pure and AppliedLogic

R Burstall and F Honsell A natural deduc

tion treatment of op erational semantics In Foun

dations of SoftwareTechnology and Theoretical

R Milner J Parrow and D Walker A calcu

Computer Science pp SpringerVerlag

lus of mobile pro cesses Part I Information and

LNCS

Computation pp Septemb er

A Church A formulation of the simple theory of

L C Paulson The foundation of a generic the

typ es J of Symbolic Logic

orem prover J of AutomatedReasoning

Septemb er

A Felty Implementing tactics and tacticals in a

higherorder logic programming language J of

F Pfenning Elf A language for logic denition

AutomatedReasoning

and veried metaprogramming In LICS

pp MontereyCA

G Gentzen Investigations into logical deduc

tions In M E Szab o editor The Col lected

PTarau Program transformations and WAM

Papers of pp North

supp ort for the compilation of denite metapro

Holland Publishing Co Amsterdam

grams In Logic Programming Proc of the First

and Second Russian Conferences on Logic Pro

JeanYves Girard Linear logic Theoretical Com

gramming SpringerVerlag LNAI pp

puter Science

J Hannan Extended natural semantics J of

Functional Programming

Pap ers by Miller are available via anonymous ftp from

ftpcisupennedu in pubpapersmiller or using

J Harland and D Pym On Goaldirected Prov

WWW at httpwwwcisupennedudale

ability in Classical Logic Technical rep ort

Dept of Computer Science Univ of Melb ourne

R Harp er F Honsell and G Plotkin A frame

work for dening logics J of the ACM

J Ho das and D Miller Logic programming in a

fragmentofintuitionistic linear logic J of Infor

mation and Computation To app ear