(silently (initialize-my-kb-fn))See the version 3 documentation for more information about tracing in Algernon.
(find-rule key) if-added rules: KEY is the first clause of the antecedent. if-needed rules: KEY is the first clause of the consequent. Example: (find-rule '(isa ?x physical-objects)) ==> RULE17After finding a rule, you may wish to trace it:
(algy-trace-rule rule-frame) (algy-untrace-rule rule-frame) Examples: (algy-trace-rule 'RULE17) (algy-untrace-rule 'RULE23)
First, continuations can be suppressed on a per-clause basis when a rule is defined. In the example below, no rule continuations will be created for the third clause of the antecedent of the rule. (Continuations are never created for clauses in the consequent of a rule.)
((father ?me ?dad) (brother ?dad ?uncle) (:NO-CONTINUATION (sister ?uncle ?aunt)) -> (aunt ?me ?aunt))
You may wish to suppress rule continuations for an entire rule. You may
do this when the rule is defined by using the WITH-NO-CONTINUATIONS
macro, as in the following example:
(with-no-continuations (tell '((father ?me ?dad) (brother ?dad ?uncle) (sister ?uncle ?aunt) -> (aunt ?me ?aunt)))Note that this must be done when the rule is defined, not when the rule is executed.
:SHOW
operator
in Algernon.
(tell '((:show Mary)))For more flexibility from
LISP
, you can call the following
functions from the SFS module:
SFS:KB-PRINT frame &OPTIONAL stream SFS:KB-PRINT-FACET frame &OPTIONAL stream SFS:KB-PRINT-FRAME frame &OPTIONAL stream SFS:KB-PRINT-FRAME-NO-RULES frame &OPTIONAL stream SFS:KB-PRINT-SLOT frame &OPTIONAL streamSFS stands for Simple Frame System, which is the module that stores Algernon frames and slots. If you call
SFS:KB-PRINT
,
it will try to figure out what the object is (slot, frame, etc.)
and call the appropriate function. If you know what you are
printing, you can directly call an appropriate function
such as SFS:KB-PRINT-FRAME
.
ALGY-STATS
to count the number
of frames and relations in the current KB.
This page was created by
Micheal Hewett