All Manuals > KnowledgeWorks and Prolog User Guide > 7 Reference Guide

assert Backward Chaining Goal

Summary

Creates or modifies objects in the object base.

Package

kw

Signature

assert (class-name variable {slot-and-term}*)

slot-and-term ::= (slot-name term)

Arguments
class-name
The name of a class.
variable
A variable beginning with ?.
slot-name
The name of a slot in class-name.
term
An expression.
Description

The backward chaining goal assert creates or modifies objects in the object base.

class-name must be the name of a class of objects known to KnowledgeWorks. Each term is an expression composed of Lisp data structures and KnowledgeWorks variables.

If variable is unbound a new instance of class-name is created with each named slot-name initialized to the value of the corresponding term.

If variable is bound, that bound instance has its named slots modified to contain the values of term corresponding to each slot-name. It is an error if the bound object is not of the named class.

It is an error to put an unbound variable into a slot of an object in the object base.

Only objects in the current inferencing state will be affected.

Examples
(assert (truck ?truck driver ?driver))
(assert (possible-trucks ? trucks (?truck . ?trucks))
See also

erase


KnowledgeWorks and Prolog User Guide (Unix version) - 01 Dec 2021 19:35:49