<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.aiai.ed.ac.uk/project/ix/" targetNamespace="http://www.aiai.ed.ac.uk/project/ix/" elementFormDefault="qualified">

 <!--Prelude-->

 <xsd:element name="OBJECT" abstract="true" />

 <xsd:complexType name="OBJECT-as-element">
  <xsd:sequence>
   <xsd:element ref="OBJECT" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:element name="LIST" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="list" type="list" substitutionGroup="LIST" />

 <xsd:complexType name="LIST-as-element">
  <xsd:sequence>
   <xsd:element ref="LIST" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="list">
  <xsd:sequence>
   <xsd:element ref="OBJECT" minOccurs="0" maxOccurs="unbounded" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:element name="MAP" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="map" type="map" substitutionGroup="MAP" />

 <xsd:complexType name="MAP-as-element">
  <xsd:sequence>
   <xsd:element ref="MAP" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="map">
  <xsd:sequence>
   <xsd:element name="map-entry" minOccurs="0" maxOccurs="unbounded">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name="key" type="OBJECT-as-element" />
      <xsd:element name="value" type="OBJECT-as-element" />
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
  </xsd:sequence>
 </xsd:complexType>

 <!--plan-->

 <xsd:element name="PLAN" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="plan" type="plan" substitutionGroup="PLAN" />

 <xsd:complexType name="PLAN-as-element">
  <xsd:sequence>
   <xsd:element ref="PLAN" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="plan">
  <xsd:all>
   <xsd:element name="plan-variable-declarations" type="list-of-PLAN-VARIABLE-DECLARATION-as-element" minOccurs="0" />
   <xsd:element name="plan-issues" type="list-of-PLAN-ISSUE-as-element" minOccurs="0" />
   <xsd:element name="plan-issue-refinements" type="list-of-PLAN-ISSUE-REFINEMENT-as-element" minOccurs="0" />
   <xsd:element name="plan-nodes" type="list-of-PLAN-NODE-as-element" minOccurs="0" />
   <xsd:element name="plan-refinements" type="list-of-PLAN-REFINEMENT-as-element" minOccurs="0" />
   <xsd:element name="constraints" type="list-of-CONSTRAINER-as-element" minOccurs="0" />
   <xsd:element name="world-state" type="list-of-PATTERN-ASSIGNMENT-as-element" minOccurs="0" />
   <xsd:element name="annotations" type="MAP-as-element" minOccurs="0" />
  </xsd:all>
 </xsd:complexType>

 <!--plan-variable-declaration-->

 <xsd:element name="PLAN-VARIABLE-DECLARATION" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="plan-variable-declaration" type="plan-variable-declaration" substitutionGroup="PLAN-VARIABLE-DECLARATION" />

 <xsd:complexType name="PLAN-VARIABLE-DECLARATION-as-element">
  <xsd:sequence>
   <xsd:element ref="PLAN-VARIABLE-DECLARATION" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="plan-variable-declaration">
  <xsd:all>
   <xsd:element name="annotations" type="MAP-as-element" minOccurs="0" />
  </xsd:all>
  <xsd:attribute name="id" type="name" />
  <xsd:attribute name="name" type="symbol" />
  <xsd:attribute name="scope" type="variable-scope" />
 </xsd:complexType>

 <xsd:complexType name="list-of-PLAN-VARIABLE-DECLARATION-as-element">
  <xsd:sequence>
   <xsd:element name="list" type="list-of-PLAN-VARIABLE-DECLARATION" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="list-of-PLAN-VARIABLE-DECLARATION">
  <xsd:sequence>
   <xsd:element ref="PLAN-VARIABLE-DECLARATION" minOccurs="0" maxOccurs="unbounded" />
  </xsd:sequence>
 </xsd:complexType>

 <!--name-->

 <xsd:element name="NAME" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="name" type="name" substitutionGroup="NAME" />

 <xsd:complexType name="NAME-as-element">
  <xsd:sequence>
   <xsd:element ref="NAME" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:simpleType name="name">
  <xsd:restriction base="xsd:string" />
 </xsd:simpleType>

 <!--symbol-->

 <xsd:element name="SYMBOL" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="symbol" type="symbol" substitutionGroup="SYMBOL" />

 <xsd:complexType name="SYMBOL-as-element">
  <xsd:sequence>
   <xsd:element ref="SYMBOL" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:simpleType name="symbol">
  <xsd:restriction base="xsd:string" />
 </xsd:simpleType>

 <!--variable-scope-->

 <xsd:element name="VARIABLE-SCOPE" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="variable-scope" type="variable-scope" substitutionGroup="VARIABLE-SCOPE" />

 <xsd:complexType name="VARIABLE-SCOPE-as-element">
  <xsd:sequence>
   <xsd:element ref="VARIABLE-SCOPE" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:simpleType name="variable-scope">
  <xsd:restriction base="xsd:string">
   <xsd:enumeration value="local" />
   <xsd:enumeration value="global" />
  </xsd:restriction>
 </xsd:simpleType>

 <!--plan-issue-->

 <xsd:element name="PLAN-ISSUE" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="plan-issue" type="plan-issue" substitutionGroup="PLAN-ISSUE" />

 <xsd:complexType name="PLAN-ISSUE-as-element">
  <xsd:sequence>
   <xsd:element ref="PLAN-ISSUE" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="plan-issue">
  <xsd:all>
   <xsd:element name="issue" type="ISSUE-as-element" minOccurs="0" />
   <xsd:element name="annotations" type="MAP-as-element" minOccurs="0" />
  </xsd:all>
  <xsd:attribute name="id" type="name" />
  <xsd:attribute name="expansion" type="name" />
 </xsd:complexType>

 <xsd:complexType name="list-of-PLAN-ISSUE-as-element">
  <xsd:sequence>
   <xsd:element name="list" type="list-of-PLAN-ISSUE" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="list-of-PLAN-ISSUE">
  <xsd:sequence>
   <xsd:element ref="PLAN-ISSUE" minOccurs="0" maxOccurs="unbounded" />
  </xsd:sequence>
 </xsd:complexType>

 <!--issue-->

 <xsd:element name="ISSUE" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="issue" type="issue" substitutionGroup="ISSUE" />

 <xsd:complexType name="ISSUE-as-element">
  <xsd:sequence>
   <xsd:element ref="ISSUE" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="issue">
  <xsd:all>
   <xsd:element name="pattern" type="LIST-as-element" minOccurs="0" />
   <xsd:element name="annotations" type="MAP-as-element" minOccurs="0" />
  </xsd:all>
  <xsd:attribute name="status" type="status" />
  <xsd:attribute name="priority" type="priority" />
  <xsd:attribute name="sender-id" type="name" />
  <xsd:attribute name="ref" type="name" />
  <xsd:attribute name="report-back" type="yes-no" />
 </xsd:complexType>

 <!--status-->

 <xsd:element name="STATUS" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="status" type="status" substitutionGroup="STATUS" />

 <xsd:complexType name="STATUS-as-element">
  <xsd:sequence>
   <xsd:element ref="STATUS" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:simpleType name="status">
  <xsd:restriction base="xsd:string">
   <xsd:enumeration value="blank" />
   <xsd:enumeration value="complete" />
   <xsd:enumeration value="executing" />
   <xsd:enumeration value="possible" />
   <xsd:enumeration value="impossible" />
   <xsd:enumeration value="n/a" />
  </xsd:restriction>
 </xsd:simpleType>

 <!--priority-->

 <xsd:element name="PRIORITY" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="priority" type="priority" substitutionGroup="PRIORITY" />

 <xsd:complexType name="PRIORITY-as-element">
  <xsd:sequence>
   <xsd:element ref="PRIORITY" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:simpleType name="priority">
  <xsd:restriction base="xsd:string">
   <xsd:enumeration value="lowest" />
   <xsd:enumeration value="low" />
   <xsd:enumeration value="normal" />
   <xsd:enumeration value="high" />
   <xsd:enumeration value="highest" />
  </xsd:restriction>
 </xsd:simpleType>

 <!--yes-no-->

 <xsd:element name="YES-NO" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="yes-no" type="yes-no" substitutionGroup="YES-NO" />

 <xsd:complexType name="YES-NO-as-element">
  <xsd:sequence>
   <xsd:element ref="YES-NO" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:simpleType name="yes-no">
  <xsd:restriction base="xsd:string">
   <xsd:enumeration value="yes" />
   <xsd:enumeration value="no" />
  </xsd:restriction>
 </xsd:simpleType>

 <!--plan-issue-refinement-->

 <xsd:element name="PLAN-ISSUE-REFINEMENT" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="plan-issue-refinement" type="plan-issue-refinement" substitutionGroup="PLAN-ISSUE-REFINEMENT" />

 <xsd:complexType name="PLAN-ISSUE-REFINEMENT-as-element">
  <xsd:sequence>
   <xsd:element ref="PLAN-ISSUE-REFINEMENT" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="plan-issue-refinement">
  <xsd:all>
   <xsd:element name="plan-variable-declarations" type="list-of-PLAN-VARIABLE-DECLARATION-as-element" minOccurs="0" />
   <xsd:element name="plan-issues" type="list-of-PLAN-ISSUE-as-element" minOccurs="0" />
   <xsd:element name="annotations" type="MAP-as-element" minOccurs="0" />
  </xsd:all>
  <xsd:attribute name="id" type="name" />
  <xsd:attribute name="expands" type="name" />
 </xsd:complexType>

 <xsd:complexType name="list-of-PLAN-ISSUE-REFINEMENT-as-element">
  <xsd:sequence>
   <xsd:element name="list" type="list-of-PLAN-ISSUE-REFINEMENT" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="list-of-PLAN-ISSUE-REFINEMENT">
  <xsd:sequence>
   <xsd:element ref="PLAN-ISSUE-REFINEMENT" minOccurs="0" maxOccurs="unbounded" />
  </xsd:sequence>
 </xsd:complexType>

 <!--plan-node-->

 <xsd:element name="PLAN-NODE" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="plan-node" type="plan-node" substitutionGroup="PLAN-NODE" />

 <xsd:complexType name="PLAN-NODE-as-element">
  <xsd:sequence>
   <xsd:element ref="PLAN-NODE" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="plan-node">
  <xsd:all>
   <xsd:element name="activity" type="ACTIVITY-as-element" minOccurs="0" />
   <xsd:element name="annotations" type="MAP-as-element" minOccurs="0" />
  </xsd:all>
  <xsd:attribute name="id" type="name" />
  <xsd:attribute name="expansion" type="name" />
 </xsd:complexType>

 <xsd:complexType name="list-of-PLAN-NODE-as-element">
  <xsd:sequence>
   <xsd:element name="list" type="list-of-PLAN-NODE" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="list-of-PLAN-NODE">
  <xsd:sequence>
   <xsd:element ref="PLAN-NODE" minOccurs="0" maxOccurs="unbounded" />
  </xsd:sequence>
 </xsd:complexType>

 <!--activity-->

 <xsd:element name="ACTIVITY" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="activity" type="activity" substitutionGroup="ACTIVITY" />

 <xsd:complexType name="ACTIVITY-as-element">
  <xsd:sequence>
   <xsd:element ref="ACTIVITY" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="activity">
  <xsd:all>
   <xsd:element name="pattern" type="LIST-as-element" minOccurs="0" />
   <xsd:element name="annotations" type="MAP-as-element" minOccurs="0" />
  </xsd:all>
  <xsd:attribute name="status" type="status" />
  <xsd:attribute name="priority" type="priority" />
  <xsd:attribute name="sender-id" type="name" />
  <xsd:attribute name="ref" type="name" />
  <xsd:attribute name="report-back" type="yes-no" />
 </xsd:complexType>

 <!--plan-refinement-->

 <xsd:element name="PLAN-REFINEMENT" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="plan-refinement" type="plan-refinement" substitutionGroup="PLAN-REFINEMENT" />

 <xsd:complexType name="PLAN-REFINEMENT-as-element">
  <xsd:sequence>
   <xsd:element ref="PLAN-REFINEMENT" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="plan-refinement">
  <xsd:all>
   <xsd:element name="plan-variable-declarations" type="list-of-PLAN-VARIABLE-DECLARATION-as-element" minOccurs="0" />
   <xsd:element name="plan-nodes" type="list-of-PLAN-NODE-as-element" minOccurs="0" />
   <xsd:element name="constraints" type="list-of-CONSTRAINER-as-element" minOccurs="0" />
   <xsd:element name="annotations" type="MAP-as-element" minOccurs="0" />
  </xsd:all>
  <xsd:attribute name="id" type="name" />
  <xsd:attribute name="expands" type="name" />
 </xsd:complexType>

 <xsd:complexType name="list-of-PLAN-REFINEMENT-as-element">
  <xsd:sequence>
   <xsd:element name="list" type="list-of-PLAN-REFINEMENT" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="list-of-PLAN-REFINEMENT">
  <xsd:sequence>
   <xsd:element ref="PLAN-REFINEMENT" minOccurs="0" maxOccurs="unbounded" />
  </xsd:sequence>
 </xsd:complexType>

 <!--constrainer-->

 <xsd:element name="CONSTRAINER" abstract="true" substitutionGroup="OBJECT" />

 <!--Since constrainer is abstract, no "constrainer" element or type declaration is needed.-->

 <xsd:complexType name="CONSTRAINER-as-element">
  <xsd:sequence>
   <xsd:element ref="CONSTRAINER" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="list-of-CONSTRAINER-as-element">
  <xsd:sequence>
   <xsd:element name="list" type="list-of-CONSTRAINER" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="list-of-CONSTRAINER">
  <xsd:sequence>
   <xsd:element ref="CONSTRAINER" minOccurs="0" maxOccurs="unbounded" />
  </xsd:sequence>
 </xsd:complexType>

 <!--pattern-assignment-->

 <xsd:element name="PATTERN-ASSIGNMENT" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="pattern-assignment" type="pattern-assignment" substitutionGroup="PATTERN-ASSIGNMENT" />

 <xsd:complexType name="PATTERN-ASSIGNMENT-as-element">
  <xsd:sequence>
   <xsd:element ref="PATTERN-ASSIGNMENT" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="pattern-assignment">
  <xsd:all>
   <xsd:element name="pattern" type="LIST-as-element" minOccurs="0" />
   <xsd:element name="value" type="OBJECT-as-element" minOccurs="0" />
  </xsd:all>
 </xsd:complexType>

 <xsd:complexType name="list-of-PATTERN-ASSIGNMENT-as-element">
  <xsd:sequence>
   <xsd:element name="list" type="list-of-PATTERN-ASSIGNMENT" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="list-of-PATTERN-ASSIGNMENT">
  <xsd:sequence>
   <xsd:element ref="PATTERN-ASSIGNMENT" minOccurs="0" maxOccurs="unbounded" />
  </xsd:sequence>
 </xsd:complexType>

 <!--plan-variable-->

 <xsd:element name="PLAN-VARIABLE" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="plan-variable" type="plan-variable" substitutionGroup="PLAN-VARIABLE" />

 <xsd:complexType name="PLAN-VARIABLE-as-element">
  <xsd:sequence>
   <xsd:element ref="PLAN-VARIABLE" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="plan-variable">
  <xsd:all>
   <xsd:element name="annotations" type="MAP-as-element" minOccurs="0" />
  </xsd:all>
  <xsd:attribute name="id" type="name" />
  <xsd:attribute name="name" type="symbol" />
 </xsd:complexType>

 <!--constraint-->

 <xsd:element name="CONSTRAINT" abstract="true" substitutionGroup="CONSTRAINER" />

 <xsd:element name="constraint" type="constraint" substitutionGroup="CONSTRAINT" />

 <xsd:complexType name="CONSTRAINT-as-element">
  <xsd:sequence>
   <xsd:element ref="CONSTRAINT" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="constraint">
  <xsd:all>
   <xsd:element name="parameters" type="LIST-as-element" minOccurs="0" />
   <xsd:element name="annotations" type="MAP-as-element" minOccurs="0" />
  </xsd:all>
  <xsd:attribute name="type" type="symbol" />
  <xsd:attribute name="relation" type="symbol" />
  <xsd:attribute name="sender-id" type="name" />
 </xsd:complexType>

 <!--ordering-->

 <xsd:element name="ORDERING" abstract="true" substitutionGroup="CONSTRAINER" />

 <xsd:element name="ordering" type="ordering" substitutionGroup="ORDERING" />

 <xsd:complexType name="ORDERING-as-element">
  <xsd:sequence>
   <xsd:element ref="ORDERING" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="ordering">
  <xsd:all>
   <xsd:element name="from" type="NODE-END-REF-as-element" minOccurs="0" />
   <xsd:element name="to" type="NODE-END-REF-as-element" minOccurs="0" />
   <xsd:element name="annotations" type="MAP-as-element" minOccurs="0" />
  </xsd:all>
 </xsd:complexType>

 <!--node-end-ref-->

 <xsd:element name="NODE-END-REF" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="node-end-ref" type="node-end-ref" substitutionGroup="NODE-END-REF" />

 <xsd:complexType name="NODE-END-REF-as-element">
  <xsd:sequence>
   <xsd:element ref="NODE-END-REF" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="node-end-ref">
  <xsd:all />
  <xsd:attribute name="end" type="end" />
  <xsd:attribute name="node" type="name" />
 </xsd:complexType>

 <!--end-->

 <xsd:element name="END" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="end" type="end" substitutionGroup="END" />

 <xsd:complexType name="END-as-element">
  <xsd:sequence>
   <xsd:element ref="END" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:simpleType name="end">
  <xsd:restriction base="xsd:string">
   <xsd:enumeration value="begin" />
   <xsd:enumeration value="end" />
  </xsd:restriction>
 </xsd:simpleType>

 <!--literal-document-->

 <xsd:element name="LITERAL-DOCUMENT" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="literal-document" type="literal-document" substitutionGroup="LITERAL-DOCUMENT" />

 <xsd:complexType name="LITERAL-DOCUMENT-as-element">
  <xsd:sequence>
   <xsd:element ref="LITERAL-DOCUMENT" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="literal-document">
  <xsd:sequence>
   <xsd:any processContents="lax" />
  </xsd:sequence>
 </xsd:complexType>

 <!--string-->

 <xsd:element name="STRING" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="string" type="string" substitutionGroup="STRING" />

 <xsd:complexType name="STRING-as-element">
  <xsd:sequence>
   <xsd:element ref="STRING" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:simpleType name="string">
  <xsd:restriction base="xsd:string" />
 </xsd:simpleType>

 <!--integer-->

 <xsd:element name="INTEGER" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="integer" type="integer" substitutionGroup="INTEGER" />

 <xsd:complexType name="INTEGER-as-element">
  <xsd:sequence>
   <xsd:element ref="INTEGER" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:simpleType name="integer">
  <xsd:restriction base="xsd:int" />
 </xsd:simpleType>

 <!--long-->

 <xsd:element name="LONG" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="long" type="long" substitutionGroup="LONG" />

 <xsd:complexType name="LONG-as-element">
  <xsd:sequence>
   <xsd:element ref="LONG" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:simpleType name="long">
  <xsd:restriction base="xsd:long" />
 </xsd:simpleType>

 <!--float-->

 <xsd:element name="FLOAT" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="float" type="float" substitutionGroup="FLOAT" />

 <xsd:complexType name="FLOAT-as-element">
  <xsd:sequence>
   <xsd:element ref="FLOAT" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:simpleType name="float">
  <xsd:restriction base="xsd:float" />
 </xsd:simpleType>

 <!--double-->

 <xsd:element name="DOUBLE" abstract="true" substitutionGroup="OBJECT" />

 <xsd:element name="double" type="double" substitutionGroup="DOUBLE" />

 <xsd:complexType name="DOUBLE-as-element">
  <xsd:sequence>
   <xsd:element ref="DOUBLE" />
  </xsd:sequence>
 </xsd:complexType>

 <xsd:simpleType name="double">
  <xsd:restriction base="xsd:double" />
 </xsd:simpleType>

</xsd:schema>


