Re: Question about all-facts-of..

Thomas Russ <[email protected]> Wed, 27 Aug 2008 10:54:31 -0700
Newsgroups gmane.comp.ai.powerloom
Message-ID <[email protected]>
Oops.  Initially missed the second part of the question.

On Aug 27, 2008, at 8:57 AM, Srini Ram wrote:

>
>
> Also are
> Function: all-facts-of-instance ((self OBJECT) (includeunknownfacts?  
> BOOLEAN) (elaborate? BOOLEAN)) : (LIST OF PROPOSITION) Return a list  
> of all definite (TRUE or FALSE) propositions attached to self.
> N-Command: all-facts-of-n ((n INTEGER) &rest (instanceRefs NAME)) :  
> (CONS OF PROPOSITION) available (as documented in the misc section).  
> I get an error when trying to use them.

They work for me.

ALL-FACTS-OF-INSTANCE:

Note that this is a function, and so requires the actual objects to be  
passed.  You will not be able to invoke it from the standard PowerLoom  
prompt.  It needs to be called from code.  (Of course, in Lisp, you  
can call it directly, but you have to pass arguments of the proper  
types:

   * (all-facts-of-instance (pli:get-object "BILL" null null) cl:nil  
cl:nil)
   |l|(|P|(PERSON BILL) |P|(FRIEND BILL BOB))

Note that the return type is a Stella LIST object.


ALL-FACTS-OF-N:

This is a command and so is useable from the standard PowerLoom prompt  
as well as being available as a Lisp form in the top-level REPL.

   * (all-facts-of-n 0 bill)
   (|P|(PERSON BILL) |P|(FRIEND BILL BOB))

   * (all-facts-of-n 1 bill)
   (|P|(PERSON BILL) |P|(FRIEND BILL BOB) |P|(PERSON BOB) |P|(FRIEND  
BOB JOE))

   * (all-facts-of-n 2 bill)
   (|P|(PERSON BILL) |P|(FRIEND BILL BOB) |P|(PERSON BOB) |P|(FRIEND  
BOB JOE)
    |P|(PERSON JOE))