The new procedures are more powerful than the simple database ones, as we can now use them to carry out property inheritance via isa links. Given the following database,
[ [animal has skin][bird isa animal]
[bird can fly]
[bird has wings]
[canary isa bird]
[canary can sing]
[canary colour yellow]
[tweetie isa canary]] -> database;
spresent can carry out inferences like
spresent([tweetie can fly])=>
** <true>
The spresent procedure works by recognizing the keyword isa in the the entries
[tweetie isa canary]
[canary isa bird]
and then associating the attributes of `bird' with `tweetie', as if the entry
[tweetie can fly]
was in the database.
The same kind of inference is also performed by sallpresent. just as spresent looks for single facts that are either in the database or that can be inferred from it, so sallpresent looks for collections of facts that are stored in, or can be inferred from, the database:
sallpresent([ [tweetie has wings][tweetie has skin]
[tweetie can sing]]) =>
** <true>
For further examples, we shall use the property inheritance mechanism to work out the fare to any station from Victoria, given the fare zone of the station.
In order to work out the fare for a London Underground journey, we need to know certain facts. These are
We can represent this by a database containing entries with fares for particular fare zones, and the fare zone for each station.
[[zone1 station] fare [40 pence]]
[[zone2 station] fare [60 pence]]
[[green park] isa [zone1 station]]
[[picadilly circus] isa [zone1 station]
[IMAGE ]
[[shepherds bush] isa [zone2 station]
[[goodge street] isa [zone2 station]]
[[brixton] isa [zone2 station]]
[IMAGE ]
Now we can ask, ``Is the fare to Brixton 60 pence?'' or in POP-11
spresent([[brixton] fare [60 pence]])=>
** <true>
In semantic network terms, the [brixton] node has inherited the 60 pence fare property from the [zone2 station] node. It is more likely that the tourist in London will want to ask something like ``What is the fare to Brixton?'' in which case the argument to spresent will be a pattern containing a variable:
vars fare;
spresent([[brixton] fare ?fare])=>
** <true>
The value of the variable is the required fare:
fare =>
** [60 pence]
Providing that the database entries are in the form of triples, with the connects and isa links where appropriate, then the Tourist Guide as it stands so far can be altered to carry out inferencing simply by substituting spresent for present and sallpresent for allpresent within the answer procedure.