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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Stabler - Lx 185/209 2003<br />

3.3 Recognizers: time and space<br />

Given a recognizer, a (propositi<strong>on</strong>al) grammar Γ ,andastrings ∈ Σ ∗ ,<br />

(7) a pro<strong>of</strong> that s has category c ∈ N has space complexity k iff the goals <strong>on</strong> the right side <strong>of</strong> the deducti<strong>on</strong><br />

(“the workspace”) never have more than k c<strong>on</strong>juncts.<br />

(8) For any string s ∈ Σ∗ , we will say that s has space complexity k iff for every category A, every pro<strong>of</strong><br />

that s has category A has space complexity k.<br />

(9) Where S is a set <strong>of</strong> strings, we will say S has space complexity k iff every s ∈ S has space complexity k.<br />

(10) Set S has (finitely) bounded memory requirements iffthereissomefiniteksuch that S has space<br />

complexity k.<br />

(11) The pro<strong>of</strong> that s has category c has time complexity k iff the number <strong>of</strong> pro<strong>of</strong> steps that can be taken<br />

from c is no more than k.<br />

(12) For any string s ∈ Σ∗ , we will say that s has time complexity k iff for every category A, every pro<strong>of</strong> that<br />

s has category A has complexity k.<br />

3.3.1 Basic properties <strong>of</strong> the top-down recognizer<br />

(13) The recogniti<strong>on</strong> method introduced last time has these derivati<strong>on</strong> rules:<br />

G, Γ ,S ⊢ G [axiom] for definite clauses Γ ,goalG, S ⊆ Σ ∗<br />

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

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

G, Γ ,pS ⊢ (?-p, C) [scan]<br />

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

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

To prove that a string s ∈ Σ ∗ has category a given grammar Γ , we attempt to find a deducti<strong>on</strong> <strong>of</strong> the<br />

following form, where [] is the empty string:<br />

goal theory resources workspace<br />

?-a , Γ , s ⊢ ?-a<br />

…<br />

?-a , Γ , [] ⊢ <br />

Since this defines a top-down recognizer, let’s call this logic TD.<br />

(14) There is exactly <strong>on</strong>e TD deducti<strong>on</strong> for each derivati<strong>on</strong> tree. That is: s ∈ yield(G,A) has n leftmost<br />

derivati<strong>on</strong>s from A iff there n TD pro<strong>of</strong>s that s has category A.<br />

(15) Every right branching RS ⊆ yield(G,A) has bounded memory requirements in TD.<br />

(16) No infinite left branching LS ⊆ yield(G,A) has bounded memory requirements in TD.<br />

(17) If there is any left recursive derivati<strong>on</strong> <strong>of</strong> s from A, then the problem <strong>of</strong> showing that s has category A<br />

has infinite space requirements in TD, and prolog may not terminate.<br />

44

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

Saved successfully!

Ooh no, something went wrong!