Well, this is my first post to this list and english is not my native
language, so my apologies if you don't understand me or I don't follow
the rules.
I have used a big hash called %brain where the computer remembered what
was said in the way: $brain{PLURAL_NOUN-RELATION} = POINTER_TO_ARRAY. So
if you say "All mammals are hairy animals", the remember function would
store: $brain{mammals-all}=["hairy animals"]; It also infered the
reverse based on what Ronald J Kimball said:
"All X are Y" implies "Some X are Y" and "Some Y are X".
"Some X are Y" implies "Some Y are X".
"No X are Y" implies "No Y are X".
"Some X are not Y" doesn't imply anything else.
The most important part is the look_for. It goes through the elements of
the second argument looking for the first one. If it doesn't find it, it
calls itself recursively. So if the computer knows:
All mammals are hairy animals
All dogs are mammals
All beagles are dogs
And the question is "Are all beagles hairy animals?", then look_for
would be called with the arguments: "beagles", "hairy animals". The
computer doesn't know a direct relation so it would look inside each
element directly related to hairy animals: "All mammals are hairy
animals". The same happen with mammals and dogs, and finally it finds
that all beagles are hairy animals. How the relation is guessed is
explained in the code. This function is also used to find contradictions
and already known things, before remembering something. To describe, the
program just looks for every noun it knows starting from the one to be
described. If it finds a relation, it prints it.
The program works more or less, but it has some important flaws. First,
to separate the nouns in the question, it stops when the first noun is
in the list of known_nouns. It doesn't consider other posibilities.
Also, there's no way to upgrade the information. For example, if you
say:
> Some hairy animals are mammals.
OK.
> All mammals are hairy animals.
Sorry, that contradicts what I already know.
Because the program infers that some mammals are hairy animals, and
"some" ne "all". This seems easy to change, but consider:
> All dogs are mammals.
OK.
> All cats are mammals.
OK.
> No dogs are cats.
OK.
> All mammals are dogs.
Now, when you know that no dogs are cats, "All mammals are dogs" is a
contradiction. But if you knew nothing about the relation between cats
and dogs, then it could be possible. Although I thought it was easy to
make this upgrade path from "some" to "all", I haven't found anything
that correctly does so.
--
qotw18.pl
Description: Text Data
|