pi [Macro]
Purpose
The pi macro prints an assertion that contains all the facts currently known about a particular instance. This macro should be used interactively rather than in application code.
Syntax
pi datum &key assertions-only-p
Arguments
The datum argument is a Lisp form. It may be an extended identifier having the form kb\^{\space}name, where kb is the knowledge base from which the search starts. It may also be an identifier beginning and/or ending with the wildcard character *, in which case the search proceeds until the first matching object is found. It is not necessary to specify the package in which datum resides since the search is package-independent. If datum is a symbol, Loom first tries to locate the object named by that symbol. If this fails, or if datum is a list, Loom evaluates datum and searches for the object corresponding to the resulting value.
If the assertions-only-p argument is t, pi behaves like save-kb and only prints assertions explicitly made by the user. Otherwise, the output reflects inferences made by Loom, and it may differ considerably from the user's original input.
Value
The return value is nil.
Remarks
Loom provides the pi macro as a development tool. Because datum may be evaluated at compile time, pi cannot be reliably used in application code.
Examples
(defconcept Man :is-primitive Person)
(defrelation wife :domain Man)
(tellm (:about Joe Person (wife Sue)) (:about Joe-Bob (age 39)))
(setq inst (tell (:about Sue (:exactly 2 child))))
(pi Joe) --> (TELL (:ABOUT JOE MAN (WIFE SUE)))
(pi Joe :assertions-only-p t) --> (TELL (:ABOUT JOE PERSON (WIFE SUE)))
(pi Joe-*) --> (TELL (:ABOUT JOE-BOB THING (AGE 39)))
(pi inst) --> (TELL (:ABOUT SUE THING (:EXACTLY 2 CHILD)))
See Also
Last modified: Jun 1 1995