ISSUE ::=
   <issue
         status="STATUS"
         priority="PRIORITY"
         id="NAME"
         sender-id="NAME"
         ref="NAME"
         report-back="YES-NO">
      <pattern><list>...</list></pattern>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </issue>

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

STATUS ::= blank | complete | executing | possible | impossible | n/a

PRIORITY ::= lowest | low | normal | high | highest

YES-NO ::= yes | no

ACTIVITY ::=
   <activity
         status="STATUS"
         priority="PRIORITY"
         id="NAME"
         sender-id="NAME"
         ref="NAME"
         report-back="YES-NO">
      <pattern><list>...</list></pattern>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </activity>

CONSTRAINT ::=
   <constraint
         type="SYMBOL"
         relation="SYMBOL"
         sender-id="NAME">
      <parameters><list>...</list></parameters>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </constraint>

CONSTRAINT ::= KNOWN-CONSTRAINT

KNOWN-CONSTRAINT ::=
   <constraint type="world-state" relation="conditiion">
      <parameters>
         <list>PATTERN-ASSIGNMENT</list>
      </parameters>
   </constraint>

KNOWN-CONSTRAINT ::=
   <constraint type="world-state" relation="effect">
      <parameters>
         <list>PATTERN-ASSIGNMENT</list>
      </parameters>
   </constraint>

KNOWN-CONSTRAINT ::=
   <constraint type="compute">
      <parameters>
         <list>PATTERN-ASSIGNMENT</list>
      </parameters>
   </constraint>

KNOWN-CONSTRAINT ::=
   <constraint type="compute" relation="multiple-answer">
      <parameters>
         <list>PATTERN-ASSIGNMENT</list>
      </parameters>
   </constraint>

KNOWN-CONSTRAINT ::=
   <constraint type="temporal" relation="duration">
      <parameters>
         <list>NAME TIME-WINDOW</list>
      </parameters>
   </constraint>

KNOWN-CONSTRAINT ::=
   <constraint type="resource" relation="?operation">
      <parameters>
         <list>PATTERN-ASSIGNMENT</list>
      </parameters>
   </constraint>

KNOWN-CONSTRAINT ::=
   <constraint type="advice" relation="expansion-refinement">
      <parameters>
         <list>SYMBOL LIST-OF-SYMBOL</list>
      </parameters>
   </constraint>

KNOWN-CONSTRAINT ::=
   <constraint type="?type" relation="?subtype">
      <parameters>
         <list>PATTERN-ASSIGNMENT</list>
      </parameters>
   </constraint>

ORDERING ::=
   <ordering>
      <from>NODE-END-REF</from>
      <to>NODE-END-REF</to>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </ordering>

NODE-END-REF ::=
   <node-end-ref
         end="END"
         node="NAME">
   </node-end-ref>

END ::= begin | end

PATTERN-ASSIGNMENT ::=
   <pattern-assignment>
      <pattern><list>...</list></pattern>
      <value>OBJECT</value>
   </pattern-assignment>

REPORT ::=
   <report
         report-type="REPORT-TYPE"
         priority="PRIORITY"
         sender-id="NAME"
         ref="NAME">
      <text>STRING</text>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </report>

REPORT-TYPE ::= success | failure | progress | information | event

CHAT-MESSAGE ::=
   <chat-message
         sender-id="NAME">
      <text>STRING</text>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </chat-message>

DOMAIN ::=
   <domain>
      <name>STRING</name>
      <variable-declarations>
         <list>VARIABLE-DECLARATION...</list>
      </variable-declarations>
      <refinements><list>REFINEMENT...</list></refinements>
      <object-classes><list>OBJECT-CLASS...</list></object-classes>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </domain>

VARIABLE-DECLARATION ::=
   <variable-declaration
         name="ITEM-VAR">
      <annotations><map>MAP-ENTRY...</map></annotations>
   </variable-declaration>

REFINEMENT ::=
   <refinement>
      <name>STRING</name>
      <pattern><list>...</list></pattern>
      <variable-declarations>
         <list>VARIABLE-DECLARATION...</list>
      </variable-declarations>
      <nodes><list>NODE-SPEC...</list></nodes>
      <orderings><list>ORDERING...</list></orderings>
      <constraints><list>CONSTRAINT...</list></constraints>
      <issues><list>ISSUE...</list></issues>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </refinement>

NODE-SPEC ::=
   <node-spec
         id="NAME">
      <pattern><list>...</list></pattern>
   </node-spec>

OBJECT-CLASS ::=
   <object-class>
      <name>STRING</name>
      <super-class-names><list>SYMBOL...</list></super-class-names>
      <object-properties><list>OBJECT-PROPERTY...</list></object-properties>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </object-class>

OBJECT-PROPERTY ::=
   <object-property
         name="SYMBOL"
         value-class-name="SYMBOL"
         syntax="OBJECT-PROPERTY__SYNTAX">
   </object-property>

OBJECT-PROPERTY__SYNTAX ::= number | symbol | string | list | object | default

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>

PLAN-VARIABLE-DECLARATION ::=
   <plan-variable-declaration
         id="NAME"
         name="SYMBOL"
         scope="VARIABLE-SCOPE">
      <annotations><map>MAP-ENTRY...</map></annotations>
   </plan-variable-declaration>

VARIABLE-SCOPE ::= local | global

PLAN-ISSUE ::=
   <plan-issue
         id="NAME"
         expansion="NAME">
      <issue>ISSUE</issue>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </plan-issue>

PLAN-ISSUE-REFINEMENT ::=
   <plan-issue-refinement
         id="NAME"
         expands="NAME">
      <plan-variable-declarations>
         <list>PLAN-VARIABLE-DECLARATION...</list>
      </plan-variable-declarations>
      <plan-issues><list>PLAN-ISSUE...</list></plan-issues>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </plan-issue-refinement>

PLAN-NODE ::=
   <plan-node
         id="NAME"
         expansion="NAME">
      <activity>ACTIVITY</activity>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </plan-node>

PLAN-REFINEMENT ::=
   <plan-refinement
         id="NAME"
         expands="NAME">
      <plan-variable-declarations>
         <list>PLAN-VARIABLE-DECLARATION...</list>
      </plan-variable-declarations>
      <plan-nodes><list>PLAN-NODE...</list></plan-nodes>
      <constraints><list>CONSTRAINER...</list></constraints>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </plan-refinement>

CONSTRAINER ::= CONSTRAINT | ORDERING

PLAN-VARIABLE ::=
   <plan-variable
         id="NAME"
         name="SYMBOL">
      <annotations><map>MAP-ENTRY...</map></annotations>
   </plan-variable>
