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

NextPrevUpTopContentsIndex

assert

Backward Chaining Goal
Summary

Creates or modifies objects in the object base.

Signature

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

Arguments

class-name

The name of a class.

variable

A variable beginning with ?.

slot-name

The name of a slot in the class-name.

term

An expression.

Description

The 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 the 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 (Windows version) - 26 Feb 2015

NextPrevUpTopContentsIndex