Re: Non-declarative Constructors?
phayes@herodotus.cs.uiuc.edu
Date: Fri, 2 Oct 1992 13:35:31 -0500
Message-id: <199210021835.AA16085@dante.cs.uiuc.edu>
Sender: phayes@dante.cs.uiuc.edu
To: Tom Gruber <Gruber@Sumex-AIM.Stanford.edu>, interlingua@ISI.EDU,
macgregor@ISI.EDU
From: phayes@herodotus.cs.uiuc.edu
Subject: Re: Non-declarative Constructors?
>I've run across the "the-foo" construction in a few different contexts.
>Saying (the-foo ?x ?y) is supposed to return an object uniquely
>defined by the function "the-foo" and its arguments. Logically,
>this corresponds to returning a skolem instance that satisfies certain
>constraints. Procedurally, the constructor functions like a "find-or-create"
>operation, if I understand its use correctly. Its not clear to me that one
>can obtain satisfactory behavior with this kind of construct within a
>purely declarative framework.
Er..I may be missing the point, but isnt there a slight confusion over the
use of 'object' here? Logically, as you say, the thing returned is not an
object but a name (of an object, we suppose). On this view then your
examples could behave thus:
>(retrieve ?x (location ?x))
> =>?x
> (retrieve ?y (the-location 30 40 ?y))
> => (the-location 30 40)
>(retrieve ?x (location ?x))
> =>(the-location 30 40)
"(the-location 30 40)" is a newly-created ground term which names a
location. Is there any reason why this cannot be an object in your sense,
uniquely defined by the arguments of 'the-location'? This is just what you
would expect from putting your existence axiom into clause form, since then
the existential 'exists (?loc)' would become a skolem function inside two
universals.
You would probably want
(and (location (the-location ?x ?y))
(latitude (the-location ?x ?y) ?x)
(longitude (the-location ?x ?y) ?y))
maybe with suitable 'legal' qualifications.
It looks like you are merging the use of terms in first-order reasoning and
their use in LISP-type functional reasoning, but this may be a mistake. The
best transcription of LISP into logic is to think of it as reasoning with
equalities between terms, which has a rather different flavor than
quantifier reasoning.
Pat Hayes
----------------------------
PS, in any case, shouldnt the last answer here be loc-0? After all,
presumably the retrieve request is supposed to hand back all the instances
of its argument pattern it can find, and by then there is precisely one. So
there shouldn't be infinitely many answers. As far as the system knows, the
universe might consist of this single (and therefore unique) location, it
has no reason to believe in any others.
> (retrieve ?x (location ?x))
> => nil
> (retrieve ?y (the-location 30 40 ?y))
> => loc-0 ; "loc-0" is a newly-created location object
> (retrieve ?x (location ?x))
> => (loc-1)(??)
----------------------------------------------------------------------------
<through 1992>
Beckman Institute (217)244 1616 office
405 North Mathews Avenue (217)328 3947 home
Urbana, IL. 61801 hayes@cs.stanford.edu (217)244 8371 fax