• Tidak ada hasil yang ditemukan

METAVARIABLES ANO BINDING

Dalam dokumen lment of the Requirements for the Degree of (Halaman 114-118)

environment of the parser, it can introduce arbitrary side effects.

However, this is generally not useful, and it is very harmful to the notion of I i ngu is tic s true ture imposed by an exp I i c i t grammar.

Efficiency considerations sometimes dictate such a use of condition functions: scanning a ~tring of digits and converting them to a

<number>, and a simple lexical analysis of the input string are two common uses of condition functions with significant side effects.

Topic ·of works by each linguistic philosopher?

In our actual BIBLIO, the simi·lar query

Topic of works by

I

inguistic philosophers?

evokes a list of subjects,

_

undifferentiated by affiliation with the various

I

inguistic philosophers from which they were derived.* The more demanding first query requests exa~tly such an affiliation.

We wi 11 not change BIBLIO to include the hand

I

ing of quantifiers, but it is illustrative to see how that would be done.

Within the interpretation scheme presented above, every phrase must have a unique meaning, represented by an object.

Presuming that the query

parses according to the fol lowing structure,

<sentence>

<query>

<q_subject>

<q_publ ication>

<q_author>

<q_author>

Topic of works by

_

each linguistic philosopher?

the q_author phrase "each

I

inguistic philosopher" must differ sufficiently from "linguistic philosopher" that subsequent semantic functions which compute the topics of works by these authors keep

*Rec a

I I

that

II I

i ngu is tic phi

I

osophers" has been introduced

by

define

I

inguistic philosophers= author of A-quality works B-

relevant to

I

inguistic philosophy

separate accounts for each autlicr. That is a significant comp I ication of both the data types and semantic functions which implement these notions. In BIBLIO, the required effort for these capabilities is unwarranted.*

Alternately, we would like to view the phrase "each linguistic philosopher" as a metavariable for ·<q_author>, and then evaluate the whole query in turn for each individual "I inguistic philosopher". The me ta var i ab I e , as we d i s cussed i n Ch apter I Y, has a par 't ~ speech , i n this case <author>, and a range, in this case a 11 Ii ngu i st i c p h i I o sop hers • The me ta var i ab I e acts as a p I a c eho I de r for i t s par

t

o f speech in the syntactic analysis, and its range defines the set of semantic values to which it may be bound.

Me tavar i ab I es act much Ii ke var i ab I es of the I ambda ca I cu I us, raising corresponding issues of binding. Metavariables are created by grammar rules which invoke the standard condition function metavar.

In

our hypothetical extension to BIBLIO, we would include the rule variable_author rule <q_author> :metavar:= 'each' <q_author>

The grammar rule must have exactly one non-terminal in the lhs and at most one in the rhs. The part of speech of the lhs non-terminal becomes the part of speech of the created hletavar i ab I e, and the rhs phrase

*Bid contrast, such a quantification capability is so important in REL English that the suggested complication is incorporated. From efficiency cons i dera ti ans, the quantifier scheme using metavar i ab I es (be I 01--1) is unacceptable in REL English [Greenfeld

1972].

becomes its range. If the rhs consists of all terminals, the range is nil. The metavariable is also given a name, to allow several metavariables with the same parts of speech and range to be distinguished.* The name contains the literal characters which make up

the rhs.

In

LWL,

the use of metavar i ab I es is not predetermined by the I anguage processor. However, in any mean i ngfu I use, no metavar i ab I es may be· free in a <sentence>. Every phrase, some of· whose canst i tuents e i ther are me tavar i ab I es or have unbound me ta var i ab I es, is said to have those metavariables free in it. The parser maintains, for each phrase, a variable I ist of its free metavariables, The standard function. me tab ind binds a 11 free metavar i ab I es in its I hs phrase; thus, the expanded BIBLIO would have the rule

subject_query rule <query> :metabind:= <q_subject>

{,format_al !_subjects}

which would bind the metavariables created by every "each" to the function which computes the meaning of <query>. In a semantic function, the standard function ~_bound tel Is the number of metavariables bound in this ph_rase, and the function metabound { i) re turns pointers to the n_bound variable phrases in the variable I ist. The semantics of this rule, format_al !_subjects, is a prefix function. It would evaluate its

*LWL' s notion of metavar i ab I es is imp I emented in terms of the above me tavar i ab I e capab i Ii ti es of the I anguage processor, a I though by a different condition function than metavar. The name permits the 111" and

112" to be distinguished in define

"1

11 % 11

2

11 = {"l"+ "2") *

{"1

11 -

"2"}

<q_subject> constituent phrase for al I possible combinations of values from each of its n_bound metavariables. Format_all_subjects would use the standard function evaluate, with an additional parameter that would be a Ii st of phrases to be substituted for the various metavar i ab I es bound in the phrase.

The evaluation mechanism, including the binding and instantiation of metavariables, is complex. Because only the creation and binding of me tavar i ab I es is known to the I anguage processor and their use is left to the individual language implementor, metavariables serve a large variety of functions. The above example of quantification is one, and the use of metavariables in the

LWL

definitional mechanism ls another. A complete discussion is beyond the scope of this presentation; for more deta·i I, refer to [Thompson 1974b].

Dalam dokumen lment of the Requirements for the Degree of (Halaman 114-118)