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

(6) Example. Let’s use g1.pl again:<br />

/*<br />

* file: g1.pl<br />

*/<br />

:- op(1200,xfx,:˜).<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 />

With this grammar and llp.pl we get the following sessi<strong>on</strong>:<br />

| ?- [llp,g1,pp_tree].<br />

{c<strong>on</strong>sulting /home/es/tex/185-00/llp.pl...}<br />

{c<strong>on</strong>sulted /home/es/tex/185-00/llp.pl in module user, 20 msec 2000 bytes}<br />

{c<strong>on</strong>sulting /home/es/tex/185-00/g1.pl...}<br />

{c<strong>on</strong>sulted /home/es/tex/185-00/g1.pl in module user, 20 msec 2384 bytes}<br />

{c<strong>on</strong>sulting /home/es/tex/185-00/pp_tree.pl...}<br />

{c<strong>on</strong>sulted /home/es/tex/185-00/pp_tree.pl in module user, 10 msec 1344 bytes}<br />

yes<br />

| ?- [the,idea,will,suffice] ?˜ [ip]@[T].<br />

T = ip/[dp/[d1/[d0/[the/[]],np/[n1/[...]]]],i1/[i0/[will/[]],vp/[v1/[v0/[...]]]]] ?<br />

yes<br />

| ?- ([the,idea,will,suffice] ?˜ [ip]@[T]), pp_tree(T).<br />

ip /[<br />

dp /[<br />

d1 /[<br />

d0 /[<br />

the /[]],<br />

np /[<br />

n1 /[<br />

n0 /[<br />

idea /[]]]]]],<br />

i1 /[<br />

i0 /[<br />

will /[]],<br />

vp /[<br />

v1 /[<br />

v0 /[<br />

suffice /[]]]]]]<br />

T = ip/[dp/[d1/[d0/[the/[]],np/[n1/[...]]]],i1/[i0/[will/[]],vp/[v1/[v0/[...]]]]] ?<br />

yes<br />

| ?-<br />

(7) Assessment <strong>of</strong> the LL strategy:<br />

a. Unbounded memory requirements <strong>on</strong> simple left branching.<br />

b. Stupid about left branches – recursi<strong>on</strong> in left branches produces infinite search spaces.<br />

79

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

Saved successfully!

Ooh no, something went wrong!