home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
coders
/
jËzyki_programowania
/
logo
/
powerlogo
/
semnet
/
semnet.doc
< prev
next >
Wrap
Text File
|
1992-11-10
|
6KB
|
186 lines
Power LOGO Semantic Network Program
by Jerry D. Hedden
This program allows the user to form a semantic network and ask questions
about it. A semantic network is a type of knowledge base in which objects
are linked together in a hierarchy, and are associated with attributes.
The diagram below illustrates the associations supported by this program.
(object YYY)
^
| is-a
|
|
| includes
v
(object XXX) <--------------------------> (attribute ZZZ)
with has
without has-not
able can
unable cannot
are is
are-not is-not
A concrete example might be:
an animal --- (can) --> move
^
| (is an)
|-----------------------------------
| |
a bird --- (can) --> fly a mammal --- (has) --> fur
^ | ^ |
| -- (has) --> feathers | -- (cannot) --> fly
| (is a) | (is a)
| |
a canary --- (is) --> yellow a bat --- (can) --> fly
An object "inherits" the attributes of its "parent". Thus, a canary can
fly. Inherited attributes can be overridden, as in the case of a bat being
able to fly whereas most mammals cannot.
The sample network included with SemNet deals with living things (life
forms), but networks dealing with other objects could be made (e.g.,
sub-atomic particles). If you are really ambitious, you could modify the
program to handle different "cases" of attributes (besides "can", "cannot",
etc.).
Program Execution:
Load SemNet by clicking on its icon (or via the CLI like any other Power
LOGO program. To start SemNet in an empty state, type `semnet' at the
LOGO prompt. To start SemNet and have it load an existing network, type
`( semnet "network-name )'. For example `( semnet "sample.net )' starts
up SemNet with the included sample network. To terminate SemNet, enter
the command `quit' at the SemNet prompt.
You can query the network concerning its current contents. For example,
`Why can a canary move?'. To get a feel for the current contents of the
network try, `What do you know?'.
You can add to the network. For example:
A reptile is an animal.
A reptile is cold-blooded.
A snake is a reptile.
You can save a new or modified network with the SemNet command `save'.
You can load in a different network with the SemNet command `load'. For
either command, respond to the file requester, as appropriate.
SemNet Commands:
Commands, queries and data entries at the SemNet prompt must adhere to
the following specifications:
Objects and attributes must be single words. Use dashes or
underscores for multi-word entries (e.g., flying-fish).
Objects are distinguished by the use of an "article" (i.e.,
the words "a" or "an"). Therefore, always include the
article in all data entries and queries.
Program control commands:
load
save
quit
For data entry, use entries of the following format:
A[n] XXX is a[n] YYY. ; Establishes a relation.
A[n] XXX has ZZZ. ; Assigns attributes.
A[n] XXX does not have ZZZ.
A[n] XXX can ZZZ.
A[n] XXX cannot ZZZ.
A[n] XXX is ZZZ.
A[n] XXX is not ZZZ.
Ask me about a[n] XXX. ; See below.
For `Ask me about a[n] XXX.', several questions will be asked. A
carriage-return is an acceptable response (i.e., ignores the question).
What is a[n] XXX? ; Give a response of the form:
; a[n] YYY
; in order to establish an "is-a"
; link.
What does a[n] XXX have? ; For each of these, give a
What does a[n] XXX not have? ; response of the form:
What can a[n] XXX do? ; ZZZ1 ZZZ2 ZZZ3 ...
What can a[n] XXX not do? ; in order to associate
What can a[n] XXX be? ; attributes with the object.
What can a[n] XXX not be?
For queries on an object:
What is a[n] XXX?
What are examples of a[n] YYY?
What does a[n] XXX have?
What does a[n] XXX not have?
What can a[n] XXX do?
What can a[n] XXX not do?
What can a[n] XXX be?
What can a[n] XXX not be?
Tell me about a[n] XXX. ; Composite of the above.
Tell me all about a[n] XXX. ; Even more comprehensive.
For queries about an attribute:
What has ZZZ?
What does not have ZZZ?
What can ZZZ?
What cannot ZZZ?
What is ZZZ?
What is not ZZZ?
For a listing of objects and attributes in the network:
What do you know?
For queries about associations:
Is a[n] XXX a[n] YYY? ; Gives YES or NO response.
Does a[n] XXX have ZZZ? ; These give YES, NO or
Can a[n] XXX ZZZ? ; I DON'T KNOW responses.
Is a[n] XXX ZZZ?
For explanations about associations:
Why is a[n] XXX a[n] YYY?
Why does a[n] XXX have ZZZ?
Why does a[n] XXX not have ZZZ?
Why can a[n] XXX ZZZ?
Why can a[n] XXX not ZZZ?
Why is a[n] XXX ZZZ?
Why is a[n] XXX not ZZZ?
The program can handle queries on non-existent objects or attributes.
Capitalization of the first word of a command and terminating punctuation
are not required. Thus, `a lizard is a reptile' is acceptable.
Potential Problems:
The program does not handle "improper" inputs well. The above formats must
be followed.
Circular relations are not detected, and can result in the program going
into an infinite loop on some queries. E.g., `An AAA is a BBB.', `A BBB is
a CCC.', and `A CCC is an AAA.'.
Entering contrary data is not detected (e.g., an object both has and does
not have an attribute), and will probably yield unusual results.
Once entered, data cannot be removed.
%