Implications for KIF

sowa <sowa@turing.pacss.binghamton.edu>
Date: Thu, 13 May 93 05:44:16 EDT
From: sowa <sowa@turing.pacss.binghamton.edu>
Message-id: <9305130944.AA01932@turing.pacss.binghamton.edu>
To: cg@cs.umn.edu, interlingua@ISI.EDU
Subject: Implications for KIF
Cc: sowa@turing.pacss.binghamton.edu
Bob Neches and Vijay Saraswat asked for a summary of how all this
discussion about models and depictions would affect the syntax of KIF.
That is a fair question, and I would like to return to the original
issue that I raised a month ago after talking with Mike Genesereth.

I wanted to translate nested CG contexts into quoted KIF expressions.
For example, suppose we said "Tom owns a cat, and he believes that
it is on a mat."  That might be represented in KIF by something like
the following:

   (exists (?x cat)
           (and (owns Tom ?x)
                (believes Tom `(exists (?y mat) (on ?x ?y))) ))

I said "something like" this expression, because there is a question
about what to do with a variable like ?x inside a quoted expression,
which refers to something quantified outside that expression.  There
is no problem with ?y, since it is quantified and used within the
quoted expression.

In Common LISP, the backquote allows variables inside a quoted
expression to refer back to their points of definition outside the
quoted context.  However, ?x is a KIF variable, which the Common LISP
reader translates to a macro.  Therefore, it is necessary to prefix
the ?x with a comma, as in ,?x.  (Please ask Mike G. for further
explanation of this point.)

However, a comma alone is not enough because a cat is a physical
object, not a lexical item.  Therefore, ,?x is a real live fuzzy beast,
and it may not occur inside a quoted expression.  Therefore, Mike
said that I would have to write ,(name ?x) to cause the last line of
the above KIF expression to become

   (believes Tom `(exists (?y mat) (on ,(name ?x) ?y))) ))

In some of my CG examples, I had contexts nested three levels deep,
and the resulting KIF variables would have to be represented by
things like ,,,(name ?x).  Both Mike and I agreed that this was
rather ugly, hard to read, and error-prone.

Mike suggested that I give names to my existentially quantified
variables in order to simplify the expressions.  So if Tom's cat
is named Thothmes, the KIF expression would be

   (and (cat Thothmes)
        (owns Tom Thothmes)
        (believes Tom `(exists (?y mat) (on Thothmes ?y))) )

The problem though is that there may be many such variables, and
they might sometimes be quantified by (forall ...) instead of (exists...).
Furthermore, there might be languages such as conceptual graphs, in
which unnamed existential quantifiers come up frequently, and it might
be inconvenient to have to invent special names for each one and be
required to keep them all unique.

That is why I suggested that the referents of KIF variables be
considered lexical items in all cases.  If ?x refers to a number or
a character string, then there is no need to write (name ?x), since
such things, when unquoted, can legitimately occur inside an expression.
But if ?x refers to a nonlexical item like a cat, the system would
automatically generate a "surrogate", which would be a unique lexical
item such as a GENSYM, that could stand in place of the actual beastie
in a KIF expression.

That is what got us into the whole discussion:  what are the ultimate
referents of KIF expressions.  Len Schubert asked why shouldn't we
just write ?x in all cases, instead of ,?x or ,(name ?x).  I like
Len's suggestion best of all, but it would make it necessary to have
a parser for KIF that was independent of the Common LISP reader.

So following are the three possible notations for KIF variables
nested inside of quoted contexts that refer back to points of
definition outside those contexts:

 1. With the assumption that variables may refer to nonlexical items,
    the nested cat variable would have to be written ,(name ?x) if
    nested one level deep or ,,,(name ?x) if nested three levels deep.

 2. With the assumption that variables always refer to lexical items
    (either literals like numbers and character strings or surrogates
    for external things), the nested cat variable could be written ,?x
    if nested one level deep or ,,,?x if nested three levels deep.

 3. With a KIF parser that was independent of the Common LISP reader,
    the cat variable could always be written ?x whether nested or not,
    and the question of whether variables referred to warm beasties
    or lexical surrogates would not arise.

I prefer option 3 -- not only because it simplifies my job of translating
to KIF, but also because it makes this last month of philosophical
discussion irrelevant to the question of how we use KIF.

John