Re: Unexpected Powerloom truth maintenance behavior....
Srini Ram <[email protected]> Fri, 22 Aug 2008 11:00:14 -0700 (PDT)
| Newsgroups | gmane.comp.ai.powerloom |
|---|---|
| Message-ID | <[email protected]> |
Thanks Tom, The :NONE issue was at the source of most of my problems....Its fine now. I had tried with parens around variables, but it hadnt worked. I guess the :NONE was the issue there. (ask (forall (?x ?y) (=> (and (spouse ?x ?y) (alive ?x) (alive ?y)) (married ?x ?y)))) Evaluation aborted. Same query seems to work now with the :NONE issue fixed.. As for why I didnt see the error, it was because I am using slime, and the error is actually seen in another buffer (the actual lisp process) which I was not monitoring. Thanks Srini --- On Thu, 8/21/08, Thomas Russ <[email protected]> wrote: From: Thomas Russ <[email protected]> Subject: Re: [PowerLoom Forum] Unexpected Powerloom truth maintenance behavior.... To: [email protected] Cc: [email protected] Date: Thursday, August 21, 2008, 3:23 PM On Aug 21, 2008, at 10:59 AM, Srini Ram wrote: > 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? The asks are syntactically mal-formed. You need to put parentheses around the variable list, like so: (ask (forall (?x ?y) (=> (and (spouse ?x ?y) (alive ?x) (alive ? y)) (married ?x ?y)))) Then it works for me. The query returns TRUE. When I tried your original version, I got the following error message: PARSING ERROR: Illegal ASK query: `((FORALL ?X ?Y (=> (AND (SPOUSE ?X ?Y) (ALIVE ?X) (ALIVE ?Y)) (MARRIED ?X ?Y))))'. Did that not show up in your version? Do you redirect *error-output* by any chance? This also works similarly for the second query: (ask (forall ((?x person) (?y person)) (=> (and (spouse ?x ?y) (alive ? x) (alive ?y)) (married ?x ?y)))) > > > I tried (setq *type-check-strategy* :NONE) If you typed this at the top level in Lisp, then it would explain the second error you reported. This will set the value of *type-check-strategy* to the LISP keyword :NONE, and it needs to be set to the STELLA keyword :NONE instead. To make sure you get Stella keywords, you have to take a bit more care. It is one area where the integration with the Lisp READ-EVAL-PRINT loop is not complete. That is because we don't really want to muck around with the reader to change the way symbols are read. So you have to make sure you provide the appropriate keyword value. The easiest way to do that is to use the PLI:GET-KEYWORD function: STELLA> (pli:get-keyword "NONE") :NONE STELLA> (cl:describe cl:*) :NONE is an instance of class #<COMMON-LISP:STANDARD-CLASS KEYWORD>. The following slots have :INSTANCE allocation: HOME-CONTEXT :NULL_VALUE SYMBOL-NAME "NONE" SYMBOL-ID 24 ; No value STELLA> (cl:describe :none) :NONE is an external symbol in #<COMMON-LISP:PACKAGE "KEYWORD">. It is a constant; its value is :NONE. ; No value So you would need to do (setq *type-check-strategy* (pli:get-keyword "NONE")) in order to have things work properly. _______________________________________________ powerloom-forum mailing list [email protected] http://mailman.isi.edu/mailman/listinfo/powerloom-forum