Information Technology Reference
In-Depth Information
Figure 8.4.
A world of people, parks, trees, hats
nldb.pl
person(john). person(george). person(mary). person(linda).
park(kew_beach). park(queens_park).
tree(tree01). tree(tree02).
tree(tree03).
hat(hat01).
hat(hat02).
hat(hat03).
hat(hat04).
sex(john,male). sex(george,male).
sex(mary,female). sex(linda,female).
color(hat01,red). color(hat02,blue).
color(hat03,red). color(hat04,blue).
in(john,kew_beach). in(george,kew_beach).
in(linda,queens_park). in(mary,queens_park).
in(tree01,queens_park). in(tree02,queens_park).
in(tree03,kew_beach).
beside(mary,linda). beside(linda,mary).
on(hat01,john). on(hat02,mary). on(hat03,linda). on(hat04,george).
size(john,small).
size(george,big).
size(mary,small).
size(linda,small).
size(hat01,small).
size(hat02,small).
size(hat03,big).
size(hat04,big).
size(tree01,big).
size(tree02,small).
size(tree03,small).
The predicate
article
(
w
)
holds if the word
w
is an article.
The predicate
common_noun
holds when the common noun
w
can be used
to refer to the object
x
in the world model. So, for example, this clause is in the
lexicon:
common_noun(man,X) :- person(X), sex(X,male).
This says that if
X
is a person whose sex is male (in the world model), then
X
can
be what is referred to when using the common noun
man
. (This is intended to
represent what is known about the meaning of the word
man
.)
(
w
,
x
)
(
)
The predicate
adjective
holds when the adjective
w
can be used to
describe the object
x
in the world model. This clause is in the lexicon:
adjective(red,X) :- color(X,red).
This says that if
X
has the color red (in the world model), then
X
can be what is
referred to when using the adjective
red
.
w
,
x