Information Technology Reference
In-Depth Information
But the lexicon and the world model have very different purposes:
The lexicon describes the words being used (like the English
word
hat
).
The world model describes the facts in the world (like the
concept
of a hat).
The world model itself is intended to be language-neutral. Constants and predicates
like
red
and
size
are used in it, but just for convenience. As mentioned, Prolog
would work the same on these if they were named
property19
and
concept42
. But
the lexicon is about the
actual words
, so there it is important to use constants that
correspond exactly to English (as the first argument to the lexicon predicates).
As a general rule, it is a good idea to distinguish between the world model and the
lexicon for these two reasons:
Different words may be used for the same concept, as in the following:
-
Synonyms
common_noun(cap,X) :- hat(X).
common_noun(bonnet,X) :- hat(X).
-
Other languages
common_noun(chapeau,X) :- hat(X).
% French
common_noun(cappello,X) :- hat(X).
% Italian
The same word may be used for different concepts, as in the following:
common_noun(cap,X) :- hat(X).
common_noun(cap,X) :- bottle_top(X).
common_noun(cap,X) :- regulated_maximum(X).
How does the lexicon work? It will be used by a
parser
to identify word categories
and locate objects in the world model. For example, parsing the noun phrase
a red
hat
will use the lexicon and end up with the query
color(X,red), hat(X).
for which there are two answers in the world model,
X=hat01
and
X=hat03
. Parsing
the noun phrase
a red hat on a man
will result in the query
color(X,red), hat(X), on(X,Y), person(Y), sex(Y,male).
which has a unique answer,
X=hat01
. Note that the predicate
preposition
here deals
with two objects: the
X
is the object that is
on
the other (namely, the hat), and the
Y
is
the object that has something on it (namely, the man).