[comp.ai.shells] constraints in ES Shells

brady@udel.edu (Joseph Brady) (11/04/89)

The product 'trilogy' is a logic programming language that uses
constraints. I can find no other language that includes
constraints. 'trilogy' is not an expert system shell, however.


The product is marketed by Complete Logic Systems Inc,
741 Blueridge Ave, North Vancouver BC Canada, V7R 2J5,
telephone  604 986 3234.

lisplog@uklirb.informatik.uni-kl.de (Bernd Bachmann AG Richter) (11/28/89)

In article <7159@uklirb.UUCP> I wrote:

 >Are there any Expert System Shells available using constraints as an
 >'own' knowledge representation formalism - besides rules, frames, petri
 >nets etc. -  or included in these formalisms? 
 >
 >BABYLON, a hybrid shell, provides this feature. In KEE and ART
 >constraints can only be used to derive the contents of slots in
 >frames from other slot values.(?)
 >
 >Any information about constraints in ES Shells are welcome, including
 >references to published papers. Preferably, the answers should be
 >posted directly to the newsgroup, but I will post a summary if someone
 >likes to e-mail. 
 >
 >- Bernd Bachmann
 >

I have received three answers as mail:

******************************************************************************

From: Brad Miller <miller@cs.rochester.edu>

Well... I don't know what you mean by 'own' but I will try to describe the
constraint's Rhet's KR lets you do...

1. You don't use constraints to derive slot contents. Slots have no
contents. Rhet uses E-Unification, so you can talk about slots irrespective
of contents. eg...

given a structured type (read frame) say

(define-subtype 'T-ACTION 'T-U  ; type action, subtype of universal type
   :roles '((R-Agent T-Animate) ; one role (slot) is the agent of type
				; animate 
	    (R-Time T-Time)     ; the time at which the axtion occurs
	    ...))		; etc.

Now for some particular action, say [ACTION1], and some other action
[ACTION2], for which I know neither of the agents, I can say they have the
same agent by asserting

(Add-Eq [F-Agent Action1] [F-Agent Action2])

So the advantage is I can deal with slots independantly of the "value".
Should I later decide that [Joe] (an animate object) is the agent of
[action1], I can assert (Add-Eq [F-Agent Action1] [Joe]) and the system will
infer that Joe is also the agent of action2.

Constraints can be used in two ways:

there are constraints between roles and relations of a structured type. For
instance:

(define-subtype 'T-Two-Party-Action 'T-Action
	:roles '((R-Object-Agent))
	:constraints '([NotEQ? [F-Agent ?self] [F-Object-Agent ?self]]))

Here we have put a predicate on the constraints that must be provably true
for any instance of this type. (In this case, it can be asserted to be
true). We expand our above definition of Action to have another party
involved, and constrain that party to not be equal to the Agent. The system
not only will not allow us to construct an instance of a two-party action
that has the same agent and object-agent, but given that we have some
instance with Agent [Agent-42] and object-agent [Agent-91] it will not allow
us to later assert that these two animate object instances are EQ.

You can also use constraints between multiple types, e.g.

  (DEFINE-SUBTYPE 'T-PARENT 'T-PERSON :ROLES '((R-CHILD T-PERSON)))
  (DEFINE-SUBTYPE 'T-GRAND-PARENT 'T-PARENT
    :ROLES '((R-GRANDCHILD T-PERSON) (R-CHILD T-PARENT))
    :CONSTRAINTS '([EQ? [F-GRANDCHILD ?SELF] [F-CHILD [F-CHILD ?SELF]]]))

And this works just like you expect it would...

***

Another kind of constraint Rhet uses is on variables. Rhet can "defer"
proofs that may not be possible (or too expensive) at the current time by
constraining a variable s.t. some predicate is true. The variable cannot
then be bound to an object unless all the constraints are provable on that
binding.

For instance

[POST [HAS-CHILDREN ?x*T-Animate]]
 <-> [ANY ?x*T-Animate [HAS-CHILDREN ?x]]

read "Any x of type Animate such that Has-Children of x is true.

or given we have asseted [P A] is true

(UNIFY [ANY ?X [P ?X]] [B])	;should fail, [P B] is unknown
(UNIFY [ANY ?X [P ?X]] [A])	;should succeed, [P A] has been asserted, above

A more complex example using function types:

(DECLARE-FN-TYPE 'SUM '(T-INTEGERS T-INTEGERS T-INTEGERS) ;; useful maxtypes
		 '(EVEN EVEN EVEN) '(ODD ODD EVEN) '(EVEN ODD ODD) '(ODD
EVEN ODD))

This should be read as: The SUM function term takes two arguments of type
integer and is itself of type integer. In particular, if the two arguments
are of type even it will be of type even, if odd, of even, etc.

Now if we do:

(UNIFY [P [SUM ?X ?Y]] [P ?Z*ODD])

we get (for the binding of ?x)

[ANY ?X*T-INTEGERS
     [TYPE? [SUM ?X*T-INTEGERS [ANY ?Y*T-INTEGERS
				    [TYPE? [SUM ?X ?Y] *ODD ]]]
	    *ODD ]] 

Similarly for the binding of ?y and ?z.

***

A whole nother area is temporal constraints, but this letter is too long
already! I hope it has been of some use....

***

Some appropriate references:

@techreport{Rhet:UG,
	Author = "Allen, James F. and Miller, Bradford W.",
	Title = "The Rhetorical Knowledge Representation System: A User's Guide",
	Institution = URCS,
	Number = "238 (rerevised)",
	Month = Mar,
	Year = 1989}

@techreport{RPRS,
	Author = "Miller, Bradford W.",
	Title = "The RHET Plan Recognition System",
	Institution = URCS,
	Number = 298,
	Month = Nov,
	Year = 1989}

@techreport{timelogic,
	Author = "Koomen, Johannes A.G.M.",
	Title = "The TIMELOGIC Temporal Reasoning System",
	Institution = URCS,
	Number = "231 (revised)",
	Month = Oct,
	Year = 1988}

@techreport{recurrence,
	Author = "Koomen, Johannes A.G.M.",
	Title = "Reasoning About Recurrence",
	Institution = URCS,
	Number = 307
	Month = July,
	Note = "PhD Thesis"
	Year = 1989}
	
******************************************************************************

From: Pierre.Berlandier@mirsa.inria.fr

The focus of my researches at INRIA (Sophia Antipolis Center), where
	 I'm doing a PhD, is the integration of a constraint language
	 in a expert system shell. The general idea of my work is
	 derived from the one exposed in the IJCAI 87 paper on Babylon.
References to papers I wrote on this topic are the following (BibTeX
	 format) :


@inproceedings{Berlandier1,
AUTHOR="P. Berlandier and S. Moisan",
TITLE="Dynamic Constraint Management in Expert Systems",
BOOKTITLE="Proceedings of the $3^{rd}$ international symposium on
           knowledge engineering",
ADDRESS="Madrid",
MONTH="October",
YEAR="1988"
}

@inproceedings{Berlandier2,
AUTHOR="P. Berlandier and S. Moisan",
TITLE="Reflexive Constraints for Dynamic Knowledge Bases",
BOOKTITLE="Proceedings of the $1^{st}$ international
computer science conference '88",
ADDRESS="Hong--Kong",
MONTH="December",
YEAR="1988"
}

@techreport{Berlandier3,
AUTHOR="P. Berlandier",
TITLE="Int\'egration d'outils pour l'expression et la satisfaction de
contraintes dans un g\'en\'erateur de syst\`emes experts",
INSTITUTION="INRIA Sophia Antipolis",
NUMBER="924",
YEAR="1988"
}

@incollection{Berlandier4,
AUTHOR="P. Berlandier",
TITLE="{\sc Prose} : A Constraint Language with Control Structures",
BOOKTITLE="Lecture Notes in Artificial Intelligence : Proceedings of
           the EPIA89",
PUBLISHER="Springer--Verlag",
ADDRESS="Lisbon, Portugal",
MONTH="September",
YEAR="1989"
}

******************************************************************************

From: nvuxh!hall@relay.eu.net

ART does not have anything that I would call a constraint. I asked
almost every ES vendor at IJCAI-89 if their tool embodied
constraints. The inevitable retort was "what do you mean by
constraint?" When I defined constraints, they all said, "well, you
could implement that with rules." Of course you could implement
constraints with rules; you could implement constraints with COBOL
too.

******************************************************************************

Thanks to all who answered!

- Bernd Bachmann