Compositional Semantics for Linguistic Formalisms 
Shuly Wintner* 
Institute for Research in Cognitive Science 
University of Pennsylvania 
3401 Walnut St., Suite 400A 
Philadelphia, PA 19018 
shuly@:t±nc, cis. upenn, edu 
Abstract 
In what sense is a grammar the union of its 
rules? This paper adapts the notion of com- 
position, well developed in the context of pro- 
gramming languages, to the domain of linguis- 
tic formalisms. We study alternative definitions 
for the semantics of such formalisms, suggest- 
ing a denotational semantics that we show to 
be compositional and fully-abstract. This fa- 
cilitates a clear, mathematically sound way for 
defining grammar modularity. 
1 Introduction 
Developing large scale grammars for natural 
languages is a complicated task, and the prob- 
lems grammar engineers face when designing 
broad-coverage grammars are reminiscent of 
those tackled by software engineering (Erbach 
and Uszkoreit, 1990). Viewing contemporary 
linguistic formalisms as very high level declara- 
tive programming languages, a grammar for a 
natural language can be viewed as a program. 
It is therefore possible to adapt methods and 
techniques of software engineering to the do- 
main of natural language formalisms. We be- 
lieve that any advances in grammar engineering 
must be preceded by a more theoretical work, 
concentrating on the semantics of grammars. 
This view reflects the situation in logic program- 
ming, where developments in alternative defini- 
tions for predicate logic semantics led to im- 
plementations of various program composition 
operators (Bugliesi et al., 1994). 
This paper suggests a denotational seman- 
tics tbr unification-based linguistic formalisms 
and shows that it is compositional and fully- 
*I am grateful to Nissim Francez for commenting on an 
em'lier version of this paper. This work was supported 
by an IRCS Fellowship and NSF grant SBR 8920230. 
abstract. This facilitates a clear, mathemati- 
cally sound way for defining grammar modu- 
larity. While most of the results we report on 
are probably not surprising, we believe that it 
is important to derive them directly for linguis- 
tic formalisms for two reasons. First, practi- 
tioners of linguistic formMisms usually do not 
view them as instances of a general logic pro- 
gramming framework, but rather as first-class 
programming environments which deserve in- 
dependent study. Second, there are some cru- 
cial differences between contemporary linguis- 
tic formalisms and, say, Prolog: the basic ele- 
ments -- typed feature-structures -- are more 
general than first-order terms, the notion of uni- 
fication is different, and computations amount 
to parsing, rather than SLD-resolution. The 
fact that we can derive similar results in this 
new domain is encouraging, and should not be 
considered trivial. 
Analogously to logic programming languages, 
the denotation of grammars can be defined us- 
ing various techniques. We review alternative 
approaches, operational and denotational, to 
the semantics of linguistic formalisms in sec- 
tion 2 and show that they are "too crude" 
to support grammar composition. Section 3 
presents an alternative semantics, shown to be 
compositional (with respect to grammar union, 
a simple syntactic combination operation on 
grammars). However, this definition is "too 
fine": in section 4 we present an adequate, 
compositional and fully-abstract semantics for 
linguistic formalisms. For lack of space, some 
proofs are omitted; an extended version is avail- 
able as a technical report (Wintner, 1999). 
2 Grammar semantics 
Viewing grammars as formal entities that share 
many features with computer programs, it is 
9{} 
natural to consider the notion of semantics of 
ratification-based formalisms. We review in this 
se(:tion the operational definition of Shieber et 
a,1. (1995) and the denotational definition of, 
e.g., Pereira and Shieber (1984) or Carpenter 
(1992, pp. 204-206). We show that these def- 
initions are equivalent and that none of them 
supports compositionality. 
2.1 Basic notions 
W(, assume familiarity with theories of feature 
structure based unification grammars, as for- 
mulated by, e.g., Carpenter (1992) or Shieber 
(1992). Grammars are defined over typed fea- 
twre .structures (TFSs) which can be viewed as 
generalizations of first-order terms (Carpenter, 
1991). TFSs are partially ordered by subsump- 
tion, with ± the least (or most general) TFS. A 
multi-rooted structure (MRS, see Sikkel (1997) 
()r Wintner and Francez (1999)) is a sequence 
of TFSs, with possible reentrancies among dif- 
fi;rent elements in the sequence. Meta-variables 
A,/3 range over TFSs and a, p - over MRSs. 
MRSs are partially ordered by subsumption, de- 
n()ted '__', with a least upper bound operation 
()f 'an'llfication, denoted 'U', and a greatest lowest 
t)(mnd denoted 'W. We assume the existence of 
a. fixed, finite set WORDS of words. A lexicon 
associates with every word a set of TFSs, its cat- 
egory. Meta-variable a ranges over WORDS and 
.w -- over strings of words (elements of WORDS*). 
Grammars are defined over a signature of types 
and features, assumed to be fixed below. 
Definition 1. A rule is an MRS of length 
greater than or equal to 1 with a designated 
(fir'st) element, the head o.f the rule. The rest of 
the elements .form the rule's body (which may 
be em, pty, in which case the rule is depicted 
a.s' a TFS). A lexicon is a total .function .from 
WORDS to .finite, possibly empty sets o.f TFSs. 
A grammar G = (T¢,/:, A s} is a .finite set of 
,rules TO, a lexicon £. and a start symbol A s 
that is a TFS. 
Figure 1 depicts an example grammar, 1 sup- 
pressing the underlying type hierarchy. 2 
The definition of unification is lifted to MRSs: 
let a,p be two MRSs of the same length; the 
'Grammars are displayed using a simple description 
language, where ':' denotes feature values. 
2Assmne that in all the example grammars, the types 
s, n, v and vp are maximal and (pairwise) inconsistent. 
A '~ = (~:at : .~) 
{ (cat:s) -+ (co, t:n) (cat:vp) \] 
7~ = (cat: vp) ---> (c.at: v) (cat: n) 
vp) + .,,) 
Z2(John) = Z~(Mary) = {(cat: 'n)} 
£(sleeps) = £(sleep) = £(lovcs) = {(co, t : v)} 
Figure 1: An example grammar, G 
unification of a and p, denoted c, U p, is the 
most general MRS that is subsmned by both er 
and p, if it exists. Otherwise, the unification 
.fails. 
Definition 2. An MRS (AI,...,A~:) reduces 
to a TFS A with respect to a gram, mar G (de- 
noted (At,...,Ak) ~(-~ A) 'li~' th, ere exists a 
rule p E T~ such, that (B,131,...,B~:) = p ll 
(_L, A1,..., Ak) and B V- A. Wll, en G is under- 
stood from. the context it is om, itted. Reduction 
can be viewed as the bottom-up counterpart of 
derivation. 
If f, g, are flmctions over the same (set) do- 
main, .f + g is )~I..f(I) U .q(I). Let ITEMS = 
{\[w,i,A,j\] \[ w E WORDS*, A is a TFS and 
i,j E {0,1,2,3,...}}. Let Z = 2 ITEMS. Meta- 
variables x, y range over items and I - over sets 
of items. When 27 is ordered by set inclusion 
it forms a complete lattice with set union as a 
least upper bound (lub) operation. A flmction 
T : 27 -+ 27 is monotone if whenever 11 C_/2, also 
T(I1) C_ T(I2). It is continuous iftbr every chain 
I1 C_ /2 C_ ..., T(Uj< ~/.i) = Uj<~T(Ij) . If a 
function T is monotone it has a least fixpoint 
(Tarski-Knaster theorem); if T is also continu- 
ous, the fixpoint can be obtained by iterative 
application of T to the empty set (Kleene the- 
orem): lfp(T) = TSw, where TI" 0 = 0 and 
T t n = T(T t (n- 1)) when 'n is a succes- 
sor ordinal and (_Jk<n(T i" n) when n is a limit 
ordinal. 
When the semantics of programming lan- 
guages are concerned, a notion of observables 
is called for: Ob is a flmction associating a set 
of objects, the observables, with every program. 
The choice of semantics induces a natural equiv- 
alence operator on grammars: given a semantics 
'H', G1 ~ G2 iff ~GI~ = ~G2~. An essential re- 
quirement of any semantic equivalence is that it 
97' 
be correct (observables-preserving): if G1 -G2, 
then Ob(G1) = Ob(G2). 
Let 'U' be a composition operation on gram- 
mars and '•' a combination operator on deno- 
rations. A (correct) semantics 'H' is compo- 
.s'itional (Gaifinan and Shapiro, 1989) if when- 
ever ~1~ : ~G2~ and ~G3\] -- ~G4\], also 
~G, U G3~ = \[G2 U G4\]. A semantics is com- 
mutative (Brogi et al., 1992) if ~G1 UG2\] = 
~G,~ • \[G2~. This is a stronger notion than 
(:ompositionality: if a semantics is commutative 
with respect to some operator then it is compo- 
sitional. 
2.2 An operational semantics 
As Van Emden and Kowalski (1976) note, "to 
define an operational semantics for a program- 
ruing language is to define an implementational 
independent interpreter for it. For predicate 
logic the proof procedure behaves as such an in- 
terpreter." Shieber et al. (1995) view parsing as 
a. deductive process that proves claims about the 
grammatical status of strings from assumptions 
derived from the grammar. We follow their in- 
sight and notation and list a deductive system 
for parsing unification-based grammars. 
Definition 3. The deductive parsing system 
associated with a grammar G = (7~,F.,AS} is 
defined over ITEMS and is characterized by: 
Axioms: \[a, i, A, i + 1\] i.f B E Z.(a) and B K A; 
\[e, i, A, i\] if B is an e-rule in T~ and B K_ A 
Goals: \[w, 0, A, \[w\]\] where A ~ A s 
Inference rules: 
\[wx , i l , A1, ill,..., \[Wk, ik, Ak , Jk \] 
\[Wl " " " Wk, i, A, j\] 
if .'h = i1,+1 .for 1 <_ l < k and i = il and 
J = Jk and (A1,...,Ak) =>a A 
When an item \[w,i,A,j\] can be deduced, 
applying k times the inference rules associ- 
z~ted with a grammar G, we write F-~\[w, i, A, j\]. 
When the number of inference steps is irrele- 
vant it is omitted. Notice that the domain of 
items is infinite, and in particular that the num- 
ber of axioms is infinite. Also, notice that the 
goal is to deduce a TFS which is subsumed by 
the start symbol, and when TFSs can be cyclic, 
there can be infinitely many such TFSs (and, 
hence, goals) - see Wintner and Francez (1999). 
Definition 4. The operational denotation 
o.f a grammar G is EG~o,, = {x IF-v; :,:}. G1 -op 
G2 iy \]C1 o, =  G2Bo , 
We use the operational semantics to de- 
fine the language generated by a grammar G: 
L(G) = {(w,A} \[ \[w,O,A,l',,\[\] E \[G\]o,}. Notice 
that a language is not merely a set of strings; 
rather, each string is associated with a TFS 
through the deduction procedure. Note also 
that the start symbol A ' does not play a role 
in this definition; this is equivalent to assuming 
that the start symbol is always the most general 
TFS, _k. 
The most natural observable for a grammar 
would be its language, either as a set of strings 
or augmented by TFSs. Thus we take Ob(G) 
to be L(G) and by definition, the operational 
semantics '~.\] op' preserves observables. 
2.3 Denotational semantics 
In this section we consider denotational seman- 
tics through a fixpoint of a transformational op- 
erator associated with grammars. -This is es- 
sentially similar to the definition of Pereira and 
Shieber (1984) and Carpenter (1992, pp. 204- 
206). We then show that the denotational se- 
mantics is equivalent to the operational one. 
Associate with a grammar G an operator 
7~ that, analogously to the immediate conse- 
quence operator of logic programming, can be 
thought of as a "parsing step" operator in the 
context of grammatical formalisms. For the 
following discussion fix a particular grammar 
G = (n,E,A~). 
Definition 5. Let Tc : Z -+ Z be a trans- 
formation on sets o.f items, where .for every 
I C_ ITEMS, \[w,i,A,j\] E T(~(I) iff either 
• there exist Yl,...,yk E I such that Yl = 
\[w1,,iz,Al,jt\] .for" 1 < 1 <_ k and il+l = jz 
for 1 < l < k and il = 1 and jk = J and 
(A1,... ,Ak) ~ A and w = "w~ .. • wk; or 
• i =j andB is an e-rule in G andB K A 
and w = e; or 
• i+l =j and \[w\[ = 1 andB G 12(w) and 
BKA. 
For every grammar G, To., is monotone and 
continuous, and hence its least fixpoint exists 
and l.fp(TG) = TG $ w. Following the paradigm 
98 
of logic programming languages, define a fix- 
point semantics for unification-based grammars 
by taking the least fixpoint of the parsing step 
operator as the denotation of a grammar. 
Definition 6. The fixpoint denotation of a 
grammar G is ~G\[.fp = l.fp(Ta). G1 =--.fp G2 iff 
~ti,( T<; ~ ) = l fp(Ta~). 
The denotational definition is equivalent to 
the operational one: 
Theorem 1. For x E ITEMS, X E lfp(TG) iff 
~-(? x. 
The proof is that \[w,i,A,j\] E Ta $ n iff 
F-7;,\[w, i, A, j\], by induction on n. 
Corollary 2. The relation '=fp' is correct: 
whenever G1 =.fp G2, also Ob(G1) = Ob(a2). 
2.4 Compositionality 
While the operational and the denotational se- 
mantics defined above are standard for com- 
plete grammars, they are too coarse to serve 
as a model when the composition of grammars 
is concerned. When the denotation of a gram- 
mar is taken to be ~G\]op, important character- 
istics of the internal structure of the grammar 
are lost. To demonstrate the problem, we intro- 
duce a natural composition operator on gram- 
mars, namely union of the sets of rules (and the 
lexicons) in the composed grammars. 
Definition 7. /f GI = <T¢1, ~1, A~) and G2 = 
(7-~2,E'2,A~) are two grammars over the same 
signature, then the union of the two gram- 
mars, denoted G1 U G2, is a new grammar G = 
(T~, £, AS> such that T~ = 7~ 1 (.J 7"~2, ft. = ff~l + ff~2 
and A s = A~ rq A~. 
Figure 2 exemplifies grammar union. Observe 
that for every G, G', G O G' = G' O G. 
• Proposition 3. The equivalence relation '=op' 
is not compositional with respect to Ob, {U}. 
Proof. Consider the grammars in figure 2. 
~a:~o,, = lado. = {\["loves",/, (cat: v),i + 1\]l 
i > 0} but tbr I = {\["John loves John", i, (cat: 
s),i+3 I i >_ 0}, I C_ \[G1UG4\]op whereas 
I ~ \[G1UGa~op. Thus Ga =-op G4 but 
(Gl (2 Go) ~op (G1 tO G4), hence '~--Op' is not 
compositional with respect to Ob, {tO}. \[\] 
G1 : A s = (cat :.s) 
(co, t: s) -+ (c.,t: ,,,,) (co, t: vp) 
C(John) = {((:.t : n)} 
a2: A s = (_1_) 
(co, t: vp) -+ (co, t: v) 
(cat : vp) -+ (cat:v) (cat:n) 
/:(sleeps) =/:(loves) = {(cat: v)} 
Go: A s = (&) 
/:(loves) = {(cat: v)} 
G4: A s = (_1_) 
(cat:vp) -+ (co, t:v) (cat:n) 
C(loves) = {(cat: v)} 
G1 U G2 : A s = (cat : s) 
(co, t: ~) -+ (~:o,t: ,,,,) (~.at : vp) 
(cat : vp) -~ (co, t : v) 
(cat: vp) --+ (cat: v) (cat: n) 
/:(John) = {(cat: n)} 
£(sleeps) = £(loves) = {(cat: v)} 
G1UGa : A s = (cat : s) 
(cat: s) --+ (cat: n) (cat: vp) 
C(John) = {(cat: ',,,)} 
£(loves) = {(cat: v)} 
GI U G4 : A s = (cat : s) 
(co, t: ~) + (co.t: ,,,.) (cat: vp) 
(co, t : vp) -~ (cat:,,) (co, t : ~) 
/:(John) = {(cat: n)} 
/:(loves) = {(cat: v)} 
Figure 2: Grammar union 
The implication of the above proposition is that 
while grammar union might be a natural, well 
defined syntactic operation on grammars, the 
standard semantics of grannnars is too coarse to 
support it. Intuitively, this is because when a 
grammar G1 includes a particular rule p that is 
inapplicable for reduction, this rule contributes 
nothing to the denotation of the grammar. But 
when G1 is combined with some other grammar, 
G2, p might be used for reduction in G1 U G2, 
where it can interact with the rules of G2. We 
suggest an alternative, fixpoint based semantics 
for unification based grammars that naturally 
supports compositionality. 
3 A compositional semantics 
To overcome the problems delineated above, we 
follow Mancarella and Pedreschi (1988) in con- 
sidering the grammar transformation operator 
itself (rather than its fixpoint) as the denota- 
99 
tion of a grammar. 
Definition 8. The algebraic denotation o.f 
G is ffGffa I = Ta. G1 -at G2 iff Tal = TG2. 
Not only is the algebraic semantics composi- 
tionM, it is also commutative with respect to 
grammar union. To show that, a composition 
operation on denotations has to be defined, and 
we tbllow Mancarella and Pedreschi (1988) in 
its definition: 
Tc;~ • To;., = ),LTc, (~) u Ta2 (5 
Theorem 4. The semantics '==-at ' is commuta- 
tive with respect to grammar union and '•': for 
e, vcry two grammars G1, G2, \[alffat" ~G2ffal = 
:G I \[-J G 2 ff (tl . 
Proof. It has to be shown that, for every set of 
items L Tca~a., (I) = Ta, (I)u Ta.,(I). 
• if x E TG1 (I) U TG~, (I) then either x G 
Tch (I) or x E Ta.,(I). From the definition 
of grammar union, x E TG1uG2(I) in any 
case. 
• if z E Ta~ua.,(I) then x can be added by 
either of the three clauses in the definition 
of Ta. 
- if x is added by the first clause then 
there is a rule p G 7~1 U T~2 that li- 
censes the derivation through which 
z is added. Then either p E 7~1 or 
p G T~2, but in any case p would have 
licensed the same derivation, so either 
~ Ta~ (I) or • ~ Ta~ (I). 
- if x is added by the second clause then 
there is an e-rule in G1 U G2 due to 
which x is added, and by the same 
rationale either x C TG~(I) or x E 
TG~(I). 
- if x is added by the third clause then 
there exists a lexical category in £1 U 
£2 due to which x is added, hence this 
category exists in either £1 or £2, and 
therefore x C TG~ (I) U TG2 (I). 
\[\] 
Since '==-at' is commutative, it is also compo- 
sitional with respect to grammar union. In- 
tuitively, since TG captures only one step of 
the computation, it cannot capture interactions 
among different rules in the (unioned) grammar, 
and hence taking To: to be the denotation of G 
yields a compositional semantics. 
The Ta operator reflects the structure of the 
grammar better than its fixpoint. In other 
words, the equivalence relation induced by TG is 
finer than the relation induced by lfp(Tc). The 
question is, how fine is the '-al' relation? To 
make sure that a semantics is not too fine, one 
usually checks the reverse direction. 
Definition 9. A fully-abstract equivalence 
relation '-' is such that G1 =- G'2 'i,.\[.-f .for all G, 
Ob(G1 U G) = Ob(G.e U G). 
Proposition 5. Th, e semantic equivalence re- 
lation '--at' is not fully abshuct. 
Proof. Let G1 be the grammar 
A~ = ±, 
£1 = 0, 
~ = {(cat: ~) -~ (~:.,t : ,,,,p) (c.,t : vp), 
(cat: up) -~ (,:..t : ',,.p)} 
and G2 be the gramm~:r 
A~ = 2, 
Z:2 = O, 
n~ = {(~at : .~) -~ (~,.,t : .,p) (.at: ~p)} 
• G1 ~at G2: because tbr I = {\["John loves 
Mary",6,(cat : np),9\]}, T(;I(I ) = I but 
To., (I) = O 
• for all G, Ob(G U G~) = Ob(G \[3 G2). The 
only difference between GUG1 and GUG2 is 
the presence of the rule (cat : up) -+ (cat : 
up) in the former. This rule can contribute 
nothing to a deduction procedure, since any 
item it licenses must already be deducible. 
Therefore, any item deducible with G U G1 
is also deducible with G U G2 and hence 
Ob(G U G1) ---- Ob(G U G,2). 
\[\] 
A better attempt would have been to con- 
sider, instead of TG, the fbllowing operator as 
the denotation of G: \[G\]i d = AI.Ta(I) U I. In 
other words, the semantics is Ta + Id, where 
Id is the identity operator. Unfortunately, this 
does not solve the problem, as '~'\]id' is still not 
fully-abstract. 
100 
4 A fully abstract semantics 
We have shown so far that 'Hfp' is not com- 
positional, and that 'Hid' is compositional but 
not fully abstract. The "right" semantics, there- 
fore, lies somewhere in between: since the choice 
of semantics induces a natural equivalence on 
grammars, we seek an equivalence that is cruder 
thzm 'Hid' but finer than 'H.fp'. In this section 
we adapt results from Lassez and Maher (1984) 
a.nd Maher (1988) to the domain of unification- 
b~Lsed linguistic formalisms. 
Consider the following semantics for logic 
programs: rather than taking the operator asso- 
dated with the entire program, look only at the 
rules (excluding the facts), and take the mean- 
ing of a program to be the function that is ob- 
tained by an infinite applications of the opera- 
tor associated with the rules. In our framework, 
this would amount to associating the following 
operator with a grammar: 
Definition 10. Let RG : Z -~ Z be a trans- 
formation on sets o.f items, where .for every 
\[ C ITEMS, \[w,i,A,j\] E RG(I) iff there exist 
Yl,...,Yk E I such that yl = \[wz,it,Al,jd .for 
1 _ < l _ < k and il+t = jl .for 1 < l < k and 
i, = 1 and.jk = J and (A1,...,Ak) ~ A and 
"~1) ~ 'tl) 1 • • • ?U k. 
Th, e functional denotation of a grammar G is 
/\[G~.f,,, = (Re + Id) ~ = End-0 (RG + Id) n. Notice 
that R w is not RG "\[ w: the former is a function "d 
from sets of items to set of items; the latter is 
a .set of items. 
Observe that Rc is defined similarly to Ta 
(definition 5), ignoring the items added (by Ta) 
due to e-rules and lexical items. If we define the 
set of items I'nitc to be those items that are 
a.dded by TG independently of the argument it 
operates on, then for every grammar G and ev- 
ery set of items I, Ta(I) = Ra(I) U Inita. Re- 
lating the functional semantics to the fixpoint 
one, we tbllow Lassez and Maher (1984) in prov- 
ing that the fixpoint of the grammar transfor- 
mation operator can be computed by applying 
the fimctional semantics to the set InitG. 
Definition 11. For G = (hg,£,A~), Initc = 
{\[e,i,A,i\] \[ B is an e~-rule in G and B E_A} U 
{\[a,i,A,i + 1J I B E £(a) .for B E A} 
Theorem 6. For every grammar G, 
(R.c + fd.) (z',,.itcd = tb(TG) 
Proof. We show that tbr every 'n., (T~ + Id) 
n = (E~.-~ (Re + Id) ~:) (I'nit(;) by induction on 
Tt. 
For n = 1, (Tc + Id) ~\[ 1 = (Tc~ + Id)((Ta + 
Id) ~ O) = (Tc, + Id)(O). Clearly, the only 
items added by TG are due to the second and 
third clauses of definition 5, which are exactly 
Inita. Also, (E~=o(Ra + Id)~:)(Initc;) = (Ra + 
Id) ° (Initc) = I'nitc;. 
Assume that the proposition holds tbr n- 1, 
that is, (To + Id) "\[ (',, - 1) = t~E'"-2t~'a:=0 txta + 
Id) k)Unite). Then 
(Ta + Id) $ n = 
definition of i" 
(TG + Id)((Ta + Id) ~\[ (v, - 1)) = 
by the induction hypothesis 
~n--2 (Ta + Id)(( k=0(RG + Id)k)(Inita)) = 
since Ta(I) = Ra(I) U Inita 
En-2 (Ra + Id)(( k=Q(Rc; + Id)~')(Inita)) U Inita = 
(Ra + (Ra + Id) k) (1',,,its,)) = 
(y\]n-1/R , Id)h:)(Init(:) k=0 ~, ,G-I- 
Hence (RG + Id) ~ (Init(; = (27(; + Id) ~ w = 
lfp( TG ) . \[\] 
The choice of 'Hfl~' as the semantics calls for 
a different notion of' observables. The denota- 
tion of a grammar is now a flmction which re- 
flects an infinite number of' applications of the 
grammar's rules, but completely ignores the e- 
rules and the lexical entries. If we took the ob- 
servables of a grammar G to be L(G) we could 
in general have ~G1\].f,. = ~G2\]fl~. but Ob(G1) 7 ~ 
Ob(G2) (due to different lexicons), that is, the 
semantics would not be correct. However, when 
the lexical entries in a grammar (including the e- 
rules, which can be viewed as empty categories, 
or the lexical entries of traces) are taken as in- 
put, a natural notion of observables preservation 
is obtained. To guarantee correctness, we define 
the observables of a grammar G with respect to 
a given input. 
Definition 12. Th, e observables of a gram- 
mar G = (~,/:,A s} with respect to an in- 
put set of items I are Ot, (C) = {(',,,,A) I 
\[w,0, d, I 1\] e 
101 
Corollary 7. The semantics '~.~.f ' is correct: 
'llf G1 =fn G2 then .for every I, Obl(G1) = 
Ol,  ( a,e ). 
The above definition corresponds to the pre- 
vious one in a natural way: when the input is 
taken to be Inita, the observables of a grammar 
are its language. 
Theorem 8. For all G, L(G) = Obinita(G). 
P'moJ: 
L(G) = 
definition of L(G) 
{ (',,,, A) I \[w, O, A, I 1\] e I\[C\]lo,,} = 
definition 4 
{(w, A) \[ F-c \[w, O, A, = 
by theorem 1 
{<w, A> I \[,w, 0, A, Iwl\] e l.fp(Ta)} = 
by theorem 6 
{(,w, A) I \[w, O, A, \[wl\] e \[G\]fn(InitG)} = 
by definition 12 
Obt,,,~tc; (G) 
\[\] 
.To show that the semantics 'Hfn' is composi- 
tional we must define an operator for combining 
denotations. Unfortunately, the simplest oper- 
ator, '+', would not do. However, a different 
operator does the job. Define ~Gl~.f~ • \[G2~f~ to 
1)e (\[\[G1\]l.fn + \[G2~f~) °'. Then 'H.f~' is commuta- 
tive (and hence compositional) with respect to 
~•' and 'U'. 
Theorem 9. fiG1 U G2~fn = ~Gl\]fn " ~G2~.fn. 
The proof is basically similar to the case of 
logic programming (Lassez and Maher, 1984) 
and is detailed in Wintner (1999). 
Theorem 10. The semantics '~'\[fn' is fully 
abstract: ,for every two grammars G1 and G2, 
'llf .for" every grammar G and set of items I, 
Obr(G1 U G) = ObI(G2 U G), then G1 =fn G2. 
The proof is constructive: assuming that 
G t ~f;~ G2, we show a grammar G (which de- 
t)ends on G1 and G2) such that Obt(G1 U G) ¢ 
Obr(G2 U G). For the details, see Wintner 
(1999). 
5 Conclusions 
This paper discusses alternative definitions for 
the semantics of unification-based linguistic for- 
malisms, culminating in one that is both com- 
positional and fully-abstract (with respect to 
grammar union, a simple syntactic combination 
operations on grammars). This is mostly an 
adaptation of well-known results from h)gic pro- 
gramming to the ti'amework of unification-based 
linguistic tbrmalisms, and it is encouraging to 
see that the same choice of semantics which 
is compositional and fiflly-abstra(:t for Prolog 
turned out to have the same desirable proper- 
ties in our domain. 
The functional semantics '~.\].f,' defined here 
assigns to a grammar a fimction which reflects 
the (possibly infinite) successive application of 
grammar rules, viewing the lexicon as input to 
the parsing process. We, believe that this is a 
key to modularity in grammar design. A gram- 
mar module has to define a set of items that 
it "exports", and a set of items that can be 
"imported", in a similar way to the declaration 
of interfaces in programming languages. We 
are currently working out the details of such 
a definition. An immediate application will fa- 
cilitate the implementation of grammar devel- 
opment systems that support modularity in a 
clear, mathematically sound way. 
The results reported here can be extended 
in various directions. First, we are only con- 
cerned in this work with one composition oper- 
ator, grammar union. But alternative operators 
are possible, too. In particular, it would be in- 
teresting to define an operator which combines 
the information encoded in two grammar rules, 
for example by unifying the rules. Such an op- 
erator would facilitate a separate development 
of grammars along a different axis: one module 
can define the syntactic component of a gram- 
mar while another module would account for the 
semantics. The composition operator will unify 
each rule of one module with an associated rule 
in the other. It remains to be seen whether the 
grammar semantics we define here is composi- 
tional and fully abstract with respect to such an 
operator. 
A different extension of these results should 
provide for a distribution of the type hierarchy 
among several grammar modules. While we as- 
sume in this work that all grammars are defined 
102 
over a given signature, it is more realistic to as- 
sume separate, interacting signatures. We hope 
to be able to explore these directions in the fu- 
ture. 

References 
Antonio Brogi, Evelina Lamina, and Paola 
Mello. 1992. Compositional model-theoretic 
semantics for logic programs. New Genera- 
tion Computing, 11:1-21. 
Michele Bugliesi, Evelina Lamina, and Paola 
Mello. 1994. Modularity in logic pro- 
gramming. Journal of Logic Programming, 
19,20:443 502. 
Bob Carpenter. 1991. Typed feature struc- 
tures: A generalization of first-order terms. 
In Vijai Saraswat and Ueda Kazunori, edi- 
tors, Logic Programming - Proceedings of the 
1991 International Symposium,, pages 187- 
201, Cambridge, MA. MIT Press. 
Bob Carpenter. 1992. The Logic of Typed Fea- 
ture Structures. Cambridge Tracts in Theo- 
retical Computer Science. Cambridge Univer- 
sity Press. 
Gregor Erbach and Hans Uszkoreit. 1990. 
Grammar engineering: Problems and 
prospects. CLAUS report 1, University of 
the Saarland and German research center for 
Artificial Intelligence, July. 
Haim Gaifman and Ehud Shapiro. 1989. Fully 
abstract compositional semantics for logic 
programming. In 16th Annual ACM Sym- 
posium on Principles o.f Logic Programming, 
pages 134-142, Austin, Texas, January. 
J.-L. Lassez and M. J. Maher. 1984. Closures 
and fairness in the semantics of programming 
logic. Theoretical computer science, 29:167- 
184. 
M. J. Maher. 1988. Equivalences of logic pro- 
grams. In .Jack Minker, editor, Foundations 
of Deductive Databases and Logic Program- 
rain.q, chapter 16, pages 627-658. Morgan 
Kaulinann Publishers, Los Altos, CA. 
Paolo Mancarella and Dino Pedreschi. 1988. 
An algebra of logic programs. In Robert A. 
Kowalski and Kenneth A. Bowen, edi- 
tors, Logic Programming: Proceedings of the 
F@h international conference and sympo- 
,sium, pages 1006-1023, Cambridge, Mass. 
MIT Press. 
Fernando C. N. Pereira and Stuart M. Shieber. 
1984. The semantics of grammar formalisms 
seen as computer languages. In Proceedings of 
the lOth international con.ference on compu- 
tational linguistics and the 22nd annual meet- 
ing o.f the association .for computational lin- 
guistics, pages 123-129, Stantbrd, CA, July. 
Stuart Shieber, Yves Schabes, and Fernando 
Pereira. 1995. Principles and implementation 
of deductive parsing. Jo'wrr~,al o\]" Logic Pro- 
gramming, 24(1-2):3-36, July/August. 
Stuart M. Shieber. 1992. Constraint-Based 
Grammar Form, alism, s. MIT Press, Cam- 
bridge, Mass. 
Klaas Sikkel. 1997. Par'sing Schemata. Texts in 
Theoretical Computer Science - An EATCS 
Series. Springer Verlag, Berlin. 
M. H. Van Emden and Robert A. Kowalski. 
1976. The semantics of predicate logic as a 
programming language..Iournal of the Asso- 
ciation .for Ccrmputing Machinery, 23(4):733- 
742, October. 
Shuly Wintner and Nissim Francez. 1999. Off- 
line parsability and the well-tbundedness of 
subsumption. Journal of Logic, Language 
and In.formation, 8(1):1-16, January. 
Shuly Wintner. 1999. Compositional semantics 
for linguistic formalisms. IRCS Report 99-05, 
Institute for Research in Cognitive Science, 
University of Pennsylvania, 3401 Wahmt St., 
Suite 400A, Philadelphia, PA 19018. 
