<?xml version="1.0" encoding="UTF-8"?>
<!-- Meta-model for PNML specification -->
<!-- Provided by www.pnml.org -->
<ecore:EPackage xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="terms"
    nsURI="http:///symmetricnet.terms.ecore" nsPrefix="terms">
  <eClassifiers xsi:type="ecore:EClass" name="Declarations">
    <eStructuralFeatures xsi:type="ecore:EReference" name="declaration" ordered="false"
        upperBound="-1" eType="#//TermsDeclaration" containment="true" eOpposite="#//TermsDeclaration/containerDeclarations"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerDeclaration" eType="ecore:EClass hlcorestructure.ecore#//Declaration"
        eOpposite="hlcorestructure.ecore#//Declaration/structure"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="TermsDeclaration" abstract="true">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" ordered="false" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" iD="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerDeclarations"
        eType="#//Declarations" eOpposite="#//Declarations/declaration"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Sort" abstract="true">
    <eAnnotations source="http://www.pnml.org/models/methods/SORT">
      <details key="signature" value="boolean equalSorts(Sort sort)"/>
      <details key="body" value=""/>
      <details key="documentation" value="/**&#xA;  * Returns true if this sort and argument sort are actually semantically the&#xA;  * same sort, even in two different objects. &#xA;  * &lt;p>Ex: two FiniteEnumerations F1 = {1,4,6} and F2 = {1,4,6} or&#xA;  * two Integers I1 and I2.&lt;/p> &#xA;  * &lt;p>&lt;strong>Note&lt;/strong> : the implementation available for&#xA;  * MultisetSort is not complete. In particular, we just test equality&#xA;  * of the references or of the enclosing NamedSorts (if any). &#xA;  * You should consider overriding it in that case.&#xA;  * &#xA;  * @return true if so.&#xA;  * @param sort&#xA;  *            the sort to which we compare this one.&#xA;  */"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="multi" ordered="false"
        eType="#//MultisetSort" eOpposite="#//MultisetSort/basis"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerNamedSort" eType="#//NamedSort"
        eOpposite="#//NamedSort/sortdef"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerVariableDecl"
        eType="#//VariableDecl" eOpposite="#//VariableDecl/sort"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerProductSort" eType="#//ProductSort"
        eOpposite="#//ProductSort/elementSort"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerType" eType="ecore:EClass hlcorestructure.ecore#//Type"
        eOpposite="hlcorestructure.ecore#//Type/structure"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerAll" eType="ecore:EClass multisets.ecore#//All"
        eOpposite="multisets.ecore#//All/refsort"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerEmpty" eType="ecore:EClass multisets.ecore#//Empty"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerPartition" ordered="false"
        eType="ecore:EClass partitions.ecore#//Partition" eOpposite="partitions.ecore#//Partition/def"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="MultisetSort" eSuperTypes="#//Sort">
    <eAnnotations source="http://www.pnml.org/models/methods/SORT">
      <details key="signature" value="boolean equalSorts(Sort sort)"/>
      <details key="body" value="boolean isEqual = false;&#xA;&#x9;&#x9;if (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {&#xA;&#x9;&#x9;  &#x9;if (this.getContainerNamedSort() != null&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&amp;&amp; sort.getContainerNamedSort() != null) {&#xA;&#x9;&#x9;&#x9;&#x9;// we test them if they have been explicitly named.&#xA;&#x9;&#x9;&#x9;&#x9;isEqual = this.getContainerNamedSort().getName()&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;.equalsIgnoreCase(&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;sort.getContainerNamedSort().getName());&#xA;&#x9;&#x9;&#x9;} else {&#xA;&#x9;&#x9;&#x9; throw new UnsupportedOperationException(&quot;Cannot determine if these two multisets are equal.&quot;&#xA;&#x9;&#x9;&#x9; + &quot;You should override this method.&quot;);&#xA;&#x9;&#x9;&#x9;}&#xA;&#x9;&#x9;}&#xA;&#x9;&#x9;return isEqual;"/>
      <details key="documentation" value="/**&#xD; * Returns true if this sort and argument sort are actually &#xD; * semantically the same sort, even in two different objects.&#xD; * Ex: two FiniteEnumerations or two Integers.&#xD; * Note : there is no implementation available for MultisetSort yet.&#xD; * @return true if so. &#xD; * @param sort the sort to which we compare this one. &#xD; */"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="basis" ordered="false"
        lowerBound="1" eType="#//Sort" containment="true" eOpposite="#//Sort/multi"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Term" abstract="true">
    <eStructuralFeatures xsi:type="ecore:EReference" name="sort" ordered="false" eType="#//Sort"
        derived="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerOperator" eType="#//Operator"
        eOpposite="#//Operator/subterm"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerNamedOperator"
        eType="#//NamedOperator" eOpposite="#//NamedOperator/def"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerHLMarking" eType="ecore:EClass hlcorestructure.ecore#//HLMarking"
        eOpposite="hlcorestructure.ecore#//HLMarking/structure"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerCondition" eType="ecore:EClass hlcorestructure.ecore#//Condition"
        eOpposite="hlcorestructure.ecore#//Condition/structure"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerHLAnnotation"
        eType="ecore:EClass hlcorestructure.ecore#//HLAnnotation" eOpposite="hlcorestructure.ecore#//HLAnnotation/structure"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerPartitionElement"
        eType="ecore:EClass partitions.ecore#//PartitionElement" eOpposite="partitions.ecore#//PartitionElement/partitionelementconstants"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Operator" abstract="true" eSuperTypes="#//Term">
    <eAnnotations source="http://www.pnml.org/models/OCL">
      <details key="sameOperatorNTermSort" value="self.sort = self.output"/>
    </eAnnotations>
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
      <details key="constraints" value="sameOperatorNTermSort"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="subterm" upperBound="-1"
        eType="#//Term" containment="true" eOpposite="#//Term/containerOperator"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="output" ordered="false"
        eType="#//Sort" derived="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="input" upperBound="-1"
        eType="#//Sort" derived="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="VariableDecl" eSuperTypes="#//TermsDeclaration">
    <eStructuralFeatures xsi:type="ecore:EReference" name="sort" ordered="false" lowerBound="1"
        eType="#//Sort" containment="true" eOpposite="#//Sort/containerVariableDecl"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="containerNamedOperator"
        eType="#//NamedOperator" eOpposite="#//NamedOperator/parameters"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Variable" eSuperTypes="#//Term">
    <eStructuralFeatures xsi:type="ecore:EReference" name="variableDecl" ordered="false"
        lowerBound="1" eType="#//VariableDecl"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="BuiltInSort" abstract="true" eSuperTypes="#//Sort"/>
  <eClassifiers xsi:type="ecore:EClass" name="ProductSort" eSuperTypes="#//Sort">
    <eAnnotations source="http://www.pnml.org/models/methods/SORT">
      <details key="signature" value="boolean equalSorts(Sort sort)"/>
      <details key="body" value="boolean isEqual = false;&#xA;&#x9;&#x9;if (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {&#xA;&#x9;&#x9;&#x9;if (this.getContainerNamedSort() != null&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&amp;&amp; sort.getContainerNamedSort() != null) {&#xA;&#x9;&#x9;&#x9;&#x9;isEqual = this.getContainerNamedSort().getName()&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;.equalsIgnoreCase(&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;sort.getContainerNamedSort().getName());&#xA;&#x9;&#x9;&#x9;} else {&#xA;&#x9;&#x9;&#x9;&#x9;// Someone may one day inherit from ProductSort, so we should&#xA;&#x9;&#x9;&#x9;&#x9;// strictly check for ProductSort only. Further sub-classes must &#xA;&#x9;&#x9;&#x9;&#x9;//override this method.&#xA;&#x9;&#x9;&#x9;&#x9;if (&quot;ProductSort&quot;.equalsIgnoreCase(this.eClass().getName())) {&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;ProductSort mySort = (ProductSort) this;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;ProductSort thatSort = (ProductSort) sort;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;List&lt;Sort> myElements = mySort.getElementSort();&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;List&lt;Sort> thoseElements = thatSort.getElementSort();&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;int i = 0;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;int j = 0;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;for (; i &lt; myElements.size() &amp;&amp; j &lt; thoseElements.size(); i++, j++) {&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;if (myElements&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;.get(i)&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;.eClass()&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;.getName()&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;.equalsIgnoreCase(&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;thoseElements.get(j).eClass().getName())) {&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;isEqual = true;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;} else {&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;isEqual = false;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;break;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;}&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;}&#xA;&#x9;&#x9;&#x9;&#x9;}&#x9;&#x9;&#xA;&#x9;&#x9;&#x9;}&#xA;&#x9;&#x9;}&#xA;&#x9;&#x9;return isEqual;"/>
      <details key="documentation" value="/**&#xD; * Returns true if this sort and argument sort are actually &#xD; * semantically the same sort, even in two different objects.&#xD; * Ex: two FiniteEnumerations or two Integers.&#xD; * @return true if so. &#xD; * @param sort the sort to which we compare this one. &#xD; */"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="elementSort" upperBound="-1"
        eType="#//Sort" containment="true" eOpposite="#//Sort/containerProductSort"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="BuiltInConstant" abstract="true" eSuperTypes="#//Operator"/>
  <eClassifiers xsi:type="ecore:EClass" name="MultisetOperator" abstract="true" eSuperTypes="#//Operator"/>
  <eClassifiers xsi:type="ecore:EClass" name="Tuple" eSuperTypes="#//Operator"/>
  <eClassifiers xsi:type="ecore:EClass" name="SortDecl" abstract="true" eSuperTypes="#//TermsDeclaration"/>
  <eClassifiers xsi:type="ecore:EClass" name="BuiltInOperator" abstract="true" eSuperTypes="#//Operator"/>
  <eClassifiers xsi:type="ecore:EClass" name="NamedSort" eSuperTypes="#//SortDecl">
    <eAnnotations source="http://www.pnml.org/models/OCL">
      <details key="refSortNotMultiset" value="not(self.sortdef.oclIsTypeOf(MultisetSort))"/>
    </eAnnotations>
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
      <details key="constraints" value="refSortNotMultiset"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="sortdef" ordered="false"
        lowerBound="1" eType="#//Sort" containment="true" eOpposite="#//Sort/containerNamedSort"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="UserSort" eSuperTypes="#//Sort">
    <eAnnotations source="http://www.pnml.org/models/methods/SORT">
      <details key="signature" value="boolean equalSorts(Sort sort)"/>
      <details key="body" value="boolean isEqual = false;&#xA;&#x9;&#x9;if (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {&#xA;&#x9;&#x9;&#x9;if (this.getContainerNamedSort() != null&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&amp;&amp; sort.getContainerNamedSort() != null) {&#xA;&#x9;&#x9;&#x9;&#x9;isEqual = this.getContainerNamedSort().getName()&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;.equalsIgnoreCase(&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;sort.getContainerNamedSort().getName());&#xA;&#x9;&#x9;&#x9;} else {&#xA;&#x9;&#x9;&#x9;&#x9;//further sub-classes must override this method.&#xA;&#x9;&#x9;&#x9;&#x9;if (&quot;UserSort&quot;.equalsIgnoreCase(this.eClass().getName())) {&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;isEqual = ((UserSort) this).getDeclaration().getName()&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;.equalsIgnoreCase(&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;((UserSort) sort).getDeclaration()&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;.getName());&#xA;&#x9;&#x9;&#x9;&#x9;}&#xA;&#x9;&#x9;&#x9;}&#xA;&#x9;&#x9;}&#xA;&#x9;&#x9;return isEqual;"/>
      <details key="documentation" value="/**&#xD; * Returns true if this sort and argument sort are actually &#xD; * semantically the same sort, even in two different objects.&#xD; * Ex: two FiniteEnumerations or two Integers.&#xD; * @return true if so. &#xD; * @param sort the sort to which we compare this one. &#xD; */"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="declaration" ordered="false"
        lowerBound="1" eType="#//SortDecl"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="OperatorDecl" abstract="true" eSuperTypes="#//TermsDeclaration"/>
  <eClassifiers xsi:type="ecore:EClass" name="NamedOperator" eSuperTypes="#//OperatorDecl">
    <eStructuralFeatures xsi:type="ecore:EReference" name="def" ordered="false" lowerBound="1"
        eType="#//Term" containment="true" eOpposite="#//Term/containerNamedOperator"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="parameters" upperBound="-1"
        eType="#//VariableDecl" containment="true" eOpposite="#//VariableDecl/containerNamedOperator"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="UserOperator" eSuperTypes="#//Operator">
    <eStructuralFeatures xsi:type="ecore:EReference" name="declaration" ordered="false"
        lowerBound="1" eType="#//OperatorDecl"/>
  </eClassifiers>
</ecore:EPackage>

