[Top]

# A BNF-like Description of I-X Plans

The grammar was derived from the Java class definitions for Plan and related classes, plus a small amount of additional information. XML and Relax NG schemas were produced in a similar way and are more useful for some purposes.

In the grammar, non-terminal synbols are written in upper case. Most of them correspond to class names. Alternatives for a given non-terminal are separated by "`|` " or listed in separate rules for the same non-terminal. Repetition (zero or more instances) is shown as "`...`". For example, a list of plan-nodes would be described like this:

    <list>PLAN-NODE...</list>

All fields represented as elements are implicitly optional and may occur in any order

There is a close correspondence with the semi-formal notation used earlier. For example,

    plan:
       element plan-variable-declarations: list of plan-variable-declaration
       element plan-issues: list of plan-issue
       element plan-issue-refinements: list of plan-issue-refinement
       element plan-nodes: list of plan-node
       element plan-refinements: list of plan-refinement
       element constraints: list of constrainer
       element world-state: list of pattern-assignment
       element annotations: map

becomes

    PLAN ::=
       <plan
          <plan-variable-declarations>
             <list>PLAN-VARIABLE-DECLARATION...</list>
          </plan-variable-declarations>
          <plan-issues><list>PLAN-ISSUE...</list></plan-issues>
          <plan-issue-refinements>
             <list>PLAN-ISSUE-REFINEMENT...</list>
          </plan-issue-refinements>
          <plan-nodes><list>PLAN-NODE...</list></plan-nodes>
          <plan-refinements><list>PLAN-REFINEMENT...</list></plan-refinements>
          <constraints><list>CONSTRAINER...</list></constraints>
          <world-state><list>PATTERN-ASSIGNMENT...</list></world-state>
          <annotations><map>MAP-ENTRY...</map></annotations>
       </plan>

`OBJECT` should be understood as standing for any object represented in I-X XML. For example, the syntax for a map is `<map>MAP-ENTRY...</map>` where

    MAP-ENTRY ::=
       <map-entry>
          <key>OBJECT</key>
          <value>OBJECT</value>
       </map-entry>

A map therefore contains a sequence of zero or more map-entries, and the keys and values in the map-entries map be any representable objects.

## Comparison with the XML and RELAX NG Schemas

The syntax of atomic objects other than enumerations is not included in the BNF-style grammar.

The XML and RELAX NG schemas give a syntax for everything that would normally appear in a plan. [It is not possible to give an absolutely complete syntax in a file prepared in advance, because new representable classes may be defined at any time.]

However, the XML schema cannot give the syntax of particular constraint types, because the contents of their `parameters` field varies depending on the values of the `type` and `relation` fields. For that level of detail about constraint syntax, see the rules for `KNOWN-CONSTRAINT` in the BNF-style grammar or in the RELAX NG constraint schema.