Semantic Information Preprocessing 
for Natural Language Interfaces to Databases 
Milan Mosny 
Simon Fraser University 
Burnaby, BC VhA 1S6, 
Canada 
mosny@cs.sfu.ca 
Abstract 
An approach is described for supplying se- 
lectional restrictions to parsers in natural 
language interfaces (NLIs) to databases by 
extracting the selectional restrictions from 
semantic descriptions of those NLIs. Au- 
tomating the process of finding selectional 
restrictions reduces NLI development time 
and may avoid errors introduced by hand- 
coding selectional restrictions. 
1 Introduction 
An approach is described for supplying selectional 
restrictions to parsers in natural language interfaces 
(NLIs) to databases. The work is based on Linguis- 
tic Domain Theories (LDTs) (Rayner, 1993). In our 
approach, we propose a restricted version of LDTs 
(RLDTs), that can be normalized and in normal- 
ized form used to construct selectional restrictions. 
We assume that semantic description of NLIs is de- 
scribed by such an RLDT. 
The outline of the paper is as follows. Section 
2 provides a brief summary of original LDTs, il- 
lustrates how Abductive Equivalential Translation 
(AET) (Rayner, 1993) can use them at run-time, 
and describes RLDTs. Sections 3 and 4 describe off- 
line processes - the normalization process and the 
extraction of selectional restrictions from normalized 
RLDTs respectively. Section 5 contains discussion, 
including related and future work. 
2 LDT, AET and RLDT 
LDT and AET. LDT was introduced for a sys- 
tem, where input is a logical formula, whose predi- 
cates approximately correspond to the content words 
of the input utterance in natural language (lexical 
predicates). Output is a logical formula, consist- 
ing of predicates meaningful to the database engine 
(database predicates). AET provides a formalism 
for describing how a formula consisting of lexical 
predicates can be tranlsated into formula consisting 
of database predicates. The information used in the 
translation process is an LDT. A theory r contains 
horn clauses 
v(p~ A... A P,, --* Q) 
or universal conditional equivalences 
v(P1 ^... ^ P. ~ (RI ^... ^ Rz -= F)) 
or existential equivalences 
V((3Xl.- .Xm.P) -- F) 
where Pi, Ri denote atomic formulas, Q denotes a 
literal, F denotes a formula and V denotes universal 
closure. The LDT also contains functional relation- 
ships that are used for simplifications of the trans- 
lated formulas and assumption declarations. Given a 
formula Fting consisting of lexical predicates and an 
LDT, AET tries to find a set of permissible assump- 
tions A and a formula Fab consisting of the database 
predicates such that 
F u A =~ V(Fti,g = Fab) 
The translation of Fzi,g is done one predicate at a 
time. For each predicate in the formula Fting, there 
is a so-called conjunctive context that consists of 
conjuncts occurring together with the predicate in 
Fting, meaning postulates in the theory P, and the 
information stored in the database. Given an LDT, 
this conjunctive context determines how the predi- 
cate will be translated by AET. 
As an example, suppose that the lexical represen- 
tation of the sentence Is there a student who takes 
cmpt710 or cmpt7207 is Fzin~: 
:iX, E, Y, Y1 .student(X) A 
(take(E, X, Y) ^ unknown(Y, cmptT10) V 
take(E, X, Y, ) ^ unknown(Y~, erupt720)) 
Suppose that the theory r consists of axioms: 
VX.siudent(X) - db_student(X) (1) 
vx, E, Y, S.db_course(Y, S) ^ db_~tudent(X) (2) 
--~ (take(E, X, Y) =_ db_take(E, X, Y)) 
VX, S.acourse(S) --~ (3) 
(unknown(X, S) =-" db_course( X, S) ) 
VE, X, Y.db_take(E, X, Y) --* take(E, X, Y) (4) 
314 
where student, take and unknown are lexical 
predicates and db_student, rib_course, db_take are 
database predicates 1. Also suppose, that the LDT 
declares as an assumption aeourse(X), which can be 
read as "X denotes a course". 
Part of the conjunctive context associated with 
formula take(E, X, Y) in Ftlag is a formula (5). 
student(X) ^ unknown(Y, crept710) (5) 
From (1) and (3) of the theory F it follows that (5) 
implies the formula (6): 
db_student(X) A db_course(Y, crept710) (6) 
According to the translation rules of AET, axiom 
(2), and a logical consequence of a conjunctive con- 
text (6), the formula take( E, X, Y) can be translated 
into formula (7) 
db2ake( E, X, Y) (7) 
Formulas student(X), take(E, X, Y1), 
unknown(Y, cmpt710) and unknown(Yl, cmpt720) 
are translated similarly. Assuming crept710 and 
crept720 are courses, the input Fsi,g can be 
rewritten into Fdb shown below. 
3X, E, Y, Y1 .db~tudent(X) ^ 
( db_take( E, X, Y) A db_course(Y, crept710) V 
rib_take(E, X, Yz ) A db_course(Y1, crept720)) 
So we can claim that Fab and Fzin9 are equivalent 
in the theory F under an assumption that crept710 
and crept720 are courses. 
RLDT. We shall constrain the expressive power of 
the LDT to suit tractability and efficiency require- 
ments. 
We assume that the input is a logical formula, 
whose predicates are input predicates. We assume 
that input predicates are not only lexical predicates, 
but also unresolved predicates used for, e.g., com- 
pound nominals (Alshawi, 1992), or for unknown 
words, as was demonstrated in the example above, 
or synonymous predicates that allow us to represent 
two or more different words with only one symbol. 
The output will be a logical formula consisting 
of output predicates. We do not suppose that the 
output formula contains pure database predicates. 
However, we allow further translation of the output 
formula into database formulae using only existen- 
tial conditional equivalences. The process can be 
implemented very efficiently, and does not affect se- 
lectional restrictions of the input language. 
We assume that each atomic formula with input 
predicates can be translated into an atomic formula 
with output predicates. An RLDT therefore also 
aThe predicate unknown will be discussed in the next 
section. 
contains a dictionary of atomic formulas that spec- 
ifies which input atomic formulas can be translated 
into which output atomic formulas. 
Existential equivalences in KLDT's logic will not 
be allowed. We also assume that F in the universal 
conditional equivalences is a conjunction of atomic 
formulas rather than arbitrary formula. 
We demand that an RLDT be nonrecursive. In- 
formally RLDT nonrecursivness means that for any 
set of facts A, if there is a Prolog-like derivation of an 
atomic formula F in the theory F U A, then there is 
a Prolog-like derivation of F without recursive calls. 
3 The Normalization Process 
Our basic idea is to preproeess the semantic informa- 
tion of KLDT to create patterns of possible conjunc- 
tive contexts for each lexical predicate. The result 
of the preprocessing is a normalized KLDT: the col- 
lection of the lexical predicates, their meanings in 
terms of the database, and the patterns of the con- 
junctive contexts. 
First we introduce the term (Nontrivial) Normal 
Conditional Equivalence with respect to an RLDT T 
((N)NCE(T)). 
Definition: Let T be an RLDT and F be a logi- 
cal part of T. The quadruple (A, C, Fim,,t, Fo,,put) 
is NCE(T) iff C is a conjunction of input atomic for- 
mulas of T, A is a conjunction of assumptions of T, 
and formulas 
V(A ^ C -. (F~.p., = Eo.,p.,)) 
V(A ^ Fo.,p., -* E~.p.,) 
are logical consequences of the theory F (we 
shall refer to the last condition as sound- 
ness of the NCE(T)). We shall call the 
quadruple (A, C, Fi,put, Foutv,,t) nontrivial NCE(T) 
(NNCE(T)) iff formula C A A does not imply truth 
of Foutp,,t in the theory F. 
Informally it means that Fi,p,,t can be rewritten 
to Fo,,tp,t if its conjunctive context implies A and 
does not imply the negation of C. (A, C) thus can 
be viewed as a pattern of conjunctive contexts, that 
justifies translation of Finput to Foutput. 
We allow RLDTs to form theory hierarchies, 
where parent theories can use results of their chil- 
dren's normalization process as their own logical 
part. 
Given an I~LDT T, for each pair consisting of the 
ground lexical atomic formula Fi,put and the ground 
database atomic formula Fo,,tput from the dictionary 
of T, we find the set S of conditions (A, C) such that 
(A, C, Fi,,pu,, Fo,,p,,) is NCE(T). We shall call the 
set of all such NCE(T)s a normalized R.LDT. 
If Fi,put and Fo,,tp,t contain constants that do not 
occur in the logic of RLDT, the generalization rule 
of FOL can be used to derive more general results 
by replacing the constants by unique variables. 
315 
If the T does not contain negative horn clauses of 
the form P ---* notQ then the following completeness 
property can be proven: 
If (A1, C1, Fi,e,~, Fox,put) is NNCE(T) and S is 
a resulting set for the pair Finput, Foutp~t then 
there are conditions (A, C) in S, such that AAC 
is weaker or equivalent to Ax A C1. 
The normalization process itself is based on SLD- 
resolution(Lloyd, 1987) which we have chosen be- 
cause it is fast, sound and complete but still provides 
enough reasoning power. 
Using the example from the previous section, the 
normalization algorithm when given the 
pairs (student(a), db_student( a ) ), ( unknown( a, b ), 
db_course(a, b)) and (take(e, a, b), db_take(e, a, b)) 
will produce the results {(true, true)}, {(aeour,e(b), true)} and {(acourse(X), student(a) 
A unknown(b, X)} respectively. 
4 The Construction of Selectional 
Restrictions 
The normalized RLDT is used to construct selec- 
tional restrictions. 
We assign the tags "thing" or "attribute" to argu- 
ment positions of the lexical predicates according to 
what kind of restriction the predicate imposes on the 
referent at its argument position. If the predicate is 
a noun or the referent refers to an event, we assign 
the tag "thing". If the predicate explicitly specifies 
that the referent has some attribute - e.g. predicate 
big(X) specifies the size of the thing referenced by X 
and predicate take(_, X,_) specifies that the person 
referenced by X takes something - then we tag the 
argument position with "attribute". 
The normalized RLDT allows us to compute which 
"things" can be combined with which "attributes". 
That is, we can determine which words can be mod- 
ified or complemented by which other words. 
We assume that the normalized RLDT has cer- 
tain properties. Every NCE(T) that describes 
a translation of an "attribute" must also define 
a "thing" that constrains the same referent, e.g. 
the NCE(T) (true, person(X) A drives(E,X,Y), 
big(Y), db_big_car(Y)) for translation of the pred- 
icate big(Y) does not fulfil the requirement but 
NCE(T) (true, car(Y), big(Y), db_big_car(Y) ) does. 
We also assume that if a certain "thing" does not 
occur in any of the NCE(T)s that translates an "at- 
tribute" then the "thing" cannot be combined with 
the "attribute". 
Using the example above and the assignments 
student(X) X is a "thing" 
unknown(X,S) X is a "thing" 
take(E, X, Y) E is a "thing", X and Y are 
"attributes" 
we can infer that student(X) can be combined with 
attribute take(_, X,_) but cannot have an attribute 
take(_,_,X). 
To simplify results, we divide "attributes" into 
equivalence classes where two "attributes" are equiv- 
alent if both attributes are associated with the same 
set of "things" that the attributes can be combined 
with. We then assign a set of representatives from 
these classes to "things". 
To be able to produce more precise results, we dis- 
tinguish between two "attributes" that describe the 
same argument position of the same predicate ac- 
cording to the "thing" in the other "attribute" po- 
sition of the predicate, when needed. Consider for 
example the preposition "on" as used in the phrases 
"on the table" or "on Monday". We handle the first 
argument position of a predicate on(X,Y) associ- 
ated with the condition table(Y) as a different "at- 
tribute" as compared to the condition monday(Y). 
5 Discussion 
Automating the process of finding selectional restric- 
tions reduces NLI development time and may avoid 
errors introduced by hand-coding selectional restric- 
tions. Althcugh the preprocessing is computation- 
ally intensive, it is done off-line during the delevop- 
ment of the NLI. 
A similar approach was proposed in (Alshawi, 
1992) but a different method was suggested. (Al- 
shawi, 1992) derives selectional restrictions from 
the types associated with the database predicates, 
whereas our approach uses only the constraints that 
the RLDT imposes on the input language. 
Future work will explore other uses of normalized 
RLDTs: to construct a sophisticated help system, to 
lexicalize some small database domains, and to de- 
velop more complex lexical entries. We shall also 
consider the possible uses of our work in general 
NLP. 
Acknowledgments 
The author would like to thank Fred Popowich and 
Dan Fass for their valuable discussion and sugges- 
tions. This work was partially supported by the Nat- 
ural Sciences and Engineering Research Council of 
Canada under research grant OGP0041910, by the 
Institute for Robotics and Intelligent Systems, and 
by Faculty of Applied Sciences Graduate Fellowship 
at Simon Fr;,.ser University. 

References 
Alshawi, Hiyan, ed. 1992. The Core Language En- 
gine. Cambridge, Massachusetts: The MIT Press. 
Lloyd, John W., 1987. Foundations of Logic Pro- 
gramming, Second, Extended Edition, Springer- 
Verlag, New York. 
Rayner, Manny, 1993. Abductive Equivalentiai 
Translation and its application to Natural Language 
Database Interfacing. Ph.D. Thesis, Royal Institute 
of Technology, Stockholm, Sweden. 
