Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Latest commit

 

History

History
77 lines (55 loc) · 2.44 KB

cmd_production_find.wiki

File metadata and controls

77 lines (55 loc) · 2.44 KB

  1. summary production-find command documentation

Table of Contents

production-find

Find productions by condition or action patterns.

Synopsis

Options

|| `-c, --chunks` || Look _only_ for chunks that match the pattern. || || `-l, --lhs` || Match pattern only against the conditions (left-hand side) of productions (default). || || `-n, --nochunks` || _Disregard_ chunks when looking for the pattern. || || `-r, --rhs` || Match pattern against the actions (right-hand side) of productions. || || `-s, --show-bindings` || Show the bindings associated with a wildcard pattern. || || `pattern` || Any pattern that can appear in productions. ||

Description

The production-find command is used to find productions in production memory that include conditions or actions that match a given `pattern`. The pattern given specifies one or more condition elements on the left hand side of productions (or negated conditions), or one or more actions on the right-hand side of productions. Any pattern that can appear in productions can be used in this command. In addition, the asterisk symbol, `*`, can be used as a wildcard for an attribute or value. It is important to note that the whole pattern, including the parenthesis, must be enclosed in curly braces for it to be parsed properly.

The variable names used in a call to production-find do not have to match the variable names used in the productions being retrieved.

The production-find command can also be restricted to apply to only certain types of productions, or to look only at the conditions or only at the actions of productions by using the flags.

Examples

Find productions that test that some object `gumby` has an attribute `alive` with value `t`. In addition, limit the rules to only those that test an operator named `foo`:

Note that in the above command, `<state></state>` does not have to match the exact variable name used in the production.

Find productions that propose the operator `foo`:

Find chunks that test the attribute ^pokey:

Examples using the water-jugs demo:

See Also

[cmd_sp]