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

In fact, there are infinitely many pro<strong>of</strong>s <strong>of</strong> ?- ip. The first pro<strong>of</strong> that prolog finds can be depicted with<br />

atreelikethis:<br />

1.3 Using prolog<br />

d0<br />

the<br />

dp<br />

d1<br />

np<br />

n1<br />

n0<br />

idea<br />

Here is a sessi<strong>on</strong> log, where I put the things I typed in bold:<br />

ip<br />

i0<br />

will<br />

1%pl<br />

Welcome to SWI-Prolog (Versi<strong>on</strong> 4.0.11)<br />

Copyright (c) 1990-2000 University <strong>of</strong> Amsterdam.<br />

Copy policy: GPL-2 (see www.gnu.org)<br />

For help, use ?- help(Topic). or ?- apropos(Word).<br />

?- write(’hello world’).<br />

hello world<br />

Yes<br />

?- halt.<br />

2%emacs test.pl<br />

3%cat test.pl<br />

% OK, a test<br />

p :- q,r.<br />

r :- s.<br />

q :- t.<br />

s.<br />

t.<br />

4%pl<br />

Welcome to SWI-Prolog (Versi<strong>on</strong> 4.0.11)<br />

Copyright (c) 1990-2000 University <strong>of</strong> Amsterdam.<br />

Copy policy: GPL-2 (see www.gnu.org)<br />

For help, use ?- help(Topic). or ?- apropos(Word).<br />

?- [test].<br />

% test compiled 0.00 sec, 1,180 bytes Yes<br />

?- listing.<br />

10<br />

i1<br />

vp<br />

v1<br />

v0<br />

suffice

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

Saved successfully!

Ooh no, something went wrong!