Basic Parts of a Rule

< Previous | Contents | Manuals Home | Boris FX | Next >

Basic Parts of a Rule

Each rule has a left-hand side, a nonterminal, that says what the result produced by the rule is, and a right-hand side, which are the words that the rule will match. For example,

<a color> :: royal blue

The rule causes Synthia to recognize the words "royal blue" and interpret them as a color.

The right-hand side can be any number of words, numbers, strings, or nonterminals. There are wild-card words as well: any_word, any_number, or any_string, though you should rarely have to use them.

Sometimes you want to not create a nonterminal and include the word "a" literally on the right-hand side of the rule, for example the menu command read 1f at a time. To do that, include the "a" as a string by enclosing it in back quotes: rule for sing me `a` song matches sing me a song.

Exercise: try the obvious

You can look at the actual rule as printed out, rule for royal blue. rule1663 <a color> :: royal blue (LLgetnmv) => #E16941

In addition to the rule name/number (which can change) at far left, the nonterminal, and the words to be recognized, each rule says what to do when you run it (an internal routine name, ie LLgetnmv), and has an auxiliary value (here, the standard web color specification #E16941). These additional parts of the rule are generated automatically when a rule is created (by one of the rule-creation rules).

Here’s another rule:

<a sentence> :: say a color

The left-hand side nonterminal is a sentence. The right-hand side is the word say, followed by the non-terminal <a color>. As a result, this sentence can be used to say any color. For example,

say light steel blue

or

say the color closest to 250 230 200

or

say tracker 1's color

Synthia’s power comes from its ability to search and assemble thousands of rules to interpret whatever you say.

Exercise: what nonterminal matches an outcome? What else matches it?

©2024 Boris FX, Inc. — UNOFFICIAL — Converted from original PDF.