NAME

add-wme - Add a working memory element

SYNOPSIS

add-wme id [^]attribute value [+]

DESCRIPTION

This command adds an element to working memory and returns the timetag of the wme. In effect, Soar's working memory is surgically altered by this command. add-wme adds a new wme with the given id, attribute, value, and optional preference. The given id must be an existing identifier. The attribute and value fields can be any Soar symbol. If * is given in the attribute or value field, Soar creates a new identifier (symbol) for that field. If the preference is given, it can only have the value + to indicate that an acceptable preference should be created for this wme.

add-wme is often used by an input function to update Soar's information about the state of the external world.

EXAMPLES

This example adds the attribute/value pair "message-status received" to the identifier (symbol) S1:
add-wme S1 ^message-status received

This example adds an attribute/value pair with an acceptable preference to the identifier (symbol) Z2. The attribute is "message" and the value is a unique identifier generated by Soar. Note that since the ^ is optional, it has been left off in this case.

add-wme Z2 message * +

WARNINGS

This command is inherently unstable and may have weird side effects (possibly even including system crashes). For example, the chunker can't backtrace through wmes created via add-wme. Removing input wmes or context/impasse wmes may have unexpected side effects. You've been warned.

SEE ALSO

remove-wme