On the Satisfiability of Complex Constraints 
Luis Damas 
Universidade do Porto, Rua do Campo Alegre 823, 4000 Porto, Portugal Giovanni 
B. Varile 
CEC , 2920 Luxembourg, Luxembourg 
Abstract 
The main problem arising from the use of com- 
plex constraints in Computational Linguists is 
due to the NP-hardness of checking whether a 
given set of constraints is satisfiable and, in the 
affirmative case, of generating the set of min- 
imal models which satisfy the constraints. In 
this "paper we show how the CLG approach to 
rewriting constraints while constructing a par- 
tial model can greatly reduce the size of the 
original constraints and thus contribute to re- 
duce the computational problem. 
1 Introduction 
Most of the more recent formalisms in Com- 
putational Linguistics involve complex con- 
straints, i.e. involving either disjunction or and 
negation of equality constraints \[Kay85, KB82, 
PS87\]. 
From a practical point of view, the main 
problem arising from the introduction of com- 
plex constraints is due to the NP-hardness of 
checking whether a given set of constraints is 
satisfiable and, in the affirmative case, of gen- 
erating tile set of minimal models which satisfy 
thc constraints. 
Since the NP-hardness of the problem tends 
to manifest in practical applications in a dra~ 
matic way there were several proposals of algo- 
rithms to minimize this problem \[Kas87, ED88, 
MK91\]. 
However, in our opinion, any practical ap- 
proach to the problem should rely on apply- 
ing an exponential satisfaction algorithm as sel- 
dom as possible and also, when that cannot be 
avoided, to reduce as much as possible the size 
of tile input formulae to which the algorithm is 
applied. 
A classical way in which one can reduce the 
size of input formulae is by factoring, i.e. ex- 
pressing it as a conjunction of smaller formulae 
which do not have variables in common. As 
a matter of fact if instead of checking the sat- 
isfiability of a formula of length nk we check 
the satisfiability of n formulae of size k we are 
gaining an exponential reduction in time. This 
strategy is also explored in \[MK91\]. 
Another way of reducing the size of input for- 
mulae which has been used in CLG implemen- 
tations \[DV89, BDMVg0, DMVglb\], and which 
can be combined with the previous approaches, 
is to build a partial model of the input formula 
and to apply the algorithm to the remaining 
constraints. Since in many cases this is able 
to do away with all the constraints this also 
achieves the goal of using the exponential satis- 
faction algorithm as seldom as possible. This 
method can also be seen as a generalization 
of steps 1 and 2 of the algorithm described in 
\[Kas87\], while avoiding some of its pitfalls. 
In this paper we start by showing, by trans- 
lating to the feature logics context the methods 
for first order terms introduced in \[DMV91a, 
DMV91b\], how the CLG approach to rewriting 
constraints while constructing a partial model 
can greatly reduce the size of the original con- 
straints and thus contribute to reduce the corn- 
putational problem. 
After that will review the notion of factoriza- 
tion for feature logic formulae showing under 
which conditions it can be done. 
2 An example 
From an intuitive point of view, our approach 
attempts to explore the fact that complex con- 
straints arising from combining descriptions of 
linguistic objects, tend to take the form of a 
large conjunction of smaller constraints. 
To illnstrate this approach we will use the 
following example from \[MK91\] originated by 
conjoining the agreement features of the lexi- 
AcrEs DE COLING-92. NANTES, 23-28 AOr3T 1992 1 0 g PROC. OF COLING-92, NANTES. AUG. 23-28, 1992 
eal information for tim German words die and 
Koffer. 
\[(feas~) = ,~om v (/ease) = acc\] ^ 
\[\[(f gend) = fern A (fnum)= sg\]V 
(f sum) = pt\] ^ 
(f aend) = mase ^ (f pers) = 3 ^ 
\[\[(f num) = sg ^ (lease) ¢ gen\] V 
\[(f num) = pl ^ (f case) ¢ dat\]\] (1) 
By looking at the top equality conjuncts in 
as it will be slmwn in the next section, is equiv- 
alent to the satisfiability of (1). However we 
should point out that the above process, wtfieh 
takes at most quadratic time since, by using 
adequate data structures, each rewrite can be 
done in linear time and the number of rewrites 
is limited by the size of the fornmla, has succeed 
in drastically reducing the size of the original 
formula. 
3 A rewriting system 
(1) we can conclude that any model of (1) is In this section we iutroduee a rewriting system, 
subsumed by which is essentially an adaptation to feature 
gend = mase \] 
f = iv .... a j ('~) 
Using this information and the standard ax- 
ioms of Feature Logics we can rewrite (1) as 
follows 
\[(f case) = nora V (f ease) = ace\] A 
\[\[false A (f num)= sg\] V 
(f n~,n) : pl\] ^ 
true A true A 
\[\[(f .... ) = sg A (f .... ) 7 k Ben\] V 
\[(f,,ur.) = pl A (f e~se)¢ ,tall\] (a) 
which, by using the standard rules of Proposi- 
tional Calculus, can be simplified to 
\[(f case) =noru V (lease) = ace\] A 
(f sum) = pl ^ 
\[\[(f.um) = sg ^ (f ease) ¢ ge.\] V 
\[(f nun,) = pl m (f ease) ¢ datl\] (4) 
Again, froin the atomic top conjunct in (4) 
we can refine (2) to obtain 
\[ gend = mase \] 
f=/p~,.s--3 / (5) 
Inure = pt J 
after which (4) reduces to 
\[(: case) = sort, V (f ease) ..... \] ^ 
(f ease) # ant (6) 
Since 11o atomic top conjunct remains we 
would now have to resort to the exponentiM al- 
gorithm to cheek the satisfiability of (6), which, 
structures of the one presented in \[DMV91a\] 
for constraints Oil first order terms. 
The purpose of this rewriting system is to for- 
nlalize the rewriting process illustrated in thc 
previous section. The rules of the rewriting 
system, whidt are justified by theorems of the 
logic underlying features structures, have been 
dcsigncd with the aim of bringing out conjunc- 
tions to the top while avoiding more than a lin- 
ear growth of the size of constraints. 
Tc~ formalize the rewriting system we will use 
Feature Logics \[Smo89\] and its notation. Thus 
we will use a and b to denote atoms, f to denote 
a feature name, x and y to denote variables and 
and t to denote either an atom or a variable. 
We start by recalling the notion of solved fea- 
ture clause of \[Smo89\] which is the feature logic 
w~rsion of the standard definition of solved form 
\[lier30, Mah88\]. 
A set of formulae C is said to be a solved 
feature clause if it satisfies the following condi- 
tions: 
1. every constraint in 6' has one of the follow- 
ing forms: fx-s, fx \[, x=s, x~s 
2. ifx:-s is in C then x occurs exactly once in 
C 
3. if fx-s and fx-t are in C then s = t 
4. iffx I is in C, then C contains no constraint 
fx-s 
5. if x~s is in C, then x ¢ s. 
Smolka a\]so shows that any satisfiable set C 
of, possibly negated, atomic formulae can be 
reduced to solved form by using the following 
simplification rules, which again are the feature 
logic version of llerbrand's rules for solving sets 
of equations of first order terms: 
AcrEs DE COL1NG-92, NANTES, 23-28 Aotrr 1992 1 0 9 PROC. OF COLING-92. NANTES, AUG. 23-28, 1992 
1. {x--s) LI C ---* {x "-s} U \[s/x\]C if • ~k .... I 
x occurs in C 
2, {a--'=}uc-, {='----a}UC 
3. {fx--s, fx--t} UC ---* {fx--s,s--f} UC 
4. {s-s}uC~C 
5. {Sa T}uC ~C 
7. {atb}uC-*Cifutb. 
We call a solved feature clause positive iff it 
includes only constraints of the form fx-s and 
x-s. 
We can now make precise the notion of par- 
tial model used in the previous section as a pos- 
itive solved feature clause .£4. 
Note that the form required for A~ is essen- 
tially the one produced by an unification algo- 
rithm for feature structures. 
Given a set of constraints C we say that a 
feature clause C ~ is a minimal model of C if every 
model ofC r is a model of C and no proper subset 
of C ~ satisfies this condition. 
From Theorem 5.6 of \[Smo89\] we can con- 
clude that for any C there is a finite uumber of 
minimal models of C. 
"\]2he aim of the CLG rewriting system is to 
produce from a set of constraints Co a partial 
model .£4 and a smaller set of constraints C such 
that any minimal model of Co can be obtained 
by conjoining (i.e. "unifying") a minimal model 
of C with .~ and moreover for any minimal 
model of C the reunion Ad U C is satisfiable. 
We start by defining a set of rewriting rules 
~ for terms and constraints: 
z -*~ t if x='t E 34 
b-x ---+~ x-b 
fa- t --~ false 
fx T~M false if fx-I C 3d 
a--b ---*~ false 
t- t ~ ~rue 
f x-s ~ t-s if f x-I E 34 
~true --*~4 false 
~false ~ true 
~C ~ C 
~(C v C') ~.~ ~C A ~C' 
C A true-*~ C 
C A false -.2~ false 
C V true---+A~ true 
C V false -.~,~ C 
We now define a rewriting system for pairs 
(34,17) by first closing C under ---*s~4 and then 
using the following rules 
(M, c u {false}) -~ ({rut,e}, ~) 
(M,Cu {true)) ~ (34,C) 
(34,c u {~-s}) ~ (34 v {~-s},C) 
(34,c u {/z-t}) -- (34 u {fz-'-t}, c) 
with the convention that after each application 
of one of the rewrite rules the new partial model 
is reduced to solved tbrm and the resulting set 
of constraints is closed nmler ~M. 
As in \[DMV91a\] the rewrite process could be 
extended to use negated atomic constraints in 
C. 
We will now sketch the proof of the claims 
made above about the rcwriting system. 
We will first argue that if given an initial set 
of constraints Co we apply the rewriting system 
to (~,Co) to obtain {34,C} then Co ( ....... pre- 
cisely the conjunct of all the constraints in Co) 
is equivalent to 3.4 UC. As a matter of fact this 
follows from the fact that each rewrite rule is 
associated with a similar meta-theorem of l:irst 
Order Logic and/or the axioms of Feature Log- 
its. 
As for the other property of the rewriting 
system, namely that the minimal models of Co 
are obtained by conjoining NI with those of C, 
we will only sketch the argument of the proof 
which follows from the fact that if some minimal 
model C' of C was inconsistent witl~ .M then, af- 
ter reducing C to disjunctive form, at least one 
of the disjunctions s|muld subsume C ~ and thus 
should be inconsistent with A4 while admiring 
itself a model. Now, since every atomic formula 
occurring ill the disjunction already occurcd in 
C it is possible to derive a contradiction with 
the hypothesis that C was closed under --~M. 
To see this we notice that each disjunct in the 
disjunctive form of C can be regarded as fea- 
ture clause C'. Now if A4 U C" was unsatisfi- 
able then some sequence of simplification rules 
should lead to a clash. Now, noticing that any 
atomic formula in C" umst already be present 
in C, it is easy to check that any sequence of 
simplification rules would involve only fornm- 
lae from C" and a clash with a formula in f14 
would thus be impossible. 
4 On the factorization of 
feature constraints 
Although tile rewriting system introduced in 
tile previous section can be seen as a factor- 
ization of tile original constraint it is also im- 
portant, in accordance with tile discussion in 
the introduction, to further factorizing tile con- 
Acres DE COLING-92, NANTES, 23-28 hOt~T 1992 1 1 0 PgOC. OF COLING-92, NawrEs, Auo. 23-28, 1992 
straint produced before an exponential satisfac- 
tion algorithm is api)licd. 
Now given a conjunction C A C' of feature 
constraints it is easy to provc, using argumcnts 
similar to the ones used in thc previuus section, 
that a sufficient condition for tim conjunction 
to be satisliablc iff each of the conjunets is in- 
dependently satisfiable, can be expressed ms fol- 
lows: 
1. any variable x which occurs in C in an 
atolnic formula x--s or s--a: does not oc- 
cur in C' and vlce-versa 
2. for every variable x and feature f such that 
fx occurs in C, /x does nnt occur in C' 
and vice-versa. 
Note that given a conjunctiw~ wet of con- 
straints it is possible to l)artition it into miidmal 
disjoint sets satisfying the. conditions above in 
quadratic time. 
Using the above criteria results in achievillg 
the objective described in \[MK91\] of separating 
not only the treatment of constraints dealing 
with completely indel)endcnt linguistic descrip- 
tions but also of independent phenomena for 
the same the \[iaguistic descriptions. 
5 Conclusions 
\[DMV91b\] 
\[DVSg\] 
\[El)aS\] 
\[oaw86\] 
Tim strategy for handling complex constraints 
described in this paper has I)een successfully 
put to use in ditl~rent CLG implementations. 
One of the adwmtagcs of using a rewrite sys- \[I\[cr30\] 
tcm is that it is easily extended to other atomic 
constraints like the ones in CLG(2) dealing with 
lists. Similarly it can bc adapted to cope with 
the extensions to feature constraints proposed \[Job91\] 
in \[Joh9i\]. 
AcrEs DE COLING-92, NANTES, 23-28 AO't~T 1992 1 1 2 PROC. OF COLING-92, NANTES, AUO. 23-28, 1992 
AcrEs DE COL1NG-92, NANTES, 23-28 AOI~'I' 1992 1 1 1 PROC. OF COLING-92. NANTI':S. AUG. 23-28. 1992 

References 

Sergio Balari, Luis Damas, Nehna 
Moreira, and Giovanni I1. Varile. 
CLG: Constraint logic grammars. 
In ll.Karlgrcn, editor, P~vceediugs 
of the 13th htternutional Confer- 
cuce on Computa~ioual Linguistics \[Kay85\] 
(COLING), volume 3, pages 7-12, 
llelsinki, 1990. 

Luis l)amas, Nelma Moreira, and 
Giovanni B. Varilc. The forlnal and 
processing models of CLG. In Fiifth 
Coufereucc of the Emopeaa Chap= 
ter of the Association for Compu- 
tational Linguistics, pages 173-178, 
Berlin, 1991. 

Luis Damns, Nelma Moreira, and 
Giovamd B. Varile. CLG - a general 
logic grammar formalism, ht Pro- 
ceediugs of the Workshop on Con- 
straiut Propagation and Linguistic 
Description, forthcoming, I,ugano, 
Switzcrlan(l, 1991. 

Luis l)ama, s and Giovanni B. Var- 
tie. CLG: A grammar formal- 
ism based oll constraint resolution. 
In l';.M.Morgado and J.P.Martitm, 
editors, EPIA 89, volume 390 of 
Lecture Notes in Artificial Intelli- 
gence, pages 175-186. Springer Ver- 
lag, 1989. 

A. Eisete and J. D6rre. Unification 
of disjunctive feature descriptions. 
In ~6th Annual Meeting of the As- 
sociation \[or Computational Lin- 
guistics, Buffalo, New York, 1988. 

Barbara Grosz, Karen Sparck 
Jones, and Bomty \],ynn Webber, 
editors. Readings in Natural Lan- 
guage Processing. Morgan Ka/ff- 
mann, 1986. 

Jacques llerbrand. Recherches 
sur la theovie de la dgmoustration, 
7'h~se de Doctorat. Univ. Paris, 
Paris, 1930. 

Mark Johnson. Features and for- 
mulae. Computational Linguistics, 
17(2), 1991. 

IL T. Kasper. A unification metbod 
for disjm~etive t;eature deseril)tions. 
In 25th Annual Meeting of the As- 
sociation for Computational Lin- 
guistics, Stanford, CA, 1987. 

Martin Kay. l>arsing in fimc- 
tional unification grammar. In 
l)avid It. Dowty, I,auri Karttunen, 
and Arnold M. Zwicky, editors, 
Natural Language Parsing. Ellis 
llorwood/Wiley, 1985. 

R. Kaplan and J. Bresban. Lex- 
ical functional grammar: A for- 
mal system for grammatical repre- 
sentation. In Joan Bresnan, edi- 
tor, The Mental Representation of 
Grammatical Relations. MIT Press, 
1982. 

Michael J. Mailer. Complete a.x- 
iomatizations of the algebras of fi- 
nite, rational and infinite trees. 
Technical report, IBM Thomas J. 
Watson Research Center, P.O. Box 
704, Yorktown tleights, NY 10598, 
U.S.A., 1988. 

John T. Maxwell and Ronald M. 
Kaplan. A method for disjunctive 
constraint satisfaction. In Masaru 
Tomita, editor, Current Issues in 
Parsing Technology. Kluwer Aca- 
demic Publishers, 1991. 

Carl Pollard and Ivan Sag. \[n- 
formation Based Syntax: and Se- 
mantics, Volume 1, Fundamentals, 
volume 13. Center for the Study 
of Language and Information Stan- 
ford, 1987. 

Gert 
Smolka. Feature constraint logics 
for unification grammars. Technical 
report, IBM Wissenschafliches Zen- 
trum, Institut fiir Wissensbasierte 
Systeme, 1989. IWBS Report 93. 
