**Mail folder:**Interlingua Mail**Next message:**macgregor@ISI.EDU: "Re: Non-declarative Constructors?"**Previous message:**phayes@herodotus.cs.uiuc.edu: "Re: Non-declarative Constructors?"**In-reply-to:**macgregor@ISI.EDU: "Non-declarative Constructors?"**Reply:**macgregor@ISI.EDU: "Re: Non-declarative Constructors?"

Message-id: <2927044487-4948961@KSL-EXP-27> Date: Fri, 2 Oct 92 12:54:47 PDT From: Tom Gruber <Gruber@Sumex-AIM.Stanford.edu> To: macgregor@ISI.EDU, interlingua@ISI.EDU Cc: ontolingua@SUMEX-AIM.Stanford.EDU Subject: Re: Non-declarative Constructors? In-reply-to: Msg of Fri, 2 Oct 1992 10:09:21 -0800 from macgregor@ISI.EDU

--- Excerpt from Robert MacGregor (Fri, 2 Oct 1992 10:09:21 -0800) --- > 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. > Consider the following Ontolingua definition (sorry, but I'm not > confident that I know how to express the same thing in KIF): > (define-function the-location (?lat ?lon) :-> ?loc > :iff-def (and (location ?loc) > (legal-latitude ?lat) > (legal-longitude ?long) > (latitude ?loc ?lat) > (longitude ?loc ?lon))) This translates into the following KIF, after changing the ?long to ?lon in "(legal-longitude ?long)": (DEFFUNCTION THE-LOCATION (<=> (THE-LOCATION ?LAT ?LON ?LOC) (AND (LOCATION ?LOC) (LEGAL-LATITUDE ?LAT) (LEGAL-LONGITUDE ?LON) (LATITUDE ?LOC ?LAT) (LONGITUDE ?LOC ?LON))) (FUNCTION THE-LOCATION) (ARITY THE-LOCATION 3)) and this in Loom: (LOOM:DEFINE-RELATION :NAME THE-LOCATION :IS (:AND (:DOMAINS LEGAL-LONGITUDE LEGAL-LATITUDE) (:RANGE LOCATION) (:SATISFIES (?LAT ?LON ?LOC) (:AND (LATITUDE ?LOC ?LAT) (LONGITUDE ?LOC ?LON))) :ATTRIBUTES (:SINGLE-VALUED))) > Given this definition and an otherwise empty knowledge base, suppose > I submit the following three queries to a Brand X KR system: > (retrieve ?x (location ?x)) => ans1 > (retrieve ?y (the-location 30 40 ?y)) => ans2 > (retrieve ?x (location ?x)) => ans3 You haven't said anything about the completeness of your reasoner. The first query may return "I don't know." or "I can't answer." There could easily be an infinite number of locations, and that is not a property of the definition of the the-location function. > What are the appropriate responses corresponding to "ans1", "ans2", > and "ans3"? That somewhat depends on whether or not the something > like the following axiom is implicit in the Ontolingua definition: > (forall (?lat ?lon) > (=> (and (legal-latitude ?lat) > (legal-longitude ?lon)) > (exists (?loc) > (and (location ?loc) > (latitude ?loc ?lat) > (longitude ?loc ?lon))))) This axiom is NOT implied. It would be if the function is asserted to be total over the cross product legal-latitude and legal-longitude. The axiom that IS implied comes from the definition of FUNCTION: (forall (?lat ?lon ?loc1 ?loc2) (=> (= (the-location ?lat ?lon) ?loc1) (= (the-location ?lat ?lon) ?loc2) (= ?loc1 ?loc2))) In other words, the object denoted by (the-location ?lat ?lon) is unique given ?lat and ?lon. Defining a THE- constructor in an ontology says that the *function* exists, and that locations are a function of latitudes and longitudes. It doesn't say that a reasoner will be able to retrieve interned lisp objects that correspond to the values of the function. > If this last axiom is NOT implicit in the definition, then I would > expect that the three retrieve statements all would return nil. If > it IS implied by the definition, then I would expect that the first > query should return an infinite list of locations. However, my > impression is that the behavior that people want from constructors > like "the-location" is: > (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) > Could someone please clarify for me the intended meaning of > constructors such as "the-location" as defined above? First, is the > axiom asserting the existence of an infinite number of locations > implicit in the definition? Second, which of the three > interpretations of the retrieve statements is correct? Since the axiom does not state that the function is total for any domain, it doesn't say anything about how many locations exist. Even if there were an infinite number of pairs of (?lon ?lat), it could be that none of them correspond to a location. If you did want to say that all the pairs of (?lon ?lat) map to locations, you could say it like this: (defrelation lat-lon-pairs (?lat ?lon) := ; the cross product relation (and (latitude ?lat) (longitude ?lon))) (exact-domain the-location lat-lon-pairs) The definition of exact-domain is from the frame ontology: (define-function EXACT-DOMAIN (?relation) :-> ?domain-relation "The EXACT-DOMAIN of a relation is a relation whose tuples (all of them) are mapped by the relation to instances of the range. A binary relation R is defined as a set of tuples of form <x,y>. If we say (= (exact-domain R) D) then all of the x's must be in the class D, and for each instance x of class D, the relation maps x to some y. The exact-domain of a relation of arity other than 2 is the relation that represents a cross product. For example, the notation F:A x B -> C, means that function F maps pairs <a,b> onto c's where a is an instance of A, b is an instance of B, and c is an instance of C. The exact-domain of F is the set of pairs <a,b> that occur in some triple <a,b,c> in F. Some treatments of functions define a function as a _mapping_ from a domain to a range. This ontology treats functions as relations, and relations as sets of tuples. Thus, functions and relations are _not_ defined relative to domains and ranges; the exact-domain is a function of the set of tuples. It follows that all functions are `total' with respect to their exact-domains and `onto' with respect to their exact-ranges. The exact-domain of a variable-arity relation is another variable-arity relation; the lengths of the tuples in the exact-domain of R is one less than the corresponding tuples in the relation R. The exact-domain of a unary relation, or a relation that contains a tuple of length one, is undefined." :iff-def (and (instance-of ?relation relation) (instance-of ?domain-relation relation) (forall (?tuple) (=> (member ?tuple ?relation) (not (empty (butlast ?tuple))))) (forall (?tuple @args) (<=> (holds ?domain-relation @args) (and (member ?tuple ?relation) (= (listof @args) (butlast ?tuple))))))))