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 />

(9) Example: Let Γ be the following sequence <strong>of</strong> definite clauses:<br />

socrates_is_a_man.<br />

socrates_is_dangerous.<br />

socrates_is_mortal :- socrates_is_a_man.<br />

socrates_is_a_dangerous_man :socrates_is_a_man,<br />

socrates_is_dangerous.<br />

Clearly, we can prove socrates_is_mortal and socrates_is_a_dangerous_man.<br />

The pro<strong>of</strong> can be depicted with a tree like this:<br />

(10) Example: Ac<strong>on</strong>textfreegrammar<br />

where<br />

socrates_is_a_dangerous_man<br />

socrates_is_a_man socrates_is_dangerous<br />

G =〈Σ,N,→, S〉,<br />

1. Σ,N are finite, n<strong>on</strong>empty sets,<br />

2. S is some symbol in N,<br />

3. the binary relati<strong>on</strong> (→) ⊆ N × (Σ ∪ N) ∗ is also finite (i.e. it has finitely many pairs),<br />

For example,<br />

ip → dp i1 i1 → i0 vp i0 → will<br />

dp → d1 d1 → d0 np d0 → the<br />

np → n1 n1 → n0<br />

n1 → n0 cp<br />

n0 → idea<br />

vp → v1 v1 → v0 v0 → suffice<br />

cp → c1 c1 → c0 ip c0 → that<br />

Intuitively, if ip is to be read as “there is an ip,” and similarly for the other categories, then the rewrite<br />

arrow cannot be interpreted as implies, since there are alternative derivati<strong>on</strong>s. That is, the rules (n1 →<br />

n0) and (n1 → n0 cp) signify that a given c<strong>on</strong>stituent can be expanded either <strong>on</strong>e way or the other.<br />

In fact, we get an appropriate logical reading <strong>of</strong> the grammar if we treat the rewrite arrow as meaning<br />

“if.” With that reading, we can also express the grammar as a prolog theory.<br />

/*<br />

* file: th2.pl<br />

*/<br />

ip :- dp, i1. i1 :- i0, vp. i0 :- will. will.<br />

dp :- d1. d1 :- d0, np. d0 :- the. the.<br />

np :- n1. n1 :- n0. n0 :- idea. idea.<br />

n1 :- n0, cp.<br />

vp :- v1. v1 :- v0. v0 :- suffice. suffice.<br />

cp :- c1. c1 :- c0, ip. c0 :- that. that.<br />

In this theory, the propositi<strong>on</strong> idea can be read as saying that this word is in the language, and ip :dp,<br />

i1 says that ip is in the language if dp and i1 are. The propositi<strong>on</strong> ip follows from this theory.<br />

After loading this set <strong>of</strong> axioms, we can prove ?- ip. Finding a pro<strong>of</strong> corresp<strong>on</strong>ds exactly to finding a<br />

derivati<strong>on</strong> from the grammar.<br />

9

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

Saved successfully!

Ooh no, something went wrong!