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

(11) Predicate prolog<br />

language: atoms a ={a− z}{a − zA − Z0 − 9_} ∗ | ′ {a − zA − Z0 − 9_ @#$% ∗ ()} ∗′<br />

variables v ={A − Z_}{a − zA − Z0 − 9_} ∗<br />

terms T ::= v | a | a(S)| 0 − 9 +<br />

sequence <strong>of</strong> terms S ::= T | T,S (n.b. <strong>on</strong>e or more terms in the sequence)<br />

predicati<strong>on</strong>s p ::= a | a(S)<br />

c<strong>on</strong>juncti<strong>on</strong>s C ::= ɛ. | p, C<br />

goals G ::= ?-C<br />

definite clauses D ::= p:-C<br />

(Notati<strong>on</strong>) We write f n for an atom f that forms a term with a sequence <strong>of</strong> n terms as arguments. A term f 0 is<br />

an individual c<strong>on</strong>stant.<br />

We write pn for an atom p that forms a predicati<strong>on</strong> with a sequence <strong>of</strong> n termsasarguments. A0-place<br />

predicati<strong>on</strong> p0 is a propositi<strong>on</strong>.<br />

inference: G, Γ ⊢ G [axiom] for any set <strong>of</strong> definite clauses Γ and any goal G<br />

G, Γ ⊢ (?-p, C)<br />

G, Γ ⊢ (?-q1,...,qn,C)θ<br />

if (q:-q1,...,qn) ∈ Γ ,mgu(p,q)= θ<br />

N.B. For maximal generality, we avoid c<strong>on</strong>fusing any variables in the goal with variables in an axiom<br />

with the following policy: every time a definite clause is selected from Γ , rename all <strong>of</strong> its variables<br />

with variables never used before in the pro<strong>of</strong>. (Standard implemented prolog assigns these new<br />

variables numerical names, like _1295.)<br />

semantics: amodelM=〈E,2,[[·]]〉, where<br />

[[ fn ]] : En → E. Whenn = 0, [[ f0 ]] ∈ E.<br />

[[ pn ]] : En → 2. When n = 0, [[ p0 ]] ∈ 2.<br />

[[ v]] : [V → E] → E, such that for s : V → E, [[ v]] ( s ) = s(v).<br />

[[ fn (t1,...tn)]] : [V → E] → E, wherefors : V → E, [[ fn (t1,...,tn)]](s) = [[ fn ]] ( [[ t1]](s), . . . , [[tn]](s))<br />

[[ pn (t1,...,tn)]] : [V → E] → 2, where for s : V → E, [[ pn (t1,...,tn)]](s) = [[ pn ]] ( [[ t1]](s), . . . , [[tn]](s))<br />

[[ A, B]] : [V → E] → 2, where for s : V → E, [[ A, B]] ( s ) = min{[[ A]](s), [[B]](s))}.<br />

[[ ɛ ]] : [V → E] → 2, where for s : V → E, [[ ɛ ]] ( s ) = 1<br />

⎧<br />

⎨0<br />

if ∃s ∈ [V → E], [[A]] ( s ) = 1and[[ B]] ( s ) = 0<br />

[[ B:-A]] =<br />

⎩1<br />

otherwise<br />

[[ ?-A]] = 1 − min{[[ A]] ( s ) | s : V → E}<br />

metatheory: G, Γ ⊢ A iff G, Γ ⊨ A, for any goals G, A and any definite clause theory Γ .<br />

16

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

Saved successfully!

Ooh no, something went wrong!