Truth maintenance system issue?

View: New views
5 Messages — Rating Filter:   Alert me  

Truth maintenance system issue?

by srini_ottawa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I came across this issue the other day:

Given the code:

(defconcept person (?x))
(defrelation alive (?x))

(defconcept live-person (?x person)
  :<=> (alive ?x)
  )

And the data:
(assert (alive jack))


I can ask :
STELLA> (ask (live-person jack))
TRUE                                                           ;; ok
STELLA> (retract (alive jack))
|P?|(ALIVE JACK)                                         ;; dont know if jack is live now
STELLA> (ask (live-person jack))
UNKNOWN                                                  ;; ok
STELLA> (assert (not (alive jack)))
|P|(NOT (ALIVE JACK))                                 ;; jack is not alive
STELLA> (ask (live-person jack))
FALSE                                                         ;; ok
STELLA> (ask (alive jack))
FALSE                                                         ;; ok
STELLA> (assert (alive jack))
NULL                                                           ;; jack lives again
STELLA> (ask (alive jack))
UNKNOWN                                                  ;; error: i just asserted this. hope I dont need to retract the (not (alive jack) before asserting the opposite?

STELLA> (ask (live-person jack))
UNKNOWN                                                  ;; error; same as above

On a separate sequence (with different code) I got this log:
....
STELLA> (ask (live-person jack))
UNKNOWN
STELLA> (assert (not (alive jack)))
|P#|(ALIVE JACK)
STELLA> (assert (alive jack))
|P#|(ALIVE JACK)                   Shouldnt the system warn me of inconsistency when I assert a fact and its opposite? This is a simple case, but when we have derived facts, this may be important...
STELLA> (ask (live-person jack))
UNKNOWN                                  ;; why unknown. at least inconsistency should be flagged at query time, if not the time when inconsistent facts were asserted


Thanks
Srini







_______________________________________________
powerloom-forum mailing list
powerloom-forum@...
http://mailman.isi.edu/mailman/listinfo/powerloom-forum

Re: Truth maintenance system issue?

by Thomas Russ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sep 12, 2008, at 8:55 AM, Srini Ram wrote:

> I came across this issue the other day:
>
> Given the code:
>
> (defconcept person (?x))
> (defrelation alive (?x))
>
> (defconcept live-person (?x person)
>   :<=> (alive ?x)
>   )
>
> And the data:
> (assert (alive jack))
>
>
> I can ask :
> STELLA> (ask (live-person jack))
> TRUE                                                           ;; ok
> STELLA> (retract (alive jack))
> |P?|(ALIVE JACK)                                         ;; dont  
> know if jack is live now
> STELLA> (ask (live-person jack))
> UNKNOWN                                                  ;; ok
> STELLA> (assert (not (alive jack)))
> |P|(NOT (ALIVE JACK))                                 ;; jack is not  
> alive
> STELLA> (ask (live-person jack))
> FALSE                                                         ;; ok
> STELLA> (ask (alive jack))
> FALSE                                                         ;; ok
> STELLA> (assert (alive jack))
> NULL                                                           ;;  
> jack lives again

Did this fail to signal a clash for you?
When I run PowerLoom on my machine I get the following results:

* (assert (alive jack))
Derived both TRUE and FALSE for the proposition `|P#|(ALIVE JACK)'.
    Clash occurred in module `|MDL|/PL-KERNEL-KB/PL-USER'.
:NULL_VALUE


>
> STELLA> (ask (alive jack))
> UNKNOWN                                                  ;; error: i  
> just asserted this. hope I dont need to retract the (not (alive  
> jack) before asserting the opposite?

Actually, you do need to retract (not (alive jack)).
But PowerLoom should have signaled a clash as shown above.
Did that not happen for you?  It occurs when I run the latest  
snapshot. (3.2.36)

> STELLA> (ask (live-person jack))
> UNKNOWN                                                  ;; error;  
> same as above

UNKNOWN is the answer that will come back when asking about  
inconsistent propositions.  There is no inconsistent result truth  
value that PowerLoom returns, so UNKNOWN is currently the best answer  
that the query system can come up with.



> On a separate sequence (with different code) I got this log:
> ....
> STELLA> (ask (live-person jack))
> UNKNOWN
> STELLA> (assert (not (alive jack)))
> |P#|(ALIVE JACK)

This is already inconsistent.  The key is the presence of the "#"  
character in the |P#| type key ahead of the proposition.  It indicates  
that the particular proposition has an inconsistent truth value.

>
> STELLA> (assert (alive jack))
> |P#|(ALIVE JACK)                   Shouldnt the system warn me of  
> inconsistency when I assert a fact and its opposite? This is a  
> simple case, but when we have derived facts, this may be important...
> STELLA> (ask (live-person jack))
> UNKNOWN                                  ;; why unknown. at least  
> inconsistency should be flagged at query time, if not the time when  
> inconsistent facts were asserted

This must have some inconsistent information already present.

Right now, inconsistent information is flagged (once) when the  
inconsistency is detected during forward chaining.


>
>
>
> Thanks
> Srini
>
>
>
>
>
>
> _______________________________________________
> powerloom-forum mailing list
> powerloom-forum@...
> http://mailman.isi.edu/mailman/listinfo/powerloom-forum

_______________________________________________
powerloom-forum mailing list
powerloom-forum@...
http://mailman.isi.edu/mailman/listinfo/powerloom-forum

Re: Truth maintenance system issue?

by srini_ottawa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Thomas

Sorry about this..As you point out, the system does indeed warn me..but the warnings go into the inferior-lisp in SLIME..same issue I had before.

Hans had suggested the following to be evaluated in the SLIME buffer after starting up PL:
(in-package "STELLA")
(eval (setf (native-stream standard-output) (verbatim :common-lisp cl:*standard-output*)))

I tried putting these lines in the clinit.cl file (for Allegro) or cmuclrc (for CMUCL). Unfortunately, it does not work (in either init file) -- it has to be explicitly pasted into the SLIME REPL (I had just restarted my Lisp and forgot to re-evaluate the above, explaining why I did not see the warning)...

Hope posting the SLIME workaround info to the forum makes small amends for wasting your time on this issue:-)

Thanks
Srini

--- On Fri, 9/12/08, Thomas Russ <tar@...> wrote:
From: Thomas Russ <tar@...>
Subject: Re: [PowerLoom Forum] Truth maintenance system issue?
To: srini_ramaswamy_i@...
Cc: powerloom-forum@...
Date: Friday, September 12, 2008, 10:07 AM

On Sep 12, 2008, at 8:55 AM, Srini Ram wrote:

> I came across this issue the other day:
>
> Given the code:
>
> (defconcept person (?x))
> (defrelation alive (?x))
>
> (defconcept live-person (?x person)
> :<=> (alive ?x)
> )
>
> And the data:
> (assert (alive jack))
>
>
> I can ask :
> STELLA> (ask (live-person jack))
> TRUE ;; ok
> STELLA> (retract (alive jack))
> |P?|(ALIVE JACK) ;; dont
> know if jack is live now
> STELLA> (ask (live-person jack))
> UNKNOWN ;; ok
> STELLA> (assert (not (alive jack)))
> |P|(NOT (ALIVE JACK)) ;; jack is not
> alive
> STELLA> (ask (live-person jack))
> FALSE ;; ok
> STELLA> (ask (alive jack))
> FALSE ;; ok
> STELLA> (assert (alive jack))
> NULL ;;
> jack lives again

Did this fail to signal a clash for you?
When I run PowerLoom on my machine I get the following results:

* (assert (alive jack))
Derived both TRUE and FALSE for the proposition `|P#|(ALIVE JACK)'.
Clash occurred in module `|MDL|/PL-KERNEL-KB/PL-USER'.
:NULL_VALUE


>
> STELLA> (ask (alive jack))
> UNKNOWN ;; error: i
> just asserted this. hope I dont need to retract the (not (alive
> jack) before asserting the opposite?

Actually, you do need to retract (not (alive jack)).
But PowerLoom should have signaled a clash as shown above.
Did that not happen for you? It occurs when I run the latest
snapshot. (3.2.36)

> STELLA> (ask (live-person jack))
> UNKNOWN ;; error;
> same as above

UNKNOWN is the answer that will come back when asking about
inconsistent propositions. There is no inconsistent result truth
value that PowerLoom returns, so UNKNOWN is currently the best answer
that the query system can come up with.



> On a separate sequence (with different code) I got this log:
> ....
> STELLA> (ask (live-person jack))
> UNKNOWN
> STELLA> (assert (not (alive jack)))
> |P#|(ALIVE JACK)

This is already inconsistent. The key is the presence of the "#"
character in the |P#| type key ahead of the proposition. It indicates
that the particular proposition has an inconsistent truth value.

>
> STELLA> (assert (alive jack))
> |P#|(ALIVE JACK) Shouldnt the system warn me of
> inconsistency when I assert a fact and its opposite? This is a
> simple case, but when we have derived facts, this may be important...
> STELLA> (ask (live-person jack))
> UNKNOWN ;; why unknown. at least
> inconsistency should be flagged at query time, if not the time when
> inconsistent facts were asserted

This must have some inconsistent information already present.

Right now, inconsistent information is flagged (once) when the
inconsistency is detected during forward chaining.


>
>
>
> Thanks
> Srini
>
>
>
>
>
>
> _______________________________________________
> powerloom-forum mailing list
> powerloom-forum@...
> http://mailman.isi.edu/mailman/listinfo/powerloom-forum



_______________________________________________
powerloom-forum mailing list
powerloom-forum@...
http://mailman.isi.edu/mailman/listinfo/powerloom-forum

Question re. test-suite/conceive

by srini_ottawa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi ...

Looking at the normalization test cases in test-suite.plm

(clear-module "TEST")

(conceive (and))  ;; are we adding new terms to PL-KIF here? is that what conceive is  used for
(conceive (or))
(conceive (not))

(conceive (and (relation relation)))  ;; is previous definiton of and needed before this can be stated?
(conceive (or (relation relation)))

(defrelation r1 ((?x relation) (?y relation)))
(defrelation r2 (?x ?y) :<=> (r1 ?y ?x))
(defrelation r3 (?x ?y) :<=> (and (r1 ?y ?x) (= ?x ?y))) ;; which and is being used here? the
new one we defined above? But that one takes two relations as params, not two terms...judging from the expansion of R3, I think it is the pre-defined and.

(process-definitions) ;; Q. why do I need this at this point in the file...to mak sure the conceive statements are expanded?

(print-rules r1)
....

Executing the code I see:

STELLA> (print-rules r1)
(FORALL (?y ?x)
   (=>> (R1 ?y ?x)   ;; where does this =>> come from..I see nothing in the code that would cause this expansion. It should be a simple <= or =>..see highlighted rule above
        (R2 ?x ?y)))

(FORALL (?y ?x)
   (<= (R1 ?y ?x)
       (R2 ?x ?y)))

(FORALL (?y ?x)
   (<= (R1 ?y ?x)
       (R3 ?x ?y)))

Also, does conceive allow as to extend KIF with new primitives. What is the purpose of conceive...

Thanks
Srini





_______________________________________________
powerloom-forum mailing list
powerloom-forum@...
http://mailman.isi.edu/mailman/listinfo/powerloom-forum

Re: Question re. test-suite/conceive

by Thomas Russ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sep 12, 2008, at 10:49 AM, Srini Ram wrote:

> What is the purpose of conceive...

The purpose of conceive is to allow the creation of propositions  
without having to make any commitment as to what their truth value is.

In other words, it allows you to make a proposition with an unknown  
truth value.  This is in contrast to, for example, assert which  
returns a proposition with a true truth value.



_______________________________________________
powerloom-forum mailing list
powerloom-forum@...
http://mailman.isi.edu/mailman/listinfo/powerloom-forum