Re: Unexpected Powerloom truth maintenance behavior....
Hans Chalupsky <[email protected]> Thu, 21 Aug 2008 15:44:06 -0700
| Newsgroups | gmane.comp.ai.powerloom |
|---|---|
| Message-ID | <[email protected]> |
Srini,
I think you just had the variable syntax wrong - if there are more
than one variable, they have to be in a list. Not sure why you didn't
get the following error message:
STELLA(34): (ask (forall ?x ?y (=> (and (spouse ?x ?y) (alive ?x) (alive ?y)) (married ?x ?y))))
PARSING ERROR: Illegal ASK query: `((FORALL ?X ?Y
(=> (AND (SPOUSE ?X ?Y) (ALIVE ?X) (ALIVE ?Y)) (MARRIED ?X ?Y))))'.
NULL
STELLA(35):
With that corrected (and inference tracing on just for debugging), you get
the desired result:
STELLA(32): (ask (forall (?x ?y) (=> (and (spouse ?x ?y) (alive ?x) (alive ?y)) (married ?x ?y))))
PATTERN: []
| GOAL: (FORALL (?x ?y)
(<= (MARRIED ?x ?y)
(AND (SPOUSE ?x ?y) (ALIVE ?x) (ALIVE ?y))))
| | GOAL: (FORALL (?x ?y)
(<= (MARRIED ?x ?y)
(AND (SPOUSE ?x ?y) (ALIVE ?x) (ALIVE ?y))))
| | | GOAL: (MARRIED ?x/anonymous-006 ?y/anonymous-007)
| | | | STRATEGY: :ANTECEDENTS
| | | | RULE: (FORALL (?x ?y)
(<= (MARRIED ?x ?y)
(AND (SPOUSE ?x ?y) (ALIVE ?x) (ALIVE ?y))))
| | | | | GOAL: (AND (SPOUSE ?x/anonymous-006 ?y/anonymous-007) (ALIVE ?x/anonymous-006) (ALIVE ?y/anonymous-007))
| | | | | | GOAL: (SPOUSE ?x/anonymous-006 ?y/anonymous-007)
| | | | | | SUCC: ?X=anonymous-006 ?Y=anonymous-007 truth=T
| | | | | | GOAL: (ALIVE ?x/anonymous-006)
| | | | | | SUCC: ?X=anonymous-006 ?Y=anonymous-007 truth=T
| | | | | | GOAL: (ALIVE ?y/anonymous-007)
| | | | | | SUCC: ?X=anonymous-006 ?Y=anonymous-007 truth=T
| | | | | SUCC: ?X=anonymous-006 ?Y=anonymous-007 truth=T
| | | | SUCC: ?X=anonymous-006 ?Y=anonymous-007 truth=T
| | | SUCC: ?Y=anonymous-007 ?X=anonymous-006 truth=T
| | SUCC: ?Y=anonymous-007 ?X=anonymous-006 truth=T
TRUE
Same for the other query:
STELLA(33): (ask (forall ((?x person) (?y person)) (=> (and (spouse ?x ?y) (alive ?x) (alive ?y)) (married ?x
?y))))
PATTERN: []
| GOAL: (FORALL (?x ?y)
(<= (MARRIED ?x ?y)
(AND (SPOUSE ?x ?y) (ALIVE ?x) (ALIVE ?y))))
| | GOAL: (FORALL (?x ?y)
(<= (MARRIED ?x ?y)
(AND (SPOUSE ?x ?y) (ALIVE ?x) (ALIVE ?y))))
| | | GOAL: (MARRIED ?x/anonymous-008 ?y/anonymous-009)
| | | | STRATEGY: :ANTECEDENTS
| | | | RULE: (FORALL (?x ?y)
(<= (MARRIED ?x ?y)
(AND (SPOUSE ?x ?y) (ALIVE ?x) (ALIVE ?y))))
| | | | | GOAL: (AND (SPOUSE ?x/anonymous-008 ?y/anonymous-009) (ALIVE ?x/anonymous-008) (ALIVE ?y/anonymous-009))
| | | | | | GOAL: (SPOUSE ?x/anonymous-008 ?y/anonymous-009)
| | | | | | SUCC: ?X=anonymous-008 ?Y=anonymous-009 truth=T
| | | | | | GOAL: (ALIVE ?x/anonymous-008)
| | | | | | SUCC: ?X=anonymous-008 ?Y=anonymous-009 truth=T
| | | | | | GOAL: (ALIVE ?y/anonymous-009)
| | | | | | SUCC: ?X=anonymous-008 ?Y=anonymous-009 truth=T
| | | | | SUCC: ?X=anonymous-008 ?Y=anonymous-009 truth=T
| | | | SUCC: ?X=anonymous-008 ?Y=anonymous-009 truth=T
| | | SUCC: ?Y=anonymous-009 ?X=anonymous-008 truth=T
| | SUCC: ?Y=anonymous-009 ?X=anonymous-008 truth=T
TRUE
STELLA(34):
Make sure you see the following rules, you had some funny non-breaking
space characters in the mail you sent which look like white space but
are treated as non-white space by PowerLoom:
STELLA(31): (print-rules married)
(FORALL (?x1 ?x2)
(<= (SPOUSE ?x1 ?x2)
(MARRIED ?x1 ?x2)))
(FORALL (?x ?y)
(=>> (MARRIED ?x ?y)
(AND (SPOUSE ?x ?y)
(ALIVE ?x)
(ALIVE ?y))))
(FORALL (?x ?y)
(<= (MARRIED ?x ?y)
(AND (SPOUSE ?x ?y)
(ALIVE ?x)
(ALIVE ?y))))
()
STELLA(32):
Hans
--------------------------------------------------------------------------
Hans Chalupsky, PhD USC Information Sciences Institute
Project Leader, Loom KR&R Group 4676 Admiralty Way
<[email protected]> Marina del Rey, CA 90292
(310) 448-8745
--------------------------------------------------------------------------
>>>>> Srini Ram <[email protected]> writes:
> Another issue I observed:
> (defmodule "TEST"
> Â :includes ("PL-USER"))
> (in-module "TEST");;Â repeat this if evaluating in STELLA
> (clear-module "TEST")
> (reset-features)
> (defconcept person (?x))
> (defrelation alive (?x))
> (defrelation spouse ((?x person) (?y person))
> Â :axioms (symmetric spouse))
> (defrelation married ((?x person) (?y person))
> Â Â Â :<=> (and (spouse ?x ?y) (alive ?x) (alive ?y)))
STELLA> (ask (forall ?x ?y (=> (and (spouse ?x ?y) (alive ?x) (alive ?y)) (married ?x ?y))))
> :NULL_VALUE
STELLA> (ask (forall (?x person) (?y person) (=> (and (spouse ?x ?y) (alive ?x) (alive ?y)) (married ?x ?y))))
> :NULL_VALUE
> Shouldnt the above asks work? Is there any error in the asks?
> I tried (setq *type-check-strategy* :NONE)
> with no change...
> Thanks
> Srini
> --- On Thu, 8/21/08, Srini Ram <[email protected]> wrote:
> From: Srini Ram <[email protected]>
> Subject: Unexpected Powerloom truth maintenance behavior....
> To: [email protected]
> Date: Thursday, August 21, 2008, 9:31 AM
> (defmodule "TEST"
> Â :includes ("PL-USER"))
> (in-module "TEST")
> ;(clear-module "TEST")
> (reset-features)
> (defconcept person (?x))
> (defrelation spouse ((?x person) (?y person))
> Â :axioms (symmetric spouse))
> (assert (spouse jack jill)) ; expect (person jack) (person jill) to be also asserted because of domain of person
> (ask (person jack))
> TRUEÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
> ;; as expected
> (retract (spouse jack jill))Â Â Â Â Â Â Â Â Â ;; expect (person jack) to also be retracted by truth maintenance system
> (ask (person jack))
> TRUEÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
> ;; unexpected
> Am I missing something.
> Thanks
> Srini