Notes on computational linguistics.pdf - UCLA Department of ...
Notes on computational linguistics.pdf - UCLA Department of ...
Notes on computational linguistics.pdf - UCLA Department of ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Stabler - Lx 185/209 2003<br />
compute sums <strong>on</strong> the natural numbers, as we will see.<br />
From these axioms, prolog can refute ?- human(m<strong>on</strong>tague). This cannot be refuted using the pro<strong>of</strong> rule<br />
shown above, though, since no axiom has human(m<strong>on</strong>tague) asitshead.Theessence<strong>of</strong>prologiswhatitdoes<br />
here: it unifies the goal ?- human(m<strong>on</strong>tague) with the head <strong>of</strong> the axiom, human(X) :- mathematician(X).<br />
We need to see exactly how this works.<br />
Two expressi<strong>on</strong>s unify with each other just in case there is a substituti<strong>on</strong> <strong>of</strong> terms for variables that makes<br />
them identical. To unify human(m<strong>on</strong>tague) and human(X) we substitute the term m<strong>on</strong>tague for the variable X.<br />
We will represent this substituti<strong>on</strong> by the expressi<strong>on</strong> {X ↦ m<strong>on</strong>tague}. Letting θ ={X ↦ m<strong>on</strong>tague}, and<br />
writing the substituti<strong>on</strong> in “postfix” notati<strong>on</strong> – after the expressi<strong>on</strong> it applies to, we have<br />
human(X)θ =human(m<strong>on</strong>tague)θ =human(m<strong>on</strong>tague).<br />
Notice that the substituti<strong>on</strong> θ has no effect <strong>on</strong> the term human(m<strong>on</strong>tague) since this term has no occurrences<br />
<strong>of</strong> the variable X.<br />
We can replace more than <strong>on</strong>e variable at <strong>on</strong>ce. For example, we can replace X by s(Y) and replace Y by Z.<br />
Letting θ ={X ↦ s(Y),Y ↦ Z}, wehave:<br />
sum(X,Y,Y)θ =sum(s(Y),Z,Z).<br />
Notice that the Y in the first term has not been replaced by Z. This is because all the elements <strong>of</strong> the substituti<strong>on</strong><br />
are always applied simultaneously, not <strong>on</strong>e after another.<br />
After a little practice, it is not hard to get the knack <strong>of</strong> finding substituti<strong>on</strong>s that make two expressi<strong>on</strong>s<br />
identical, if there is <strong>on</strong>e. These substituti<strong>on</strong>s are called (most general) unifiers, and the step <strong>of</strong> finding and<br />
applying them is called (term) unificati<strong>on</strong>. 2<br />
To describe unificati<strong>on</strong> we need two preliminaries. In the first place, we need to be able to recognize<br />
subexpressi<strong>on</strong>s. C<strong>on</strong>sider the formula:<br />
whats_it(s(Y,r(Z,g(Var))),func(g(Argument),X),W).<br />
The subexpressi<strong>on</strong> beginning with whats_it is the whole expressi<strong>on</strong>.<br />
The subexpressi<strong>on</strong> beginning with s is s(Y, r(Z, g(Var))).<br />
The subexpressi<strong>on</strong> beginning with Argument is Argument.<br />
No subexpressi<strong>on</strong> begins with a parenthesis or comma.<br />
The sec<strong>on</strong>d preliminary we need is called compositi<strong>on</strong> <strong>of</strong> substituti<strong>on</strong>s – we need to be able to build up<br />
substituti<strong>on</strong>s by, in effect, applying <strong>on</strong>e to another. Remember that substituti<strong>on</strong>s are specified by expressi<strong>on</strong>s<br />
<strong>of</strong> the form<br />
{V1 ↦ t1,...,Vn ↦ tn}<br />
where the Vi are distinct variables and the ti are terms (ti = Vi) which are substituted for those variables.<br />
Definiti<strong>on</strong> 1 The compositi<strong>on</strong> <strong>of</strong> substituti<strong>on</strong>s η, θ is defined as follows: Suppose<br />
The compositi<strong>on</strong> <strong>of</strong> η and θ, ηθ, is<br />
η ={X1 ↦ t1,...,Xn ↦ tn}<br />
θ ={Y1 ↦ s1,...,Ym ↦ sm}.<br />
ηθ = {X1 ↦ (t1θ),...,Xn ↦ (tnθ), Y1 ↦ s1,...,Ym ↦ sm}−<br />
({Yi ↦ si | Yi ∈{X1,...,Xn}} ∪ {Xi ↦ tiθ | Xi = tiθ}).<br />
2So-called “unificati<strong>on</strong> grammars” involve a related, but slightly more elaborate noti<strong>on</strong> <strong>of</strong> unificati<strong>on</strong> (Pollard and Sag, 1987; Shieber,<br />
1992; Pollard and Sag, 1994).<br />
Earlier predicate logic theorem proving methods like the <strong>on</strong>e in Davis and Putnam (1960) were significantly improved by the discovery<br />
in Robins<strong>on</strong> (1965) that term unificati<strong>on</strong> provided the needed matching method for exploiting the insight from the doctoral thesis <strong>of</strong><br />
Herbrand (1930) that pro<strong>of</strong>s can be sought in a syntactic domain defined by the language <strong>of</strong> the theory.<br />
14