<ulclass="crumbs"><li><ahref="../webs.html">Source</a></li><li><ahref="../compiler.html">Compiler Modules</a></li><li><ahref="index.html">core</a></li><li><ahref="index.html#11">Chapter 11: Predicate Calculus</a></li><li><b>Sentence Conversions</b></li></ul><pclass="purpose">The third of the three sources of propositions to conjure with: those which arise by the parsing of complex sentence trees in the S-grammar.</p>
<ulclass="toc"><li><ahref="#SP1">§1. The meaning of a sentence</a></li><li><ahref="#SP1_14">§1.14. Simplification</a></li><li><ahref="#SP3">§3. The meaning of a noun phrase</a></li></ul><hrclass="tocbar">
<pclass="inwebparagraph"><aid="SP1"></a><b>§1. The meaning of a sentence. </b>This section provides a single, but crucial, function to the rest of Inform:
it takes a sentence subtree output by the S-parser and turns it into a proposition.
</p>
<pclass="inwebparagraph">The sentence subtree can be headed by either a <codeclass="display"><spanclass="extract">SV_NT</span></code>, representing a
whole sentence, which we turn into a proposition with no free variables; or by
an <codeclass="display"><spanclass="extract">SN_NT</span></code>, representing a description which includes a relative clause,
such as "an animal which can see the player". In this section we will loosely
refer to the text parsed by either sort of subtree as the "sentence".
</p>
<pclass="inwebparagraph">The basic idea is simple. The sentence will have a verb phrase (VP), together
with two noun phrases: a subject phrase (SP) and object phrase (OP). English
is an SVO language, so phrases (usually) occur in the sequence SP-VP-OP.
In "Katy examines the painting", "Katy" is the SP and "painting" is
the OP. (Although the subject is sometimes the more active participant, that
isn't always the case: in "the painting is examined by Katy", "the painting"
is now the SP. The subject is what the sentence talks about.) At this point
in the program, the S-parser has turned the sentence into a neat tree structure
identifying the SP, VP and OP. We need to find meanings for the SP, VP and OP
independently, and then combine these into a single proposition representing
<spanclass="reserved">int</span><spanclass="plain"></span><spanclass="identifier">conv_log_depth</span><spanclass="plain"> = </span><spanclass="constant">0</span><spanclass="plain">; </span><spanclass="comment">recursion depth: used only to clarify the debugging log</span>
<<spanclass="cwebmacro">Check the tree position makes sense, and tell the debugging log</span><spanclass="cwebmacronumber">1.1</span>><spanclass="plain">;</span>
<<spanclass="cwebmacro">Handle a THERE subtree, used for "there is/are NP"</span><spanclass="cwebmacronumber">1.3</span>><spanclass="plain">;</span>
<<spanclass="cwebmacro">Find meaning of the VP as a relation and a parity</span><spanclass="cwebmacronumber">1.4</span>><spanclass="plain">;</span>
<<spanclass="cwebmacro">Find meanings of the SP and OP as propositions and terms</span><spanclass="cwebmacronumber">1.8</span>><spanclass="plain">;</span>
<<spanclass="cwebmacro">Bind up any free variable in the OP and sometimes the SP, too</span><spanclass="cwebmacronumber">1.9</span>><spanclass="plain">;</span>
<<spanclass="cwebmacro">Combine the SP, VP and OP meanings into a single proposition for the sentence</span><spanclass="cwebmacronumber">1.13</span>><spanclass="plain">;</span>
<spanclass="plain">}</span>
<<spanclass="cwebmacro">Simplify the resultant proposition</span><spanclass="cwebmacronumber">1.14</span>><spanclass="plain">;</span>
<<spanclass="cwebmacro">Tell the debugging log what the outcome of the sentence was</span><spanclass="cwebmacronumber">1.2</span>><spanclass="plain">;</span>
<pclass="endnote">The function Calculus::Propositions::FromSentences::S_subtree is used in 10/varc (<ahref="10-varc.html#SP13_3">§13.3</a>, <ahref="10-varc.html#SP13_4">§13.4</a>).</p>
<pclass="endnote">This code is used in <ahref="#SP1_4">§1.4</a>.</p>
<pclass="inwebparagraph"><aid="SP1_5"></a><b>§1.5. </b>First Rule. The "meaning" of a noun phrase is a pair (φ, t),
where φ is a proposition and t is a term. We read this as "t such
that φ is true". Exactly one of the following will always be true:
</p>
<ulclass="items"><li>(a) If the NP talks about a single definite thing C, then t=C and φ = T,
the empty proposition.
</li><li>(b) If the NP talks about a single definite thing C but imposes conditions about its current
situation, then t=v for some variable v and φ = ∃ v: is(v, C)∧ψ
where ψ is a description of the conditions with no free variables and which
does not use v.
</li><li>(c) If the NP talks about a single but vague thing, identifying it only by its
current situation, then t=v for some variable v and φ is a proposition having
v as its unique free variable.
</li><li>(d) If the NP talks about a range, number or proportion of things, then t=v
for some variable v and φ = Qv : v∈{ v| ψ(v)}, where
v is the unique free variable of ψ, and Q is a generalised quantifier which
is not ∃.
</li></ul>
<pclass="inwebparagraph"><aid="SP1_6"></a><b>§1.6. </b>As examples of all four cases:
</p>
<ulclass="items"><li>(a) "Reverend Green" returns t=<codeclass="display"><spanclass="extract">Green</span></code>, φ = T — a single definite thing.
</li><li>(b) "Colonel Mustard in the Library" returns t=x such that
φ = ∃ x: is(x, <codeclass="display"><spanclass="extract">Mustard</span></code>)∧in(<codeclass="display"><spanclass="extract">Mustard</span></code>, <codeclass="display"><spanclass="extract">Library</span></code>) — a single definite
thing but subject to conditions.
</li><li>(c) "A suspect carrying the lead piping" returns t=x and
φ = suspect(x)∧carries(x, <codeclass="display"><spanclass="extract">piping</span></code>) — a single but vague thing.
</li><li>(d) "All the weapons in the Billiard Room" returns t=x and
<pclass="inwebparagraph"><aid="SP1_7"></a><b>§1.7. </b>Thus φ can contain at most 1 free variable, and then only in case (c).
But why does it do so at all? Why do we return "an open door" as
open(x)∧door(x)? It would be more consistent with the way we
handle "two open doors" to return it as ∃ x: open(x)∧door(x).
The answer is that if we were only parsing whole sentences (SV-trees) then
it would make no difference, because x ends up bound by ∃ x
anyway when the final sentence is being put together. But we also want to
parse descriptions. Consider:
</p>
<blockquote>
<p>(1) let L be the list of open doors in the Dining Room;</p>
</blockquote>
<blockquote>
<p>(2) let L be the list of two open doors in the Dining Room;</p>
</blockquote>
<pclass="inwebparagraph">Here (1) is legal in Inform, (2) is not, because it implies a requirement about
the list which will probably not be satisfied. (Maybe there are three open
doors there, maybe none.) In case (1), <codeclass="display"><spanclass="extract">NPstp</span></code> applied to "open doors" will
return open(x)∧door(x), whose free variable x can
become any single object we might want to test for open-door-ness. But in
case (2), <codeclass="display"><spanclass="extract">NPstp</span></code> applied to "two open doors" will return
V_{=2} x: open(x)∧door(x), and here x is bound, and
can't be set equal to some object being tested.
</p>
<pclass="inwebparagraph">Or to put this more informally: it's possible for a single item to be an
"open door", but it's not possible for a single item to be (say) "more
than three open doors". So φ contains a free variable if and only if
the NP describes a single but vague thing.
</p>
<pclass="inwebparagraph"><aid="SP1_8"></a><b>§1.8. </b>The First Rule is implemented by <codeclass="display"><spanclass="extract">Calculus::Propositions::FromSentences::NP_subtree_to_proposition</span></code> below, and
we apply it independently to the SP and OP:
</p>
<pclass="macrodefinition"><codeclass="display">
<<spanclass="cwebmacrodefn">Find meanings of the SP and OP as propositions and terms</span><spanclass="cwebmacronumber">1.8</span>> =
<pclass="endnote">This code is used in <ahref="#SP1">§1</a>.</p>
<pclass="inwebparagraph"><aid="SP1_10"></a><b>§1.10. </b>Of all the thousands of paragraphs of code in Inform, this is the one which
most sums up "how it works". We started with a sentence in
the source text, and have now extracted the following components of its
meaning: the subject phrase (SP) has become the term t_S subject to the
proposition φ_S being true; the object phrase (OP) is similarly now a
pair t_O such that φ_O. From the verb phrase (VP), we have found a
binary relation B, meant either in a positive sense (B does hold) or a
negative one (it doesn't). And now:
</p>
<pclass="inwebparagraph">Second Rule. The combined "meaning" Σ is as follows:
</p>
<ulclass="items"><li>(1) if we are parsing a whole sentence (i.e., an SV-subtree), or φ_S is
not in the form Q x∈{ x|θ(x)}, then:
Σ = φ_S ∧ φ'_O ∧ B(t_S, t'_O)
if the sense is positive, or
φ_S ∧ ¬(φ'_O ∧ B(t_S, t'_O))
if not.
</li><li>(2) if we are parsing a relative clause (i.e., an SN-subtree), and φ_S is of the form
Q x∈{ x|θ(x)}, then:
Σ = Q x∈{ x|θ(x) ∧ φ'_O ∧ B(t_S, t'_O)}
if the sense is positive, or
Q x∈{ x|θ(x) ∧ ¬(φ'_O ∧ B(t_S, t'_O))
if not. Here φ'_O and t'_O are φ_O and t_O modified to relabel its
variables so that there are no accidental clashes with variables named in
φ_S.
</li></ul>
<pclass="inwebparagraph"><aid="SP1_11"></a><b>§1.11. </b>That simple rule took the author a long, long time to work out,
so it may be worth a little discussion:
</p>
<pclass="inwebparagraph"></p>
<ulclass="items"><li>(a) The Second Rule is a generalisation of the way comparison operators like
<codeclass="display"><spanclass="extract">==</span></code> or <codeclass="display"><spanclass="extract">>=</span></code> work in conventional programming languages. For if
t_S and t_O are both constants, and φ_S and φ_O both
empty, we obtain just B(t_S, t_O) and ¬(B(t_S, t_O)). For instance,
"score is 10" becomes just is(<codeclass="display"><spanclass="extract">score</span></code>, 10), which compiles just to
Note that these formulae are identical except for what we might call punctuation.
</li><li>(e) The modification needed to make φ'_O out of φ_O is pretty well
inconsequential. It makes no difference to the meaning of φ_O.
Consider the example "a woman is carrying an animal" once again.
t_S = x and φ_S = woman(x), which use x; and on the other
hand t_O = x and φ_O = animal(x), which also use x. Clearly
we don't mean the same x on both sides, so we relabel the OP to get y
such that animal(y). There is not really any asymmetry between the
SP and OP here, because it would have been just as good to relabel the SP.
</li></ul>
<pclass="inwebparagraph"><aid="SP1_12"></a><b>§1.12. </b>Lemma. The result Σ of the Second Rule is a proposition containing
either 0 or 1 free variables; Σ has 1 free variable if and only if we
are converting an SN-subtree, and the subject phrase of the sentence describes
a single thing vaguely.
</p>
<pclass="inwebparagraph">Proof. φ_O contains no free variables, since we bound it up above,
and the same must be true of its relabelled version φ'_O. If we have
an SV-subtree then φ_S similarly contains no free variables; we only
leave it unbound for an SN-subtree. In that case, the First Rule tells us that
it has a free variable if and only if the SP describes a single thing vaguely.
The only other content of Σ is the predicate B(t_S, t'_O), so extra
free variables can only appear if either t_S or t'_O contains a variable
not already seen in φ_S and φ'_O. But cases (b), (c) and (d) of
the First Rule make clear that in any pair (t, φ) arising from a noun
phrase, either t is a constant or else it is a variable appearing in φ.
So the terms of the final B predicate in Σ cannot add new free
variables, and the lemma is proved.
</p>
<pclass="inwebparagraph">By similar argument, if φ_S and φ_O are well-formed propositions
(syntactically valid and using variables either freely or within the scope
of quantification) then so is Σ.
</p>
<pclass="inwebparagraph"><aid="SP1_13"></a><b>§1.13. </b>Now to implement the Second Rule:
</p>
<pclass="macrodefinition"><codeclass="display">
<<spanclass="cwebmacrodefn">Combine the SP, VP and OP meanings into a single proposition for the sentence</span><spanclass="cwebmacronumber">1.13</span>> =
<<spanclass="cwebmacro">Deal with the English irregularity concerning -where words</span><spanclass="cwebmacronumber">1.13.1</span>><spanclass="plain">;</span>
<spanclass="identifier">LOGIF</span><spanclass="plain">(</span><spanclass="identifier">PREDICATE_CALCULUS</span><spanclass="plain">, </span><spanclass="string">"[%d] Before renumbering of OP: t = $0, phi = $D\n"</span><spanclass="plain">, </span><spanclass="identifier">conv_log_depth</span><spanclass="plain">, &</span><spanclass="identifier">object_phrase_term</span><spanclass="plain">, </span><spanclass="identifier">object_phrase_prop</span><spanclass="plain">);</span>
<spanclass="reserved">if</span><spanclass="plain"> (</span><spanclass="identifier">object_phrase_term</span><spanclass="plain">.</span><spanclass="element">variable</span><spanclass="plain">>= </span><spanclass="constant">26</span><spanclass="plain">) </span><spanclass="identifier">internal_error</span><spanclass="plain">(</span><spanclass="string">"bad OP renumbering"</span><spanclass="plain">);</span>
<spanclass="identifier">LOGIF</span><spanclass="plain">(</span><spanclass="identifier">PREDICATE_CALCULUS</span><spanclass="plain">, </span><spanclass="string">"[%d] After renumbering of OP: t = $0, phi = $D\n"</span><spanclass="plain">, </span><spanclass="identifier">conv_log_depth</span><spanclass="plain">, &</span><spanclass="identifier">object_phrase_term</span><spanclass="plain">, </span><spanclass="identifier">object_phrase_prop</span><spanclass="plain">);</span>
<pclass="endnote">This code is used in <ahref="#SP1_13">§1.13</a>.</p>
<pclass="inwebparagraph"><aid="SP1_14"></a><b>§1.14. Simplification. </b>Every proposition generated here, whether it arises as "there is/are" plus a
noun phrase or by the Second Rule, is simplified before being returned.
Because of the way the recursion is set up, this means that intermediate
propositions for relative clauses within a sentence are always simplified
before being used to build the whole sentence.
</p>
<pclass="inwebparagraph">What happens here is that we try a sequence of tactical moves to change
the proposition for the better — which usually means eliminating bound
variables, where we can: they are a bad thing because they compile to loops
which may be slow and awkward to construct.
</p>
<pclass="inwebparagraph">Simplifications are allowed to change Σ — indeed that's the whole
idea — but not t_S, the term representing what the sentence talks about.
(Indeed, they aren't even shown what it is.) Moreover, a simplification can
only turn Σ to Σ' if:
</p>
<pclass="inwebparagraph"></p>
<ulclass="items"><li>(i) Σ' remains a syntactically correct proposition with well-formed
quantifiers,
</li><li>(ii) Σ' has the same number of free variables as Σ, and
</li><li>(iii) in all situations and for all possible values of any free variables,
Σ' is true if and only if Σ is.
</li></ul>
<pclass="inwebparagraph">Rules (i) and (ii) are checked as we go, with internal errors thrown if ever
they should fail; the checking takes only a trivial amount of time, and I
generally agree with Tony Hoare's maxim that removing checks like this
in the program as shipped to users is like wearing a life-jacket while
learning to sail on dry land, and then taking it off when going to sea.
Still, rule (iii) can only be ensured by writing the routines carefully.
</p>
<pclass="inwebparagraph">The simplification routines can all be found in "Simplifications".
<spanclass="identifier">LOG</span><spanclass="plain">(</span><spanclass="string">"Failed after applying %s: $D"</span><spanclass="plain">, #</span><spanclass="identifier">simp</span><spanclass="plain">, </span><spanclass="identifier">proposition</span><spanclass="plain">);</span>
<spanclass="identifier">internal_error</span><spanclass="plain">(#</span><spanclass="identifier">simp</span><spanclass="plain"></span><spanclass="string">" simplified proposition into one which is not well-formed"</span><spanclass="plain">);</span>
<spanclass="plain">}</span>
<spanclass="plain">}</span>
</pre>
<pclass="macrodefinition"><codeclass="display">
<<spanclass="cwebmacrodefn">Simplify the resultant proposition</span><spanclass="cwebmacronumber">1.14</span>> =
<spanclass="identifier">LOG</span><spanclass="plain">(</span><spanclass="string">"Failed before simplification: $D"</span><spanclass="plain">, </span><spanclass="identifier">sentence_prop</span><spanclass="plain">);</span>
<spanclass="identifier">internal_error</span><spanclass="plain">(</span><spanclass="string">"tried to simplify proposition which is not well-formed"</span><spanclass="plain">);</span>
<spanclass="functiontext">Calculus::Variables::renumber</span><spanclass="plain">(</span><spanclass="identifier">sentence_prop</span><spanclass="plain">, </span><spanclass="identifier">NULL</span><spanclass="plain">); </span><spanclass="comment">just for the sake of tidiness</span>
<spanclass="functiontext">Calculus::Variables::renumber</span><spanclass="plain">(</span><spanclass="identifier">sentence_prop</span><spanclass="plain">, </span><spanclass="identifier">NULL</span><spanclass="plain">); </span><spanclass="comment">just for the sake of tidiness</span>
<pclass="endnote">The function Calculus::Propositions::FromSentences::simplify appears nowhere else.</p>
<pclass="inwebparagraph"><aid="SP3"></a><b>§3. The meaning of a noun phrase. </b>The First Rule tells us to translate a noun phrase (NP) into a pair of a term t
and a proposition φ. We read this as "t such that φ is true".
</p>
<pclass="inwebparagraph">For reasons explained below, a small amount of context is supplied: if the
term will need to have a particular kind of value, then that kind is given
to us. (But if it only needs to be an object, or if we don't know anything
about its kind, the <codeclass="display"><spanclass="extract">K</span></code> argument will be <codeclass="display"><spanclass="extract">NULL</span></code>.)
</p>
<pclass="inwebparagraph">As can be seen, an NP subtree consists either of an SN subtree representing
two further NPs joined by a verb to make a relative clause, or one of
three basic noun phrases: a value, a description, or a marker for an implied
<spanclass="reserved">if</span><spanclass="plain"> (</span><spanclass="functiontext">Specifications::is_description_like</span><spanclass="plain">(</span><spanclass="identifier">p</span><spanclass="plain">)) </span><<spanclass="cwebmacro">This NP was parsed as a description</span><spanclass="cwebmacronumber">3.4</span>>
<spanclass="reserved">else</span><spanclass="plain"></span><spanclass="reserved">if</span><spanclass="plain"> (</span><spanclass="identifier">ParseTree::get_type</span><spanclass="plain">(</span><spanclass="identifier">p</span><spanclass="plain">) == </span><spanclass="constant">UNKNOWN_NT</span><spanclass="plain">) </span><<spanclass="cwebmacro">This NP is only a ghostly presence</span><spanclass="cwebmacronumber">3.5</span>>
<spanclass="reserved">else</span><spanclass="plain"></span><<spanclass="cwebmacro">This NP was parsed as a value</span><spanclass="cwebmacronumber">3.3</span>><spanclass="plain">;</span>
<spanclass="plain">}</span>
<<spanclass="cwebmacro">If we have a single adjective which could also be a noun, and a value is required, convert it to a noun</span><spanclass="cwebmacronumber">3.6</span>><spanclass="plain">;</span>
<<spanclass="cwebmacro">If we have a constant qualified by a substantive proposition, rewrite in terms of variable</span><spanclass="cwebmacronumber">3.7</span>><spanclass="plain">;</span>
<<spanclass="cwebmacro">Close any open domain group</span><spanclass="cwebmacronumber">3.8</span>><spanclass="plain">;</span>
<<spanclass="cwebmacro">Verify that the output satisfies the First Rule, throwing internal errors if not</span><spanclass="cwebmacronumber">3.2</span>><spanclass="plain">;</span>
<pclass="endnote">The function Calculus::Propositions::FromSentences::NP_subtree_to_proposition is used in <ahref="#SP1_8">§1.8</a>, <ahref="#SP3_1">§3.1</a>.</p>
<pclass="inwebparagraph"><aid="SP3_1"></a><b>§3.1. </b>Just as for SV-subtrees, we tell the debugging log at the start...
</p>
<pclass="macrodefinition"><codeclass="display">
<<spanclass="cwebmacrodefn">Tell the debugging log about the NP-subtree</span><spanclass="cwebmacronumber">3.1</span>> =
<pclass="endnote">This code is used in <ahref="#SP3">§3</a>.</p>
<pclass="inwebparagraph"><aid="SP3_2"></a><b>§3.2. </b>...and also at the end.
</p>
<pclass="macrodefinition"><codeclass="display">
<<spanclass="cwebmacrodefn">Verify that the output satisfies the First Rule, throwing internal errors if not</span><spanclass="cwebmacronumber">3.2</span>> =
<spanclass="reserved">if</span><spanclass="plain"> (</span><spanclass="identifier">NF</span><spanclass="plain">>= </span><spanclass="constant">2</span><spanclass="plain">) </span><spanclass="identifier">internal_error</span><spanclass="plain">(</span><spanclass="string">"two or more free variables from NP"</span><spanclass="plain">);</span>
<spanclass="reserved">if</span><spanclass="plain"> (</span><spanclass="identifier">NP_prop</span><spanclass="plain">) </span><spanclass="identifier">internal_error</span><spanclass="plain">(</span><spanclass="string">"constant plus substantive prop from NP"</span><spanclass="plain">);</span>
<spanclass="identifier">internal_error</span><spanclass="plain">(</span><spanclass="string">"free variable from NP but not the preferred term"</span><spanclass="plain">);</span>
<pclass="endnote">This code is used in <ahref="#SP3">§3</a>.</p>
<pclass="inwebparagraph"><aid="SP3_3"></a><b>§3.3. </b>Here we find a constant C and return t=C with a null φ, except
in one case: where C is the name of an either/or property, such as
"closed". In the context of a value, this is a noun — it identifies
which property we are talking about — and this is why
<codeclass="display"><spanclass="extract">ExParser::Conversion::VAL_subtree_to_spec</span></code> returns it as a constant. But inside a sentence, it
has to be considered an adjective, so rather than returning t = <codeclass="display"><spanclass="extract">closed</span></code>,
φ = T, we return t=x and φ = closed(x). If we didn't do
this, text like "the trapdoor is closed" would translate to the
proposition is(<codeclass="display"><spanclass="extract">trapdoor</span></code>, <codeclass="display"><spanclass="extract">closed</span></code>), which would then fail in
type-checking.
</p>
<pclass="inwebparagraph">(Note that this is a different sort of noun/adjective ambiguity than the
one arising below, which is to do with enumerated value properties.)
</p>
<pclass="macrodefinition"><codeclass="display">
<<spanclass="cwebmacrodefn">This NP was parsed as a value</span><spanclass="cwebmacronumber">3.3</span>> =
<pclass="endnote">This code is used in <ahref="#SP3">§3</a>.</p>
<pclass="inwebparagraph"><aid="SP3_4"></a><b>§3.4. </b>If <codeclass="display"><spanclass="extract">Calculus::Propositions::from_spec</span></code> is given a constant value C then it returns the
proposition is(x, C): we look out for this and translate it to
t=C, φ = T. Otherwise, φ can be exactly the proposition returned,
and the first term occurring in it will be chosen as the subject t. (In
particular, if φ opens with a quantifier then t will be the variable
it binds.)
</p>
<pclass="macrodefinition"><codeclass="display">
<<spanclass="cwebmacrodefn">This NP was parsed as a description</span><spanclass="cwebmacronumber">3.4</span>> =
<pclass="endnote">This code is used in <ahref="#SP3">§3</a>.</p>
<pclass="inwebparagraph"><aid="SP3_5"></a><b>§3.5. </b>When Inform reads a condition so abbreviated that both the subject and
the verb have been left out, it assumes the verb is "to be" and that the
subject will be whatever is being worked on. For instance,
</p>
<blockquote>
<p>if an unlocked container, ...</p>
</blockquote>
<pclass="inwebparagraph">is read as the verb phrase "is" with <codeclass="display"><spanclass="extract">ABSENT_SUBJECT_NT</span></code> as SP
and "an unlocked container" as OP.
</p>
<pclass="inwebparagraph"><codeclass="display"><spanclass="extract">ABSENT_SUBJECT_NT</span></code> nodes are easy to deal with since they translate to the I6
variable <codeclass="display"><spanclass="extract">self</span></code> in the final compiled code; the <codeclass="display"><spanclass="extract">Rvalues::new_self_object_constant</span></code> routine
returns a specification which refers to this. From a predicate
calculus point of view, this is just another constant.
</p>
<pclass="macrodefinition"><codeclass="display">
<<spanclass="cwebmacrodefn">This NP is only a ghostly presence</span><spanclass="cwebmacronumber">3.5</span>> =
<pclass="endnote">This code is used in <ahref="#SP3">§3</a>.</p>
<pclass="inwebparagraph"><aid="SP3_6"></a><b>§3.6. </b>Suppose we have a situation like this:
</p>
<blockquote>
<p>Texture is a kind of value. Rough, smooth and jagged are textures. A thing has a texture.</p>
</blockquote>
<blockquote>
<p>Feeling relates various rooms to one texture. The verb to feel (he feels) implies the feeling relation.</p>
</blockquote>
<pclass="inwebparagraph">and consider the sentences:
</p>
<blockquote>
<p>[1] the broken bottle is jagged [2] the Spiky Cavern feels jagged</p>
</blockquote>
<pclass="inwebparagraph">Now suppose we are working on the NP "jagged". In (1), it's an adjective: we
are talking about a quality of the bottle. But in (2), it's a noun: we are
establishing a relation between two values, the Cavern and the jagged texture.
</p>
<pclass="inwebparagraph">Up to this point, "jagged" will have produced t=x, φ=jagged(x)
in both cases — the adjectival reading of the word. The way we can tell if we
are in case (2) is if a value of a specific kind (and not an object) is
expected as the outcome. In the case of the equality relation used in (1),
"is", the terms can be anything; but in the case of the feeling relation
used in (2), the second term, corresponding to the noun phrase "jagged" in
this sentence, has to have the kind of value "texture". So we convert it
into noun form, and return t=<codeclass="display"><spanclass="extract">texture</span></code>, φ = T.
</p>
<pclass="inwebparagraph">(Note that this is a different sort of noun/adjective ambiguity than the
one arising above, which is to do with either/or properties.)
</p>
<pclass="inwebparagraph">Another case which can occur is:
</p>
<blockquote>
<p>the bottle provides the property closed</p>
</blockquote>
<pclass="inwebparagraph">where the presence of the words "the property" needs to alert us that
"closed" is a noun referring to the property itself, not to a nameless
object possessing that property. When the S-parser matches a property in
that way, it assigns a score value of <codeclass="display"><spanclass="extract">TRUE</span></code> to the relevant ML entry to
show this. (Score values otherwise aren't used for property names.)
</p>
<pclass="macrodefinition"><codeclass="display">
<<spanclass="cwebmacrodefn">If we have a single adjective which could also be a noun, and a value is required, convert it to a noun</span><spanclass="cwebmacronumber">3.6</span>> =
<<spanclass="cwebmacrodefn">If we have a constant qualified by a substantive proposition, rewrite in terms of variable</span><spanclass="cwebmacronumber">3.7</span>> =
<spanclass="string">"[%d] Rewriting qualified constant t = $0 (new var %d)\n"</span><spanclass="plain">, </span><spanclass="identifier">conv_log_depth</span><spanclass="plain">, </span><spanclass="identifier">subject_of_NP</span><spanclass="plain">, </span><spanclass="identifier">y</span><spanclass="plain">);</span>
<spanclass="reserved">if</span><spanclass="plain"> (</span><spanclass="identifier">nq</span><spanclass="plain"><</span><spanclass="constant">0</span><spanclass="plain">) </span><spanclass="identifier">internal_error</span><spanclass="plain">(</span><spanclass="string">"malformed proposition with too many domain ends"</span><spanclass="plain">);</span>
<pclass="endnote">This code is used in <ahref="#SP3">§3</a>.</p>
<hrclass="tocbar">
<ulclass="toc"><li><ahref="11-tc.html">Back to 'Tree Conversions'</a></li><li><ahref="11-sm.html">Continue with 'Simplifications'</a></li></ul><hrclass="tocbar">