Re: Assertion followed by retraction leads to error state...

Srini Ram <[email protected]> Mon, 29 Sep 2008 13:33:18 -0700 (PDT)
Newsgroups gmane.comp.ai.powerloom
Message-ID <[email protected]>
Hi Hans

What you say below may work in a limited way (unassert followed by assert) but can still fail as the following shows

(defconcept person)
(defconcept rich (?x person))
(defconcept poor (?x person))
(assert (disjoint rich poor))             ;; person can be rich or poor but not both


(assert (rich jim))

(retrieve all (rich ?x))
#1: ?X=JIM                      ;; ok
(retrieve all (poor ?x))
No solutions.                   ;; ok
(retrieve all (not (poor ?x)))
No solutions.             ;; why dont i get jim, system can infer that jim is not poor
                                ;; since jim is rich, and rich/poor are disjoint.
                                ;; still, not important at this point

(unassert (poor jim)) ;; whether it was asserted or not
(assert (poor jim))     ;; jim is now poor..Note because of disjunction it should not be necessary                 
                               ;; to state jim is no longer rich.

STELLA(28): (retrieve all (rich ?x))
There is 1 solution:
  #1: ?X=JIM                                               ;; error, doesnt seem to have gone away
STELLA(29): (retrieve all (poor ?x))
There is 1 solution:
  #1: ?X=JIM
STELLA(30): (retrieve all (not (poor ?x)))
No solutions.
STELLA(31): (retrieve all (not (rich ?x)))
No solutions.

Maybe I need to add more rules to make this work, but then what is the point of having the disjoint statement?

Thanks
Srini



----- Original Message ----
From: Hans Chalupsky <[email protected]>
To: [email protected]
Cc: [email protected]
Sent: Friday, September 26, 2008 6:10:21 PM
Subject: Re:  Assertion followed by retraction leads to error state...

Srini,

a proposition has at most one truth value per module or context.  So,
when you asserted `(not (person jim))', it replaced the previously
asserted default truth value with FALSE (had the previous assertion
been a strict truth, it would have complained about a contradiction).
PowerLoom doesn't keep a history of prior truth values, so there is no
way to get back to the previous truth value with a retraction.

You might be able to get half of what you want by using `unassert'
instead of retract.  With `unassert' you don't have to remember
whether you asserted a truth or falsity.  So, you can simply call
`unassert' before each new assertion that might override a previous
truth value.  Conceivably, we could invent a command that combines the
two into one.  For example,

STELLA(3): (defconcept person)
|c|PERSON
STELLA(4): (unassert (person joe)) ;; ok, even if nothing was asserted yet
|P?|(PERSON JOE)
STELLA(5): (assert (not (person joe)))
|P|(NOT (PERSON JOE))
STELLA(6): (unassert (person joe))
|P?|(PERSON JOE)
STELLA(7): (assert (person joe))
|P|(PERSON JOE)
STELLA(8): 

Hans

>>>>> Srini Ram <[email protected]> writes:

> I am experimenting with default truths and retraction...
STELLA> (presume (person jim))Â Â  ; assume that jim is a person

> |p|(PERSON JIM)

STELLA> (ask (person jim))

> TRUE

STELLA> (assert (not (person jim)))Â  ;; we are told
> specifically that jim is not a
> person             

> |P|(NOT (PERSON JIM))

STELLA> (ask (person jim))Â Â Â Â Â Â Â Â Â  ; ok
> FALSE

STELLA> (retract (not (person jim)))Â  ;; retract
> |P?|(PERSON JIM)

STELLA> (ask (person jim))

> UNKNOWNÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 
> ;; wrong, we still have the presume
> ;; so by adding and retracting a fact we wound up

> ;; at a different state from where we started

> What I would like to happen is that new facts should be able to
> override old facts for cases where something can either be true or
> false...Since jim is either a person or not a person, I should not have
> to remember that I asserted that jim was not a person, and have to
> retract it before asserting the new knowledge that jim is in fact a
> person..From a maintenance perspective, this simplifies life a lot if
> we can assert new knowledge and have it simply replace prior (default)
> knowledge.

_______________________________________________
powerloom-forum mailing list
[email protected]
http://mailman.isi.edu/mailman/listinfo/powerloom-forum