<?xml version="1.0" encoding="UTF-8"?>
<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="typesystem"
    nsURI="http://www.eclipselabs.org/mscript/TypeSystem/1.0.0" nsPrefix="typesystem">
  <eClassifiers xsi:type="ecore:EClass" name="DataType" abstract="true">
    <eOperations name="evaluate" lowerBound="1" eType="#//DataType">
      <eParameters name="operator" lowerBound="1" eType="#//OperatorKind"/>
      <eParameters name="other" eType="#//DataType"/>
    </eOperations>
    <eOperations name="evaluate" lowerBound="1" eType="#//DataType">
      <eParameters name="operator" lowerBound="1" eType="#//OperatorKind"/>
      <eParameters name="n" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
    </eOperations>
    <eOperations name="isAssignableFrom" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
      <eParameters name="other" lowerBound="1" eType="#//DataType"/>
    </eOperations>
    <eOperations name="isEquivalentTo" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
      <eParameters name="other" lowerBound="1" eType="#//DataType"/>
    </eOperations>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="InvalidDataType" eSuperTypes="#//DataType"/>
  <eClassifiers xsi:type="ecore:EClass" name="AnyDataType" eSuperTypes="#//DataType"/>
  <eClassifiers xsi:type="ecore:EClass" name="UnitType" eSuperTypes="#//DataType"/>
  <eClassifiers xsi:type="ecore:EEnum" name="OperatorKind">
    <eLiterals name="Add"/>
    <eLiterals name="Subtract" value="1"/>
    <eLiterals name="Multiply" value="2"/>
    <eLiterals name="Divide" value="3"/>
    <eLiterals name="ElementWiseMultiply" value="4"/>
    <eLiterals name="ElementWiseDivide" value="5"/>
    <eLiterals name="ElementWisePower" value="6"/>
    <eLiterals name="Negate" value="7"/>
    <eLiterals name="Power" value="8"/>
    <eLiterals name="Root" value="9"/>
    <eLiterals name="Transpose" value="10"/>
    <eLiterals name="LogicalAnd" value="11"/>
    <eLiterals name="LogicalOr" value="12"/>
    <eLiterals name="LogicalNot" value="13"/>
    <eLiterals name="Implies" value="14"/>
    <eLiterals name="LessThan" value="15"/>
    <eLiterals name="LessThanOrEqualTo" value="16"/>
    <eLiterals name="GreaterThan" value="17"/>
    <eLiterals name="GreaterThanOrEqualTo" value="18"/>
    <eLiterals name="EqualTo" value="19"/>
    <eLiterals name="NotEqualTo" value="20"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="PrimitiveType" eSuperTypes="#//DataType"/>
  <eClassifiers xsi:type="ecore:EClass" name="NumericType" eSuperTypes="#//PrimitiveType">
    <eStructuralFeatures xsi:type="ecore:EReference" name="unit" lowerBound="1" eType="#//Unit"
        containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="RealType" eSuperTypes="#//NumericType"/>
  <eClassifiers xsi:type="ecore:EClass" name="IntegerType" eSuperTypes="#//NumericType"/>
  <eClassifiers xsi:type="ecore:EClass" name="ComplexType" eSuperTypes="#//NumericType"/>
  <eClassifiers xsi:type="ecore:EClass" name="GaussianType" eSuperTypes="#//NumericType"/>
  <eClassifiers xsi:type="ecore:EClass" name="BooleanType" eSuperTypes="#//PrimitiveType"/>
  <eClassifiers xsi:type="ecore:EClass" name="StringType" eSuperTypes="#//PrimitiveType"/>
  <eClassifiers xsi:type="ecore:EClass" name="ArrayType" eSuperTypes="#//DataType">
    <eStructuralFeatures xsi:type="ecore:EReference" name="elementType" eType="#//DataType"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="definedElementType" eType="#//DataType"
        containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="dimensions" upperBound="-1"
        eType="#//ArrayDimension" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="dimensionality" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" changeable="false"
        volatile="true" transient="true" derived="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="dimensional" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" changeable="false"
        volatile="true" transient="true" derived="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="multidimensional" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" changeable="false"
        volatile="true" transient="true" derived="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="TensorType" eSuperTypes="#//ArrayType">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="vector" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" changeable="false"
        volatile="true" transient="true" derived="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="matrix" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" changeable="false"
        volatile="true" transient="true" derived="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="ArrayDimension">
    <eStructuralFeatures xsi:type="ecore:EReference" name="size" eType="#//Expression"
        containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Expression"/>
  <eClassifiers xsi:type="ecore:EClass" name="Unit">
    <eOperations name="getNormalized" lowerBound="1" eType="#//Unit"/>
    <eOperations name="evaluate" eType="#//Unit">
      <eParameters name="operator" lowerBound="1" eType="#//OperatorKind"/>
      <eParameters name="other" eType="#//Unit"/>
    </eOperations>
    <eOperations name="evaluate" eType="#//Unit">
      <eParameters name="operator" lowerBound="1" eType="#//OperatorKind"/>
      <eParameters name="n" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
    </eOperations>
    <eOperations name="isEquivalentTo" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
      <eParameters name="other" lowerBound="1" eType="#//Unit"/>
      <eParameters name="ignoreScale" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="numerator" eType="#//UnitNumerator"
        containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="denominator" eType="#//UnitDenominator"
        containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="scale" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="wildcard" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" changeable="false"
        volatile="true" transient="true" derived="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="UnitProduct" abstract="true">
    <eOperations name="getFactor" eType="#//UnitFactor">
      <eParameters name="symbol" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="factors" upperBound="-1"
        eType="#//UnitFactor" containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="UnitNumerator" eSuperTypes="#//UnitProduct"/>
  <eClassifiers xsi:type="ecore:EClass" name="UnitDenominator" eSuperTypes="#//UnitProduct"/>
  <eClassifiers xsi:type="ecore:EClass" name="UnitFactor">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="symbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="exponent" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
        defaultValueLiteral="1"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Literal" eSuperTypes="#//Expression"/>
  <eClassifiers xsi:type="ecore:EClass" name="NumericLiteral" eSuperTypes="#//Literal">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="modifier" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="unit" lowerBound="1" eType="#//Unit"
        containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="RealLiteral" eSuperTypes="#//NumericLiteral">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="IntegerLiteral" eSuperTypes="#//NumericLiteral">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="BooleanLiteral" eSuperTypes="#//Literal">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="true" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="StringLiteral" eSuperTypes="#//Literal">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
  </eClassifiers>
</ecore:EPackage>
