20.07.2013 Views

Notes on computational linguistics.pdf - UCLA Department of ...

Notes on computational linguistics.pdf - UCLA Department of ...

Notes on computational linguistics.pdf - UCLA Department of ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Stabler - Lx 185/209 2003<br />

3.6.2 Structural relati<strong>on</strong>s<br />

(32) Many <strong>of</strong> the structural properties that linguists look for are expressed as relati<strong>on</strong>s am<strong>on</strong>g the nodes<br />

in a tree. Here, we make a first pass at defining some <strong>of</strong> these relati<strong>on</strong>s. The following definiti<strong>on</strong>s all<br />

identify a node just by its label.<br />

So for example, with the definiti<strong>on</strong> just below, we will be able to prove that ip is the root <strong>of</strong> a tree even<br />

if that tree also c<strong>on</strong>tains ip c<strong>on</strong>stituents other than the root. We postp<strong>on</strong>e the problem <strong>of</strong> identifying<br />

nodes uniquely, even when their labels are not unique.<br />

(33) The relati<strong>on</strong> between a tree and its root has a trivial definiti<strong>on</strong>:<br />

root(A,A/L).<br />

(34) Now c<strong>on</strong>sider the parent relati<strong>on</strong> in trees. Using our notati<strong>on</strong>, it can also be defined very simply, as<br />

follows:<br />

parent(A,B,A/L) :- member(B/_,L).<br />

parent(A,B,_/L) :- member(Tree,L), parent(A,B,Tree).<br />

(35) Dominati<strong>on</strong> is the transitive closure <strong>of</strong> the parent relati<strong>on</strong>. Notice how the following definiti<strong>on</strong> avoids<br />

left recursi<strong>on</strong>. And notice that, since no node is a parent <strong>of</strong> itself, no node dominates itself. C<strong>on</strong>sequently,<br />

we also define dominates_or_eq, which is the reflexive, transitive closure <strong>of</strong> the parent<br />

relati<strong>on</strong>. Every node, in every tree stands in the dominates_or_eq relati<strong>on</strong> to itself:<br />

dominates(A,B,Tree) :- parent(A,B,Tree).<br />

dominates(A,B,Tree) :- parent(A,C,Tree), dominates(C,B,Tree).<br />

dominates_or_eq(A,A,_).<br />

dominates_or_eq(A,B,Tree) :- dominates(A,B,Tree).<br />

(36) We now define the relati<strong>on</strong> between subtrees and the tree that c<strong>on</strong>tains them:<br />

subtree(T/Subtrees,T/Subtrees).<br />

subtree(Subtree,_/Subtrees) :- member(Tree,Subtrees),subtree(Subtree,Tree).<br />

(37) A is a sister <strong>of</strong> B iff A and B are not the same node, and A and B have the same parent.<br />

Notice that, with this definiti<strong>on</strong>, no node is a sister <strong>of</strong> itself. To implement this idea, we use the important<br />

relati<strong>on</strong> select, whichissort<strong>of</strong>likemember, except that it removes a member <strong>of</strong> a list and<br />

returns the remainder in its third argument. For example, with the following definiti<strong>on</strong>, we could prove<br />

select(b,[a,b,c],[a,c]).<br />

sisters(A,B,Tree) :subtree(_/Subtrees,Tree),<br />

select(A/_,Subtrees,Remainder),<br />

member(B/_,Remainder).<br />

select(A,[A|Remainder],Remainder).<br />

select(A,[B|L],[B|Remainder]) :- select(A,L,Remainder).<br />

(38) Various “command” relati<strong>on</strong>s play a very important role in recent syntax. Let’s say that A c-commands<br />

B iff A is not equal to B, neither dominates the other, and every node that dominates A dominates B. 16<br />

This is equivalent to the following more useful definiti<strong>on</strong>:<br />

16 This definiti<strong>on</strong> is similar to the <strong>on</strong>e in Koopman and Sportiche (1991), and to the IDC-command in Barker and Pullum (1990). But<br />

notice that our definiti<strong>on</strong> is irreflexive – for us, no node c-commands itself.<br />

51

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!