<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.aiai.ed.ac.uk/project/ix/" xmlns:ix="http://www.aiai.ed.ac.uk/project/ix/">
  <xs:group name="object">
    <xs:choice>
      <xs:element ref="ix:list"/>
      <xs:element ref="ix:map"/>
      <xs:element ref="ix:issue"/>
      <xs:element ref="ix:status"/>
      <xs:element ref="ix:priority"/>
      <xs:element ref="ix:name"/>
      <xs:element ref="ix:yes-no"/>
      <xs:element ref="ix:activity"/>
      <xs:group ref="ix:constraint"/>
      <xs:element ref="ix:ordering"/>
      <xs:element ref="ix:node-end-ref"/>
      <xs:element ref="ix:end"/>
      <xs:element ref="ix:pattern-assignment"/>
      <xs:element ref="ix:item-var"/>
      <xs:element ref="ix:report"/>
      <xs:element ref="ix:report-type"/>
      <xs:element ref="ix:chat-message"/>
      <xs:element ref="ix:literal-document"/>
      <xs:element ref="ix:symbol"/>
      <xs:element ref="ix:string"/>
      <xs:element ref="ix:integer"/>
      <xs:element ref="ix:long"/>
      <xs:element ref="ix:float"/>
      <xs:element ref="ix:double"/>
      <xs:element ref="ix:domain"/>
      <xs:element ref="ix:variable-declaration"/>
      <xs:element ref="ix:refinement"/>
      <xs:element ref="ix:node-spec"/>
      <xs:element ref="ix:plan"/>
      <xs:element ref="ix:plan-variable-declaration"/>
      <xs:element ref="ix:variable-scope"/>
      <xs:element ref="ix:plan-issue"/>
      <xs:element ref="ix:plan-issue-refinement"/>
      <xs:element ref="ix:plan-node"/>
      <xs:element ref="ix:plan-refinement"/>
      <xs:group ref="ix:constrainer"/>
      <xs:element ref="ix:plan-variable"/>
    </xs:choice>
  </xs:group>
  <xs:element name="list">
    <xs:complexType>
      <xs:group minOccurs="0" maxOccurs="unbounded" ref="ix:object"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="map">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ix:map-entry"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="map-entry">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ix:key"/>
        <xs:element ref="ix:value"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="key">
    <xs:complexType>
      <xs:group ref="ix:object"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="value">
    <xs:complexType>
      <xs:group ref="ix:object"/>
    </xs:complexType>
  </xs:element>
  <!-- issue -->
  <xs:element name="issue">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" ref="ix:pattern"/>
        <xs:element minOccurs="0" ref="ix:annotations"/>
      </xs:all>
      <xs:attribute name="status" type="ix:status-value"/>
      <xs:attribute name="priority" type="ix:priority-value"/>
      <xs:attribute name="id" type="ix:name-value"/>
      <xs:attribute name="sender-id" type="ix:name-value"/>
      <xs:attribute name="ref" type="ix:name-value"/>
      <xs:attribute name="report-back" type="ix:yes-no-value"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="pattern">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ix:list"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!-- status -->
  <xs:element name="status" type="ix:status-value"/>
  <xs:simpleType name="status-value">
    <xs:restriction base="xs:token">
      <xs:enumeration value="blank"/>
      <xs:enumeration value="complete"/>
      <xs:enumeration value="executing"/>
      <xs:enumeration value="possible"/>
      <xs:enumeration value="impossible"/>
      <xs:enumeration value="n/a"/>
    </xs:restriction>
  </xs:simpleType>
  <!-- priority -->
  <xs:element name="priority" type="ix:priority-value"/>
  <xs:simpleType name="priority-value">
    <xs:restriction base="xs:token">
      <xs:enumeration value="lowest"/>
      <xs:enumeration value="low"/>
      <xs:enumeration value="normal"/>
      <xs:enumeration value="high"/>
      <xs:enumeration value="highest"/>
    </xs:restriction>
  </xs:simpleType>
  <!-- name -->
  <xs:element name="name" type="ix:name-value"/>
  <xs:simpleType name="name-value">
    <xs:restriction base="xs:string"/>
  </xs:simpleType>
  <!-- yes-no -->
  <xs:element name="yes-no" type="ix:yes-no-value"/>
  <xs:simpleType name="yes-no-value">
    <xs:restriction base="xs:token">
      <xs:enumeration value="yes"/>
      <xs:enumeration value="no"/>
    </xs:restriction>
  </xs:simpleType>
  <!-- activity -->
  <xs:element name="activity">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" ref="ix:pattern"/>
        <xs:element minOccurs="0" ref="ix:annotations"/>
      </xs:all>
      <xs:attribute name="status" type="ix:status-value"/>
      <xs:attribute name="priority" type="ix:priority-value"/>
      <xs:attribute name="id" type="ix:name-value"/>
      <xs:attribute name="sender-id" type="ix:name-value"/>
      <xs:attribute name="ref" type="ix:name-value"/>
      <xs:attribute name="report-back" type="ix:yes-no-value"/>
    </xs:complexType>
  </xs:element>
  <!-- constraint -->
  <!-- ordering -->
  <xs:element name="ordering">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" ref="ix:from"/>
        <xs:element minOccurs="0" ref="ix:to"/>
        <xs:element minOccurs="0" ref="ix:annotations"/>
      </xs:all>
    </xs:complexType>
  </xs:element>
  <xs:element name="from">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ix:node-end-ref"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="to">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ix:node-end-ref"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!-- node-end-ref -->
  <xs:element name="node-end-ref">
    <xs:complexType>
      <xs:attribute name="end" type="ix:end-value"/>
      <xs:attribute name="node" type="ix:name-value"/>
    </xs:complexType>
  </xs:element>
  <!-- end -->
  <xs:element name="end" type="ix:end-value"/>
  <xs:simpleType name="end-value">
    <xs:restriction base="xs:token">
      <xs:enumeration value="begin"/>
      <xs:enumeration value="end"/>
    </xs:restriction>
  </xs:simpleType>
  <!-- pattern-assignment -->
  <xs:element name="pattern-assignment">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" ref="ix:pattern"/>
        <xs:element minOccurs="0" ref="ix:value"/>
      </xs:all>
    </xs:complexType>
  </xs:element>
  <!-- item-var -->
  <xs:element name="item-var" type="ix:item-var-value"/>
  <xs:simpleType name="item-var-value">
    <xs:restriction base="xs:string"/>
  </xs:simpleType>
  <!-- report -->
  <xs:element name="report">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" ref="ix:text"/>
        <xs:element minOccurs="0" ref="ix:annotations"/>
      </xs:all>
      <xs:attribute name="report-type" type="ix:report-type-value"/>
      <xs:attribute name="priority" type="ix:priority-value"/>
      <xs:attribute name="sender-id" type="ix:name-value"/>
      <xs:attribute name="ref" type="ix:name-value"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="text">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ix:string"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!-- report-type -->
  <xs:element name="report-type" type="ix:report-type-value"/>
  <xs:simpleType name="report-type-value">
    <xs:restriction base="xs:token">
      <xs:enumeration value="success"/>
      <xs:enumeration value="failure"/>
      <xs:enumeration value="progress"/>
      <xs:enumeration value="information"/>
      <xs:enumeration value="event"/>
    </xs:restriction>
  </xs:simpleType>
  <!-- chat-message -->
  <xs:element name="chat-message">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="ix:text"/>
      </xs:sequence>
      <xs:attribute name="sender-id" type="ix:name-value"/>
    </xs:complexType>
  </xs:element>
  <!-- literal-document -->
  <xs:element name="literal-document" type="ix:anyXML"/>
  <xs:complexType name="anyXML">
    <xs:sequence>
      <xs:any processContents="skip"/>
    </xs:sequence>
  </xs:complexType>
  <!-- symbol -->
  <xs:element name="symbol" type="ix:symbol-value"/>
  <xs:simpleType name="symbol-value">
    <xs:restriction base="xs:string"/>
  </xs:simpleType>
  <!-- string -->
  <xs:element name="string" type="xs:string"/>
  <!-- integer -->
  <xs:element name="integer" type="ix:integer-value"/>
  <xs:simpleType name="integer-value">
    <xs:restriction base="xs:int"/>
  </xs:simpleType>
  <!-- long -->
  <xs:element name="long" type="ix:long-value"/>
  <xs:simpleType name="long-value">
    <xs:restriction base="xs:long"/>
  </xs:simpleType>
  <!-- float -->
  <xs:element name="float" type="ix:float-value"/>
  <xs:simpleType name="float-value">
    <xs:restriction base="xs:float"/>
  </xs:simpleType>
  <!-- double -->
  <xs:element name="double" type="ix:double-value"/>
  <xs:simpleType name="double-value">
    <xs:restriction base="xs:double"/>
  </xs:simpleType>
  <!-- domain -->
  <xs:element name="domain">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" name="name">
          <xs:complexType>
            <xs:sequence>
              <xs:element ref="ix:string"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" ref="ix:variable-declarations"/>
        <xs:element minOccurs="0" ref="ix:refinements"/>
        <xs:element minOccurs="0" ref="ix:annotations"/>
      </xs:all>
    </xs:complexType>
  </xs:element>
  <xs:element name="variable-declarations">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="list">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" ref="ix:variable-declaration"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="refinements">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="list">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" ref="ix:refinement"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!-- variable-declaration -->
  <xs:element name="variable-declaration">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="ix:annotations"/>
      </xs:sequence>
      <xs:attribute name="name" type="ix:item-var-value"/>
    </xs:complexType>
  </xs:element>
  <!-- refinement -->
  <xs:element name="refinement">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" name="name">
          <xs:complexType>
            <xs:sequence>
              <xs:element ref="ix:string"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" ref="ix:pattern"/>
        <xs:element minOccurs="0" ref="ix:variable-declarations"/>
        <xs:element minOccurs="0" ref="ix:nodes"/>
        <xs:element minOccurs="0" ref="ix:orderings"/>
        <xs:element minOccurs="0" name="constraints">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="list">
                <xs:complexType>
                  <xs:group minOccurs="0" maxOccurs="unbounded" ref="ix:constraint"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" ref="ix:issues"/>
        <xs:element minOccurs="0" ref="ix:comments"/>
        <xs:element minOccurs="0" ref="ix:annotations"/>
      </xs:all>
    </xs:complexType>
  </xs:element>
  <xs:element name="nodes">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="list">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" ref="ix:node-spec"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="orderings">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="list">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" ref="ix:ordering"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="issues">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="list">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" ref="ix:issue"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="comments">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ix:string"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!-- node-spec -->
  <xs:element name="node-spec">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="ix:pattern"/>
      </xs:sequence>
      <xs:attribute name="id" type="ix:name-value"/>
    </xs:complexType>
  </xs:element>
  <!-- plan -->
  <xs:element name="plan">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" ref="ix:plan-variable-declarations"/>
        <xs:element minOccurs="0" ref="ix:plan-issues"/>
        <xs:element minOccurs="0" ref="ix:plan-issue-refinements"/>
        <xs:element minOccurs="0" ref="ix:plan-nodes"/>
        <xs:element minOccurs="0" ref="ix:plan-refinements"/>
        <xs:element minOccurs="0" name="constraints">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="list">
                <xs:complexType>
                  <xs:group minOccurs="0" maxOccurs="unbounded" ref="ix:constrainer"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" ref="ix:world-state"/>
        <xs:element minOccurs="0" ref="ix:annotations"/>
      </xs:all>
    </xs:complexType>
  </xs:element>
  <xs:element name="plan-variable-declarations">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="list">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" ref="ix:plan-variable-declaration"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="plan-issues">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="list">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" ref="ix:plan-issue"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="plan-issue-refinements">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="list">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" ref="ix:plan-issue-refinement"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="plan-nodes">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="list">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" ref="ix:plan-node"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="plan-refinements">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="list">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" ref="ix:plan-refinement"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="world-state">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="list">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" ref="ix:pattern-assignment"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!-- plan-variable-declaration -->
  <xs:element name="plan-variable-declaration">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="ix:annotations"/>
      </xs:sequence>
      <xs:attribute name="id" type="ix:name-value"/>
      <xs:attribute name="name" type="ix:symbol-value"/>
      <xs:attribute name="scope" type="ix:variable-scope-value"/>
    </xs:complexType>
  </xs:element>
  <!-- variable-scope -->
  <xs:element name="variable-scope" type="ix:variable-scope-value"/>
  <xs:simpleType name="variable-scope-value">
    <xs:restriction base="xs:token">
      <xs:enumeration value="local"/>
      <xs:enumeration value="global"/>
    </xs:restriction>
  </xs:simpleType>
  <!-- plan-issue -->
  <xs:element name="plan-issue">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" name="issue">
          <xs:complexType>
            <xs:sequence>
              <xs:element ref="ix:issue"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" ref="ix:annotations"/>
      </xs:all>
      <xs:attribute name="id" type="ix:name-value"/>
      <xs:attribute name="expansion" type="ix:name-value"/>
    </xs:complexType>
  </xs:element>
  <!-- plan-issue-refinement -->
  <xs:element name="plan-issue-refinement">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" ref="ix:plan-variable-declarations"/>
        <xs:element minOccurs="0" ref="ix:plan-issues"/>
        <xs:element minOccurs="0" ref="ix:annotations"/>
      </xs:all>
      <xs:attribute name="id" type="ix:name-value"/>
      <xs:attribute name="expands" type="ix:name-value"/>
    </xs:complexType>
  </xs:element>
  <!-- plan-node -->
  <xs:element name="plan-node">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" name="activity">
          <xs:complexType>
            <xs:sequence>
              <xs:element ref="ix:activity"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" ref="ix:annotations"/>
      </xs:all>
      <xs:attribute name="id" type="ix:name-value"/>
      <xs:attribute name="expansion" type="ix:name-value"/>
    </xs:complexType>
  </xs:element>
  <!-- plan-refinement -->
  <xs:element name="plan-refinement">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" ref="ix:plan-variable-declarations"/>
        <xs:element minOccurs="0" ref="ix:plan-nodes"/>
        <xs:element minOccurs="0" name="constraints">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="list">
                <xs:complexType>
                  <xs:group minOccurs="0" maxOccurs="unbounded" ref="ix:constrainer"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" ref="ix:annotations"/>
      </xs:all>
      <xs:attribute name="id" type="ix:name-value"/>
      <xs:attribute name="expands" type="ix:name-value"/>
    </xs:complexType>
  </xs:element>
  <!-- constrainer -->
  <xs:group name="constrainer">
    <xs:choice>
      <xs:group ref="ix:constraint"/>
      <xs:element ref="ix:ordering"/>
    </xs:choice>
  </xs:group>
  <!-- plan-variable -->
  <xs:element name="plan-variable">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="ix:annotations"/>
      </xs:sequence>
      <xs:attribute name="id" type="ix:name-value"/>
      <xs:attribute name="name" type="ix:symbol-value"/>
    </xs:complexType>
  </xs:element>
</xs:schema>
