From 60f01f46ba232ed6416054f0a6115cb2a9b70b4e Mon Sep 17 00:00:00 2001 From: OszkarSemerath Date: Sat, 10 Jun 2017 19:05:05 +0200 Subject: Migrating Additional projects --- .../.classpath | 9 + .../.gitignore | 4 + .../.project | 34 ++ .../.settings/org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 23 + .../build.properties | 10 + .../Ecore2logicannotationsFactory.java | 69 +++ .../Ecore2logicannotationsPackage.java | 473 ++++++++++++++++++ .../InverseRelationAssertion.java | 79 +++ .../LowerMultiplicityAssertion.java | 49 ++ .../MultiplicityAssertion.java | 51 ++ .../UpperMultiplicityAssertion.java | 49 ++ .../impl/Ecore2logicannotationsFactoryImpl.java | 128 +++++ .../impl/Ecore2logicannotationsPackageImpl.java | 301 ++++++++++++ .../impl/InverseRelationAssertionImpl.java | 216 +++++++++ .../impl/LowerMultiplicityAssertionImpl.java | 162 +++++++ .../impl/MultiplicityAssertionImpl.java | 156 ++++++ .../impl/UpperMultiplicityAssertionImpl.java | 162 +++++++ .../util/Ecore2logicannotationsAdapterFactory.java | 213 +++++++++ .../util/Ecore2logicannotationsSwitch.java | 216 +++++++++ .../model/ecore2logicannotations.aird | 527 +++++++++++++++++++++ .../model/ecore2logicannotations.ecore | 21 + .../model/ecore2logicannotations.genmodel | 22 + .../plugin.properties | 4 + .../plugin.xml | 17 + .../dslreasoner/ecore2logic/AttributeMapper.xtend | 119 +++++ .../ecore2logic/ContainmentMapper.xtend | 133 ++++++ .../inf/dslreasoner/ecore2logic/EClassMapper.xtend | 53 +++ .../inf/dslreasoner/ecore2logic/EEnumMapper.xtend | 60 +++ .../dslreasoner/ecore2logic/EReferenceMapper.xtend | 154 ++++++ .../inf/dslreasoner/ecore2logic/Ecore2Logic.xtend | 98 ++++ 32 files changed, 3621 insertions(+) create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.classpath create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.gitignore create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.project create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.settings/org.eclipse.core.resources.prefs create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.settings/org.eclipse.jdt.core.prefs create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/META-INF/MANIFEST.MF create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/build.properties create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/Ecore2logicannotationsFactory.java create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/Ecore2logicannotationsPackage.java create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/InverseRelationAssertion.java create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/LowerMultiplicityAssertion.java create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/MultiplicityAssertion.java create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/UpperMultiplicityAssertion.java create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/Ecore2logicannotationsFactoryImpl.java create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/Ecore2logicannotationsPackageImpl.java create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/InverseRelationAssertionImpl.java create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/LowerMultiplicityAssertionImpl.java create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/MultiplicityAssertionImpl.java create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/UpperMultiplicityAssertionImpl.java create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/util/Ecore2logicannotationsAdapterFactory.java create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/util/Ecore2logicannotationsSwitch.java create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/model/ecore2logicannotations.aird create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/model/ecore2logicannotations.ecore create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/model/ecore2logicannotations.genmodel create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/plugin.properties create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/plugin.xml create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/AttributeMapper.xtend create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/ContainmentMapper.xtend create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EClassMapper.xtend create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EEnumMapper.xtend create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EReferenceMapper.xtend create mode 100644 Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/Ecore2Logic.xtend (limited to 'Framework/hu.bme.mit.inf.dslreasoner.ecore2logic') diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.classpath b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.classpath new file mode 100644 index 00000000..a7a95045 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.gitignore b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.gitignore new file mode 100644 index 00000000..8ae4e44d --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.gitignore @@ -0,0 +1,4 @@ +/bin/ +/src-gen/ +/vql-gen/ +/xtend-gen/ diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.project b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.project new file mode 100644 index 00000000..94e33330 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.project @@ -0,0 +1,34 @@ + + + hu.bme.mit.inf.dslreasoner.ecore2logic + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.settings/org.eclipse.core.resources.prefs b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..4824b802 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.settings/org.eclipse.jdt.core.prefs b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..295926d9 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/META-INF/MANIFEST.MF b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/META-INF/MANIFEST.MF new file mode 100644 index 00000000..f38f6fee --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/META-INF/MANIFEST.MF @@ -0,0 +1,23 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: hu.bme.mit.inf.dslreasoner.ecore2logic;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Require-Bundle: com.google.guava, + org.eclipse.xtext.xbase.lib, + org.eclipse.xtend.lib, + org.eclipse.xtend.lib.macro, + org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport, + hu.bme.mit.inf.dslreasoner.logic.model;bundle-version="1.0.0";visibility:=reexport, + org.eclipse.emf;bundle-version="2.6.0" +Bundle-ActivationPolicy: lazy +Export-Package: hu.bme.mit.inf.dslreasoner.ecore2logic, + hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations, + hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl, + hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.util + diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/build.properties b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/build.properties new file mode 100644 index 00000000..72399047 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/build.properties @@ -0,0 +1,10 @@ +# + +bin.includes = .,\ + model/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties +jars.compile.order = . +source.. = ecore-gen/ +output.. = bin/ diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/Ecore2logicannotationsFactory.java b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/Ecore2logicannotationsFactory.java new file mode 100644 index 00000000..d2781936 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/Ecore2logicannotationsFactory.java @@ -0,0 +1,69 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage + * @generated + */ +public interface Ecore2logicannotationsFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + Ecore2logicannotationsFactory eINSTANCE = hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.Ecore2logicannotationsFactoryImpl.init(); + + /** + * Returns a new object of class 'Multiplicity Assertion'. + * + * + * @return a new object of class 'Multiplicity Assertion'. + * @generated + */ + MultiplicityAssertion createMultiplicityAssertion(); + + /** + * Returns a new object of class 'Inverse Relation Assertion'. + * + * + * @return a new object of class 'Inverse Relation Assertion'. + * @generated + */ + InverseRelationAssertion createInverseRelationAssertion(); + + /** + * Returns a new object of class 'Lower Multiplicity Assertion'. + * + * + * @return a new object of class 'Lower Multiplicity Assertion'. + * @generated + */ + LowerMultiplicityAssertion createLowerMultiplicityAssertion(); + + /** + * Returns a new object of class 'Upper Multiplicity Assertion'. + * + * + * @return a new object of class 'Upper Multiplicity Assertion'. + * @generated + */ + UpperMultiplicityAssertion createUpperMultiplicityAssertion(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + Ecore2logicannotationsPackage getEcore2logicannotationsPackage(); + +} //Ecore2logicannotationsFactory diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/Ecore2logicannotationsPackage.java b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/Ecore2logicannotationsPackage.java new file mode 100644 index 00000000..b53edc84 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/Ecore2logicannotationsPackage.java @@ -0,0 +1,473 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations; + +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicproblemPackage; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + * + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsFactory + * @model kind="package" + * @generated + */ +public interface Ecore2logicannotationsPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "ecore2logicannotations"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.bme.hu/mit/inf/dslreasoner/logic/model/language/ecore2logicannotation"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "ecore2logicannotations"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + Ecore2logicannotationsPackage eINSTANCE = hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.Ecore2logicannotationsPackageImpl.init(); + + /** + * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.MultiplicityAssertionImpl Multiplicity Assertion}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.MultiplicityAssertionImpl + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.Ecore2logicannotationsPackageImpl#getMultiplicityAssertion() + * @generated + */ + int MULTIPLICITY_ASSERTION = 0; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int MULTIPLICITY_ASSERTION__TARGET = LogicproblemPackage.ASSERTION_ANNOTATION__TARGET; + + /** + * The feature id for the 'Relation' reference. + * + * + * @generated + * @ordered + */ + int MULTIPLICITY_ASSERTION__RELATION = LogicproblemPackage.ASSERTION_ANNOTATION_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Multiplicity Assertion' class. + * + * + * @generated + * @ordered + */ + int MULTIPLICITY_ASSERTION_FEATURE_COUNT = LogicproblemPackage.ASSERTION_ANNOTATION_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Multiplicity Assertion' class. + * + * + * @generated + * @ordered + */ + int MULTIPLICITY_ASSERTION_OPERATION_COUNT = LogicproblemPackage.ASSERTION_ANNOTATION_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.InverseRelationAssertionImpl Inverse Relation Assertion}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.InverseRelationAssertionImpl + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.Ecore2logicannotationsPackageImpl#getInverseRelationAssertion() + * @generated + */ + int INVERSE_RELATION_ASSERTION = 1; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int INVERSE_RELATION_ASSERTION__TARGET = LogicproblemPackage.ASSERTION_ANNOTATION__TARGET; + + /** + * The feature id for the 'Inverse A' reference. + * + * + * @generated + * @ordered + */ + int INVERSE_RELATION_ASSERTION__INVERSE_A = LogicproblemPackage.ASSERTION_ANNOTATION_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Inverse B' reference. + * + * + * @generated + * @ordered + */ + int INVERSE_RELATION_ASSERTION__INVERSE_B = LogicproblemPackage.ASSERTION_ANNOTATION_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Inverse Relation Assertion' class. + * + * + * @generated + * @ordered + */ + int INVERSE_RELATION_ASSERTION_FEATURE_COUNT = LogicproblemPackage.ASSERTION_ANNOTATION_FEATURE_COUNT + 2; + + /** + * The number of operations of the 'Inverse Relation Assertion' class. + * + * + * @generated + * @ordered + */ + int INVERSE_RELATION_ASSERTION_OPERATION_COUNT = LogicproblemPackage.ASSERTION_ANNOTATION_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.LowerMultiplicityAssertionImpl Lower Multiplicity Assertion}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.LowerMultiplicityAssertionImpl + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.Ecore2logicannotationsPackageImpl#getLowerMultiplicityAssertion() + * @generated + */ + int LOWER_MULTIPLICITY_ASSERTION = 2; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int LOWER_MULTIPLICITY_ASSERTION__TARGET = MULTIPLICITY_ASSERTION__TARGET; + + /** + * The feature id for the 'Relation' reference. + * + * + * @generated + * @ordered + */ + int LOWER_MULTIPLICITY_ASSERTION__RELATION = MULTIPLICITY_ASSERTION__RELATION; + + /** + * The feature id for the 'Lower' attribute. + * + * + * @generated + * @ordered + */ + int LOWER_MULTIPLICITY_ASSERTION__LOWER = MULTIPLICITY_ASSERTION_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Lower Multiplicity Assertion' class. + * + * + * @generated + * @ordered + */ + int LOWER_MULTIPLICITY_ASSERTION_FEATURE_COUNT = MULTIPLICITY_ASSERTION_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Lower Multiplicity Assertion' class. + * + * + * @generated + * @ordered + */ + int LOWER_MULTIPLICITY_ASSERTION_OPERATION_COUNT = MULTIPLICITY_ASSERTION_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.UpperMultiplicityAssertionImpl Upper Multiplicity Assertion}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.UpperMultiplicityAssertionImpl + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.Ecore2logicannotationsPackageImpl#getUpperMultiplicityAssertion() + * @generated + */ + int UPPER_MULTIPLICITY_ASSERTION = 3; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int UPPER_MULTIPLICITY_ASSERTION__TARGET = MULTIPLICITY_ASSERTION__TARGET; + + /** + * The feature id for the 'Relation' reference. + * + * + * @generated + * @ordered + */ + int UPPER_MULTIPLICITY_ASSERTION__RELATION = MULTIPLICITY_ASSERTION__RELATION; + + /** + * The feature id for the 'Upper' attribute. + * + * + * @generated + * @ordered + */ + int UPPER_MULTIPLICITY_ASSERTION__UPPER = MULTIPLICITY_ASSERTION_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Upper Multiplicity Assertion' class. + * + * + * @generated + * @ordered + */ + int UPPER_MULTIPLICITY_ASSERTION_FEATURE_COUNT = MULTIPLICITY_ASSERTION_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Upper Multiplicity Assertion' class. + * + * + * @generated + * @ordered + */ + int UPPER_MULTIPLICITY_ASSERTION_OPERATION_COUNT = MULTIPLICITY_ASSERTION_OPERATION_COUNT + 0; + + + /** + * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.MultiplicityAssertion Multiplicity Assertion}'. + * + * + * @return the meta object for class 'Multiplicity Assertion'. + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.MultiplicityAssertion + * @generated + */ + EClass getMultiplicityAssertion(); + + /** + * Returns the meta object for the reference '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.MultiplicityAssertion#getRelation Relation}'. + * + * + * @return the meta object for the reference 'Relation'. + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.MultiplicityAssertion#getRelation() + * @see #getMultiplicityAssertion() + * @generated + */ + EReference getMultiplicityAssertion_Relation(); + + /** + * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.InverseRelationAssertion Inverse Relation Assertion}'. + * + * + * @return the meta object for class 'Inverse Relation Assertion'. + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.InverseRelationAssertion + * @generated + */ + EClass getInverseRelationAssertion(); + + /** + * Returns the meta object for the reference '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.InverseRelationAssertion#getInverseA Inverse A}'. + * + * + * @return the meta object for the reference 'Inverse A'. + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.InverseRelationAssertion#getInverseA() + * @see #getInverseRelationAssertion() + * @generated + */ + EReference getInverseRelationAssertion_InverseA(); + + /** + * Returns the meta object for the reference '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.InverseRelationAssertion#getInverseB Inverse B}'. + * + * + * @return the meta object for the reference 'Inverse B'. + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.InverseRelationAssertion#getInverseB() + * @see #getInverseRelationAssertion() + * @generated + */ + EReference getInverseRelationAssertion_InverseB(); + + /** + * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.LowerMultiplicityAssertion Lower Multiplicity Assertion}'. + * + * + * @return the meta object for class 'Lower Multiplicity Assertion'. + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.LowerMultiplicityAssertion + * @generated + */ + EClass getLowerMultiplicityAssertion(); + + /** + * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.LowerMultiplicityAssertion#getLower Lower}'. + * + * + * @return the meta object for the attribute 'Lower'. + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.LowerMultiplicityAssertion#getLower() + * @see #getLowerMultiplicityAssertion() + * @generated + */ + EAttribute getLowerMultiplicityAssertion_Lower(); + + /** + * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.UpperMultiplicityAssertion Upper Multiplicity Assertion}'. + * + * + * @return the meta object for class 'Upper Multiplicity Assertion'. + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.UpperMultiplicityAssertion + * @generated + */ + EClass getUpperMultiplicityAssertion(); + + /** + * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.UpperMultiplicityAssertion#getUpper Upper}'. + * + * + * @return the meta object for the attribute 'Upper'. + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.UpperMultiplicityAssertion#getUpper() + * @see #getUpperMultiplicityAssertion() + * @generated + */ + EAttribute getUpperMultiplicityAssertion_Upper(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + Ecore2logicannotationsFactory getEcore2logicannotationsFactory(); + + /** + * + * Defines literals for the meta objects that represent + * + * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.MultiplicityAssertionImpl Multiplicity Assertion}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.MultiplicityAssertionImpl + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.Ecore2logicannotationsPackageImpl#getMultiplicityAssertion() + * @generated + */ + EClass MULTIPLICITY_ASSERTION = eINSTANCE.getMultiplicityAssertion(); + + /** + * The meta object literal for the 'Relation' reference feature. + * + * + * @generated + */ + EReference MULTIPLICITY_ASSERTION__RELATION = eINSTANCE.getMultiplicityAssertion_Relation(); + + /** + * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.InverseRelationAssertionImpl Inverse Relation Assertion}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.InverseRelationAssertionImpl + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.Ecore2logicannotationsPackageImpl#getInverseRelationAssertion() + * @generated + */ + EClass INVERSE_RELATION_ASSERTION = eINSTANCE.getInverseRelationAssertion(); + + /** + * The meta object literal for the 'Inverse A' reference feature. + * + * + * @generated + */ + EReference INVERSE_RELATION_ASSERTION__INVERSE_A = eINSTANCE.getInverseRelationAssertion_InverseA(); + + /** + * The meta object literal for the 'Inverse B' reference feature. + * + * + * @generated + */ + EReference INVERSE_RELATION_ASSERTION__INVERSE_B = eINSTANCE.getInverseRelationAssertion_InverseB(); + + /** + * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.LowerMultiplicityAssertionImpl Lower Multiplicity Assertion}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.LowerMultiplicityAssertionImpl + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.Ecore2logicannotationsPackageImpl#getLowerMultiplicityAssertion() + * @generated + */ + EClass LOWER_MULTIPLICITY_ASSERTION = eINSTANCE.getLowerMultiplicityAssertion(); + + /** + * The meta object literal for the 'Lower' attribute feature. + * + * + * @generated + */ + EAttribute LOWER_MULTIPLICITY_ASSERTION__LOWER = eINSTANCE.getLowerMultiplicityAssertion_Lower(); + + /** + * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.UpperMultiplicityAssertionImpl Upper Multiplicity Assertion}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.UpperMultiplicityAssertionImpl + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.Ecore2logicannotationsPackageImpl#getUpperMultiplicityAssertion() + * @generated + */ + EClass UPPER_MULTIPLICITY_ASSERTION = eINSTANCE.getUpperMultiplicityAssertion(); + + /** + * The meta object literal for the 'Upper' attribute feature. + * + * + * @generated + */ + EAttribute UPPER_MULTIPLICITY_ASSERTION__UPPER = eINSTANCE.getUpperMultiplicityAssertion_Upper(); + + } + +} //Ecore2logicannotationsPackage diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/InverseRelationAssertion.java b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/InverseRelationAssertion.java new file mode 100644 index 00000000..cbe8deef --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/InverseRelationAssertion.java @@ -0,0 +1,79 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations; + +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation; + +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.AssertionAnnotation; + +/** + * + * A representation of the model object 'Inverse Relation Assertion'. + * + * + *

+ * The following features are supported: + *

+ * + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage#getInverseRelationAssertion() + * @model + * @generated + */ +public interface InverseRelationAssertion extends AssertionAnnotation { + /** + * Returns the value of the 'Inverse A' reference. + * + *

+ * If the meaning of the 'Inverse A' reference isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Inverse A' reference. + * @see #setInverseA(Relation) + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage#getInverseRelationAssertion_InverseA() + * @model required="true" + * @generated + */ + Relation getInverseA(); + + /** + * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.InverseRelationAssertion#getInverseA Inverse A}' reference. + * + * + * @param value the new value of the 'Inverse A' reference. + * @see #getInverseA() + * @generated + */ + void setInverseA(Relation value); + + /** + * Returns the value of the 'Inverse B' reference. + * + *

+ * If the meaning of the 'Inverse B' reference isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Inverse B' reference. + * @see #setInverseB(Relation) + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage#getInverseRelationAssertion_InverseB() + * @model required="true" + * @generated + */ + Relation getInverseB(); + + /** + * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.InverseRelationAssertion#getInverseB Inverse B}' reference. + * + * + * @param value the new value of the 'Inverse B' reference. + * @see #getInverseB() + * @generated + */ + void setInverseB(Relation value); + +} // InverseRelationAssertion diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/LowerMultiplicityAssertion.java b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/LowerMultiplicityAssertion.java new file mode 100644 index 00000000..d9a06c64 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/LowerMultiplicityAssertion.java @@ -0,0 +1,49 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations; + + +/** + * + * A representation of the model object 'Lower Multiplicity Assertion'. + * + * + *

+ * The following features are supported: + *

+ * + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage#getLowerMultiplicityAssertion() + * @model + * @generated + */ +public interface LowerMultiplicityAssertion extends MultiplicityAssertion { + /** + * Returns the value of the 'Lower' attribute. + * + *

+ * If the meaning of the 'Lower' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Lower' attribute. + * @see #setLower(int) + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage#getLowerMultiplicityAssertion_Lower() + * @model required="true" + * @generated + */ + int getLower(); + + /** + * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.LowerMultiplicityAssertion#getLower Lower}' attribute. + * + * + * @param value the new value of the 'Lower' attribute. + * @see #getLower() + * @generated + */ + void setLower(int value); + +} // LowerMultiplicityAssertion diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/MultiplicityAssertion.java b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/MultiplicityAssertion.java new file mode 100644 index 00000000..d937a97c --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/MultiplicityAssertion.java @@ -0,0 +1,51 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations; + +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation; +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.AssertionAnnotation; + +/** + * + * A representation of the model object 'Multiplicity Assertion'. + * + * + *

+ * The following features are supported: + *

+ * + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage#getMultiplicityAssertion() + * @model + * @generated + */ +public interface MultiplicityAssertion extends AssertionAnnotation { + + /** + * Returns the value of the 'Relation' reference. + * + *

+ * If the meaning of the 'Relation' reference isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Relation' reference. + * @see #setRelation(Relation) + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage#getMultiplicityAssertion_Relation() + * @model required="true" + * @generated + */ + Relation getRelation(); + + /** + * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.MultiplicityAssertion#getRelation Relation}' reference. + * + * + * @param value the new value of the 'Relation' reference. + * @see #getRelation() + * @generated + */ + void setRelation(Relation value); +} // MultiplicityAssertion diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/UpperMultiplicityAssertion.java b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/UpperMultiplicityAssertion.java new file mode 100644 index 00000000..095ab187 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/UpperMultiplicityAssertion.java @@ -0,0 +1,49 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations; + + +/** + * + * A representation of the model object 'Upper Multiplicity Assertion'. + * + * + *

+ * The following features are supported: + *

+ * + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage#getUpperMultiplicityAssertion() + * @model + * @generated + */ +public interface UpperMultiplicityAssertion extends MultiplicityAssertion { + /** + * Returns the value of the 'Upper' attribute. + * + *

+ * If the meaning of the 'Upper' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Upper' attribute. + * @see #setUpper(int) + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage#getUpperMultiplicityAssertion_Upper() + * @model required="true" + * @generated + */ + int getUpper(); + + /** + * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.UpperMultiplicityAssertion#getUpper Upper}' attribute. + * + * + * @param value the new value of the 'Upper' attribute. + * @see #getUpper() + * @generated + */ + void setUpper(int value); + +} // UpperMultiplicityAssertion diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/Ecore2logicannotationsFactoryImpl.java b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/Ecore2logicannotationsFactoryImpl.java new file mode 100644 index 00000000..1693c2aa --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/Ecore2logicannotationsFactoryImpl.java @@ -0,0 +1,128 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl; + +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.*; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class Ecore2logicannotationsFactoryImpl extends EFactoryImpl implements Ecore2logicannotationsFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static Ecore2logicannotationsFactory init() { + try { + Ecore2logicannotationsFactory theEcore2logicannotationsFactory = (Ecore2logicannotationsFactory)EPackage.Registry.INSTANCE.getEFactory(Ecore2logicannotationsPackage.eNS_URI); + if (theEcore2logicannotationsFactory != null) { + return theEcore2logicannotationsFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new Ecore2logicannotationsFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public Ecore2logicannotationsFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case Ecore2logicannotationsPackage.MULTIPLICITY_ASSERTION: return createMultiplicityAssertion(); + case Ecore2logicannotationsPackage.INVERSE_RELATION_ASSERTION: return createInverseRelationAssertion(); + case Ecore2logicannotationsPackage.LOWER_MULTIPLICITY_ASSERTION: return createLowerMultiplicityAssertion(); + case Ecore2logicannotationsPackage.UPPER_MULTIPLICITY_ASSERTION: return createUpperMultiplicityAssertion(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + public MultiplicityAssertion createMultiplicityAssertion() { + MultiplicityAssertionImpl multiplicityAssertion = new MultiplicityAssertionImpl(); + return multiplicityAssertion; + } + + /** + * + * + * @generated + */ + public InverseRelationAssertion createInverseRelationAssertion() { + InverseRelationAssertionImpl inverseRelationAssertion = new InverseRelationAssertionImpl(); + return inverseRelationAssertion; + } + + /** + * + * + * @generated + */ + public LowerMultiplicityAssertion createLowerMultiplicityAssertion() { + LowerMultiplicityAssertionImpl lowerMultiplicityAssertion = new LowerMultiplicityAssertionImpl(); + return lowerMultiplicityAssertion; + } + + /** + * + * + * @generated + */ + public UpperMultiplicityAssertion createUpperMultiplicityAssertion() { + UpperMultiplicityAssertionImpl upperMultiplicityAssertion = new UpperMultiplicityAssertionImpl(); + return upperMultiplicityAssertion; + } + + /** + * + * + * @generated + */ + public Ecore2logicannotationsPackage getEcore2logicannotationsPackage() { + return (Ecore2logicannotationsPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static Ecore2logicannotationsPackage getPackage() { + return Ecore2logicannotationsPackage.eINSTANCE; + } + +} //Ecore2logicannotationsFactoryImpl diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/Ecore2logicannotationsPackageImpl.java b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/Ecore2logicannotationsPackageImpl.java new file mode 100644 index 00000000..33f94c36 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/Ecore2logicannotationsPackageImpl.java @@ -0,0 +1,301 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl; + +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsFactory; +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage; +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.InverseRelationAssertion; +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.LowerMultiplicityAssertion; +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.MultiplicityAssertion; +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.UpperMultiplicityAssertion; + +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.LogiclanguagePackage; + +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicproblemPackage; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class Ecore2logicannotationsPackageImpl extends EPackageImpl implements Ecore2logicannotationsPackage { + /** + * + * + * @generated + */ + private EClass multiplicityAssertionEClass = null; + + /** + * + * + * @generated + */ + private EClass inverseRelationAssertionEClass = null; + + /** + * + * + * @generated + */ + private EClass lowerMultiplicityAssertionEClass = null; + + /** + * + * + * @generated + */ + private EClass upperMultiplicityAssertionEClass = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage#eNS_URI + * @see #init() + * @generated + */ + private Ecore2logicannotationsPackageImpl() { + super(eNS_URI, Ecore2logicannotationsFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link Ecore2logicannotationsPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static Ecore2logicannotationsPackage init() { + if (isInited) return (Ecore2logicannotationsPackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2logicannotationsPackage.eNS_URI); + + // Obtain or create and register package + Ecore2logicannotationsPackageImpl theEcore2logicannotationsPackage = (Ecore2logicannotationsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof Ecore2logicannotationsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new Ecore2logicannotationsPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + LogiclanguagePackage.eINSTANCE.eClass(); + LogicproblemPackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theEcore2logicannotationsPackage.createPackageContents(); + + // Initialize created meta-data + theEcore2logicannotationsPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theEcore2logicannotationsPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(Ecore2logicannotationsPackage.eNS_URI, theEcore2logicannotationsPackage); + return theEcore2logicannotationsPackage; + } + + /** + * + * + * @generated + */ + public EClass getMultiplicityAssertion() { + return multiplicityAssertionEClass; + } + + /** + * + * + * @generated + */ + public EReference getMultiplicityAssertion_Relation() { + return (EReference)multiplicityAssertionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getInverseRelationAssertion() { + return inverseRelationAssertionEClass; + } + + /** + * + * + * @generated + */ + public EReference getInverseRelationAssertion_InverseA() { + return (EReference)inverseRelationAssertionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getInverseRelationAssertion_InverseB() { + return (EReference)inverseRelationAssertionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getLowerMultiplicityAssertion() { + return lowerMultiplicityAssertionEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getLowerMultiplicityAssertion_Lower() { + return (EAttribute)lowerMultiplicityAssertionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getUpperMultiplicityAssertion() { + return upperMultiplicityAssertionEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getUpperMultiplicityAssertion_Upper() { + return (EAttribute)upperMultiplicityAssertionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public Ecore2logicannotationsFactory getEcore2logicannotationsFactory() { + return (Ecore2logicannotationsFactory)getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + multiplicityAssertionEClass = createEClass(MULTIPLICITY_ASSERTION); + createEReference(multiplicityAssertionEClass, MULTIPLICITY_ASSERTION__RELATION); + + inverseRelationAssertionEClass = createEClass(INVERSE_RELATION_ASSERTION); + createEReference(inverseRelationAssertionEClass, INVERSE_RELATION_ASSERTION__INVERSE_A); + createEReference(inverseRelationAssertionEClass, INVERSE_RELATION_ASSERTION__INVERSE_B); + + lowerMultiplicityAssertionEClass = createEClass(LOWER_MULTIPLICITY_ASSERTION); + createEAttribute(lowerMultiplicityAssertionEClass, LOWER_MULTIPLICITY_ASSERTION__LOWER); + + upperMultiplicityAssertionEClass = createEClass(UPPER_MULTIPLICITY_ASSERTION); + createEAttribute(upperMultiplicityAssertionEClass, UPPER_MULTIPLICITY_ASSERTION__UPPER); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + LogicproblemPackage theLogicproblemPackage = (LogicproblemPackage)EPackage.Registry.INSTANCE.getEPackage(LogicproblemPackage.eNS_URI); + LogiclanguagePackage theLogiclanguagePackage = (LogiclanguagePackage)EPackage.Registry.INSTANCE.getEPackage(LogiclanguagePackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + multiplicityAssertionEClass.getESuperTypes().add(theLogicproblemPackage.getAssertionAnnotation()); + inverseRelationAssertionEClass.getESuperTypes().add(theLogicproblemPackage.getAssertionAnnotation()); + lowerMultiplicityAssertionEClass.getESuperTypes().add(this.getMultiplicityAssertion()); + upperMultiplicityAssertionEClass.getESuperTypes().add(this.getMultiplicityAssertion()); + + // Initialize classes, features, and operations; add parameters + initEClass(multiplicityAssertionEClass, MultiplicityAssertion.class, "MultiplicityAssertion", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getMultiplicityAssertion_Relation(), theLogiclanguagePackage.getRelation(), null, "relation", null, 1, 1, MultiplicityAssertion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(inverseRelationAssertionEClass, InverseRelationAssertion.class, "InverseRelationAssertion", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getInverseRelationAssertion_InverseA(), theLogiclanguagePackage.getRelation(), null, "inverseA", null, 1, 1, InverseRelationAssertion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getInverseRelationAssertion_InverseB(), theLogiclanguagePackage.getRelation(), null, "inverseB", null, 1, 1, InverseRelationAssertion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(lowerMultiplicityAssertionEClass, LowerMultiplicityAssertion.class, "LowerMultiplicityAssertion", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getLowerMultiplicityAssertion_Lower(), ecorePackage.getEInt(), "lower", null, 1, 1, LowerMultiplicityAssertion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(upperMultiplicityAssertionEClass, UpperMultiplicityAssertion.class, "UpperMultiplicityAssertion", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getUpperMultiplicityAssertion_Upper(), ecorePackage.getEInt(), "upper", null, 1, 1, UpperMultiplicityAssertion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + } + +} //Ecore2logicannotationsPackageImpl diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/InverseRelationAssertionImpl.java b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/InverseRelationAssertionImpl.java new file mode 100644 index 00000000..a2eb9157 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/InverseRelationAssertionImpl.java @@ -0,0 +1,216 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl; + +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage; +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.InverseRelationAssertion; + +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation; + +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl.AssertionAnnotationImpl; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Inverse Relation Assertion'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class InverseRelationAssertionImpl extends AssertionAnnotationImpl implements InverseRelationAssertion { + /** + * The cached value of the '{@link #getInverseA() Inverse A}' reference. + * + * + * @see #getInverseA() + * @generated + * @ordered + */ + protected Relation inverseA; + /** + * The cached value of the '{@link #getInverseB() Inverse B}' reference. + * + * + * @see #getInverseB() + * @generated + * @ordered + */ + protected Relation inverseB; + /** + * + * + * @generated + */ + protected InverseRelationAssertionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Ecore2logicannotationsPackage.Literals.INVERSE_RELATION_ASSERTION; + } + + /** + * + * + * @generated + */ + public Relation getInverseA() { + if (inverseA != null && inverseA.eIsProxy()) { + InternalEObject oldInverseA = (InternalEObject)inverseA; + inverseA = (Relation)eResolveProxy(oldInverseA); + if (inverseA != oldInverseA) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Ecore2logicannotationsPackage.INVERSE_RELATION_ASSERTION__INVERSE_A, oldInverseA, inverseA)); + } + } + return inverseA; + } + + /** + * + * + * @generated + */ + public Relation basicGetInverseA() { + return inverseA; + } + + /** + * + * + * @generated + */ + public void setInverseA(Relation newInverseA) { + Relation oldInverseA = inverseA; + inverseA = newInverseA; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Ecore2logicannotationsPackage.INVERSE_RELATION_ASSERTION__INVERSE_A, oldInverseA, inverseA)); + } + + /** + * + * + * @generated + */ + public Relation getInverseB() { + if (inverseB != null && inverseB.eIsProxy()) { + InternalEObject oldInverseB = (InternalEObject)inverseB; + inverseB = (Relation)eResolveProxy(oldInverseB); + if (inverseB != oldInverseB) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Ecore2logicannotationsPackage.INVERSE_RELATION_ASSERTION__INVERSE_B, oldInverseB, inverseB)); + } + } + return inverseB; + } + + /** + * + * + * @generated + */ + public Relation basicGetInverseB() { + return inverseB; + } + + /** + * + * + * @generated + */ + public void setInverseB(Relation newInverseB) { + Relation oldInverseB = inverseB; + inverseB = newInverseB; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Ecore2logicannotationsPackage.INVERSE_RELATION_ASSERTION__INVERSE_B, oldInverseB, inverseB)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Ecore2logicannotationsPackage.INVERSE_RELATION_ASSERTION__INVERSE_A: + if (resolve) return getInverseA(); + return basicGetInverseA(); + case Ecore2logicannotationsPackage.INVERSE_RELATION_ASSERTION__INVERSE_B: + if (resolve) return getInverseB(); + return basicGetInverseB(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Ecore2logicannotationsPackage.INVERSE_RELATION_ASSERTION__INVERSE_A: + setInverseA((Relation)newValue); + return; + case Ecore2logicannotationsPackage.INVERSE_RELATION_ASSERTION__INVERSE_B: + setInverseB((Relation)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Ecore2logicannotationsPackage.INVERSE_RELATION_ASSERTION__INVERSE_A: + setInverseA((Relation)null); + return; + case Ecore2logicannotationsPackage.INVERSE_RELATION_ASSERTION__INVERSE_B: + setInverseB((Relation)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Ecore2logicannotationsPackage.INVERSE_RELATION_ASSERTION__INVERSE_A: + return inverseA != null; + case Ecore2logicannotationsPackage.INVERSE_RELATION_ASSERTION__INVERSE_B: + return inverseB != null; + } + return super.eIsSet(featureID); + } + +} //InverseRelationAssertionImpl diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/LowerMultiplicityAssertionImpl.java b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/LowerMultiplicityAssertionImpl.java new file mode 100644 index 00000000..bc0cffc8 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/LowerMultiplicityAssertionImpl.java @@ -0,0 +1,162 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl; + +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage; +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.LowerMultiplicityAssertion; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Lower Multiplicity Assertion'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class LowerMultiplicityAssertionImpl extends MultiplicityAssertionImpl implements LowerMultiplicityAssertion { + /** + * The default value of the '{@link #getLower() Lower}' attribute. + * + * + * @see #getLower() + * @generated + * @ordered + */ + protected static final int LOWER_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getLower() Lower}' attribute. + * + * + * @see #getLower() + * @generated + * @ordered + */ + protected int lower = LOWER_EDEFAULT; + + /** + * + * + * @generated + */ + protected LowerMultiplicityAssertionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Ecore2logicannotationsPackage.Literals.LOWER_MULTIPLICITY_ASSERTION; + } + + /** + * + * + * @generated + */ + public int getLower() { + return lower; + } + + /** + * + * + * @generated + */ + public void setLower(int newLower) { + int oldLower = lower; + lower = newLower; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Ecore2logicannotationsPackage.LOWER_MULTIPLICITY_ASSERTION__LOWER, oldLower, lower)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Ecore2logicannotationsPackage.LOWER_MULTIPLICITY_ASSERTION__LOWER: + return getLower(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Ecore2logicannotationsPackage.LOWER_MULTIPLICITY_ASSERTION__LOWER: + setLower((Integer)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Ecore2logicannotationsPackage.LOWER_MULTIPLICITY_ASSERTION__LOWER: + setLower(LOWER_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Ecore2logicannotationsPackage.LOWER_MULTIPLICITY_ASSERTION__LOWER: + return lower != LOWER_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (lower: "); + result.append(lower); + result.append(')'); + return result.toString(); + } + +} //LowerMultiplicityAssertionImpl diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/MultiplicityAssertionImpl.java b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/MultiplicityAssertionImpl.java new file mode 100644 index 00000000..b5dafe5c --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/MultiplicityAssertionImpl.java @@ -0,0 +1,156 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl; + +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage; +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.MultiplicityAssertion; + +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation; +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl.AssertionAnnotationImpl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Multiplicity Assertion'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class MultiplicityAssertionImpl extends AssertionAnnotationImpl implements MultiplicityAssertion { + /** + * The cached value of the '{@link #getRelation() Relation}' reference. + * + * + * @see #getRelation() + * @generated + * @ordered + */ + protected Relation relation; + + /** + * + * + * @generated + */ + protected MultiplicityAssertionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Ecore2logicannotationsPackage.Literals.MULTIPLICITY_ASSERTION; + } + + /** + * + * + * @generated + */ + public Relation getRelation() { + if (relation != null && relation.eIsProxy()) { + InternalEObject oldRelation = (InternalEObject)relation; + relation = (Relation)eResolveProxy(oldRelation); + if (relation != oldRelation) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Ecore2logicannotationsPackage.MULTIPLICITY_ASSERTION__RELATION, oldRelation, relation)); + } + } + return relation; + } + + /** + * + * + * @generated + */ + public Relation basicGetRelation() { + return relation; + } + + /** + * + * + * @generated + */ + public void setRelation(Relation newRelation) { + Relation oldRelation = relation; + relation = newRelation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Ecore2logicannotationsPackage.MULTIPLICITY_ASSERTION__RELATION, oldRelation, relation)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Ecore2logicannotationsPackage.MULTIPLICITY_ASSERTION__RELATION: + if (resolve) return getRelation(); + return basicGetRelation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Ecore2logicannotationsPackage.MULTIPLICITY_ASSERTION__RELATION: + setRelation((Relation)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Ecore2logicannotationsPackage.MULTIPLICITY_ASSERTION__RELATION: + setRelation((Relation)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Ecore2logicannotationsPackage.MULTIPLICITY_ASSERTION__RELATION: + return relation != null; + } + return super.eIsSet(featureID); + } + +} //MultiplicityAssertionImpl diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/UpperMultiplicityAssertionImpl.java b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/UpperMultiplicityAssertionImpl.java new file mode 100644 index 00000000..f7f39f4e --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/impl/UpperMultiplicityAssertionImpl.java @@ -0,0 +1,162 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl; + +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage; +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.UpperMultiplicityAssertion; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Upper Multiplicity Assertion'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class UpperMultiplicityAssertionImpl extends MultiplicityAssertionImpl implements UpperMultiplicityAssertion { + /** + * The default value of the '{@link #getUpper() Upper}' attribute. + * + * + * @see #getUpper() + * @generated + * @ordered + */ + protected static final int UPPER_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getUpper() Upper}' attribute. + * + * + * @see #getUpper() + * @generated + * @ordered + */ + protected int upper = UPPER_EDEFAULT; + + /** + * + * + * @generated + */ + protected UpperMultiplicityAssertionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Ecore2logicannotationsPackage.Literals.UPPER_MULTIPLICITY_ASSERTION; + } + + /** + * + * + * @generated + */ + public int getUpper() { + return upper; + } + + /** + * + * + * @generated + */ + public void setUpper(int newUpper) { + int oldUpper = upper; + upper = newUpper; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Ecore2logicannotationsPackage.UPPER_MULTIPLICITY_ASSERTION__UPPER, oldUpper, upper)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Ecore2logicannotationsPackage.UPPER_MULTIPLICITY_ASSERTION__UPPER: + return getUpper(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Ecore2logicannotationsPackage.UPPER_MULTIPLICITY_ASSERTION__UPPER: + setUpper((Integer)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Ecore2logicannotationsPackage.UPPER_MULTIPLICITY_ASSERTION__UPPER: + setUpper(UPPER_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Ecore2logicannotationsPackage.UPPER_MULTIPLICITY_ASSERTION__UPPER: + return upper != UPPER_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (upper: "); + result.append(upper); + result.append(')'); + return result.toString(); + } + +} //UpperMultiplicityAssertionImpl diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/util/Ecore2logicannotationsAdapterFactory.java b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/util/Ecore2logicannotationsAdapterFactory.java new file mode 100644 index 00000000..38b4f411 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/util/Ecore2logicannotationsAdapterFactory.java @@ -0,0 +1,213 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.util; + +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.*; + +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.Annotation; +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.AssertionAnnotation; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage + * @generated + */ +public class Ecore2logicannotationsAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static Ecore2logicannotationsPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public Ecore2logicannotationsAdapterFactory() { + if (modelPackage == null) { + modelPackage = Ecore2logicannotationsPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected Ecore2logicannotationsSwitch modelSwitch = + new Ecore2logicannotationsSwitch() { + @Override + public Adapter caseMultiplicityAssertion(MultiplicityAssertion object) { + return createMultiplicityAssertionAdapter(); + } + @Override + public Adapter caseInverseRelationAssertion(InverseRelationAssertion object) { + return createInverseRelationAssertionAdapter(); + } + @Override + public Adapter caseLowerMultiplicityAssertion(LowerMultiplicityAssertion object) { + return createLowerMultiplicityAssertionAdapter(); + } + @Override + public Adapter caseUpperMultiplicityAssertion(UpperMultiplicityAssertion object) { + return createUpperMultiplicityAssertionAdapter(); + } + @Override + public Adapter caseAnnotation(Annotation object) { + return createAnnotationAdapter(); + } + @Override + public Adapter caseAssertionAnnotation(AssertionAnnotation object) { + return createAssertionAnnotationAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.MultiplicityAssertion Multiplicity Assertion}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.MultiplicityAssertion + * @generated + */ + public Adapter createMultiplicityAssertionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.InverseRelationAssertion Inverse Relation Assertion}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.InverseRelationAssertion + * @generated + */ + public Adapter createInverseRelationAssertionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.LowerMultiplicityAssertion Lower Multiplicity Assertion}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.LowerMultiplicityAssertion + * @generated + */ + public Adapter createLowerMultiplicityAssertionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.UpperMultiplicityAssertion Upper Multiplicity Assertion}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.UpperMultiplicityAssertion + * @generated + */ + public Adapter createUpperMultiplicityAssertionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.Annotation Annotation}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.Annotation + * @generated + */ + public Adapter createAnnotationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.AssertionAnnotation Assertion Annotation}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.AssertionAnnotation + * @generated + */ + public Adapter createAssertionAnnotationAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //Ecore2logicannotationsAdapterFactory diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/util/Ecore2logicannotationsSwitch.java b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/util/Ecore2logicannotationsSwitch.java new file mode 100644 index 00000000..06d3fe84 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/ecore-gen/hu/bme/mit/inf/dslreasoner/ecore2logic/ecore2logicannotations/util/Ecore2logicannotationsSwitch.java @@ -0,0 +1,216 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.util; + +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.*; + +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.Annotation; +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.AssertionAnnotation; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage + * @generated + */ +public class Ecore2logicannotationsSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static Ecore2logicannotationsPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public Ecore2logicannotationsSwitch() { + if (modelPackage == null) { + modelPackage = Ecore2logicannotationsPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * @param ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case Ecore2logicannotationsPackage.MULTIPLICITY_ASSERTION: { + MultiplicityAssertion multiplicityAssertion = (MultiplicityAssertion)theEObject; + T result = caseMultiplicityAssertion(multiplicityAssertion); + if (result == null) result = caseAssertionAnnotation(multiplicityAssertion); + if (result == null) result = caseAnnotation(multiplicityAssertion); + if (result == null) result = defaultCase(theEObject); + return result; + } + case Ecore2logicannotationsPackage.INVERSE_RELATION_ASSERTION: { + InverseRelationAssertion inverseRelationAssertion = (InverseRelationAssertion)theEObject; + T result = caseInverseRelationAssertion(inverseRelationAssertion); + if (result == null) result = caseAssertionAnnotation(inverseRelationAssertion); + if (result == null) result = caseAnnotation(inverseRelationAssertion); + if (result == null) result = defaultCase(theEObject); + return result; + } + case Ecore2logicannotationsPackage.LOWER_MULTIPLICITY_ASSERTION: { + LowerMultiplicityAssertion lowerMultiplicityAssertion = (LowerMultiplicityAssertion)theEObject; + T result = caseLowerMultiplicityAssertion(lowerMultiplicityAssertion); + if (result == null) result = caseMultiplicityAssertion(lowerMultiplicityAssertion); + if (result == null) result = caseAssertionAnnotation(lowerMultiplicityAssertion); + if (result == null) result = caseAnnotation(lowerMultiplicityAssertion); + if (result == null) result = defaultCase(theEObject); + return result; + } + case Ecore2logicannotationsPackage.UPPER_MULTIPLICITY_ASSERTION: { + UpperMultiplicityAssertion upperMultiplicityAssertion = (UpperMultiplicityAssertion)theEObject; + T result = caseUpperMultiplicityAssertion(upperMultiplicityAssertion); + if (result == null) result = caseMultiplicityAssertion(upperMultiplicityAssertion); + if (result == null) result = caseAssertionAnnotation(upperMultiplicityAssertion); + if (result == null) result = caseAnnotation(upperMultiplicityAssertion); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Multiplicity Assertion'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Multiplicity Assertion'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseMultiplicityAssertion(MultiplicityAssertion object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Inverse Relation Assertion'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Inverse Relation Assertion'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInverseRelationAssertion(InverseRelationAssertion object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Lower Multiplicity Assertion'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Lower Multiplicity Assertion'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseLowerMultiplicityAssertion(LowerMultiplicityAssertion object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Upper Multiplicity Assertion'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Upper Multiplicity Assertion'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseUpperMultiplicityAssertion(UpperMultiplicityAssertion object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Annotation'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Annotation'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseAnnotation(Annotation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Assertion Annotation'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Assertion Annotation'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseAssertionAnnotation(AssertionAnnotation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} //Ecore2logicannotationsSwitch diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/model/ecore2logicannotations.aird b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/model/ecore2logicannotations.aird new file mode 100644 index 00000000..2336933d --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/model/ecore2logicannotations.aird @@ -0,0 +1,527 @@ + + + ecore2logicannotations.ecore + platform:/resource/hu.bme.mit.inf.dslreasoner.logic.model/model/logicproblem.ecore + platform:/resource/hu.bme.mit.inf.dslreasoner.logic.model/model/logiclanguage.ecore + http://www.eclipse.org/emf/2002/Ecore + + + + + + + bold + + + + + + + bold + + + + + + + + + + bold + + + + bold + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + + + + italic + + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + bold + + + + + + + + + + + italic + + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + bold + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + bold + + + + + + + + + + + italic + + + + + + + + + + + + italic + + + + + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + + + + + + + italic + + + + + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + italic + + + + + + + + + + bold + + + + + + + + + + + bold + + + + + + + + + + + bold + + + + + + + + + + + + bold + + + bold + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/model/ecore2logicannotations.ecore b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/model/ecore2logicannotations.ecore new file mode 100644 index 00000000..99c70059 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/model/ecore2logicannotations.ecore @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/model/ecore2logicannotations.genmodel b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/model/ecore2logicannotations.genmodel new file mode 100644 index 00000000..39176118 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/model/ecore2logicannotations.genmodel @@ -0,0 +1,22 @@ + + + ecore2logicannotations.ecore + + + + + + + + + + + + + diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/plugin.properties b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/plugin.properties new file mode 100644 index 00000000..dba79bb4 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/plugin.properties @@ -0,0 +1,4 @@ +# + +pluginName = Ecore2logicannotations Model +providerName = www.example.org diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/plugin.xml b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/plugin.xml new file mode 100644 index 00000000..cd13faaa --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/plugin.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/AttributeMapper.xtend b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/AttributeMapper.xtend new file mode 100644 index 00000000..ebf49196 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/AttributeMapper.xtend @@ -0,0 +1,119 @@ +package hu.bme.mit.inf.dslreasoner.ecore2logic + +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsFactory +import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicProblemBuilder +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Assertion +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDeclaration +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Term +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TermDescription +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDescriptor +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem +import java.util.HashMap +import java.util.Map +import org.eclipse.emf.ecore.EAttribute +import org.eclipse.emf.ecore.EEnum + +interface EAttributeMapper { + def void transformEAttributes(Ecore2Logic_Trace trace, LogicProblem logicProblem, Iterable attributes) + def Term IsAttributeValue(Ecore2Logic_Trace trace, TermDescription object, TermDescription value, EAttribute attribute) + def RelationDeclaration relationOfAttribute(Ecore2Logic_Trace trace, EAttribute attribute) + def TypeDescriptor TypeOfRange(Ecore2Logic_Trace trace, EAttribute attribute) +} + +class EAttributeMapper_RelationsOverTypes_Trace implements Trace{ + public var Map indicators = new HashMap + public var Map typeCompliance = new HashMap + public var Map lowerMultiplicity = new HashMap + public var Map upperMultiplicity = new HashMap +} + +class EAttributeMapper_RelationsOverTypes implements EAttributeMapper { + protected val extension LogicProblemBuilder builder = new LogicProblemBuilder + val extension Ecore2logicannotationsFactory builder2 = Ecore2logicannotationsFactory.eINSTANCE + protected val extension EClassMapper classMapper + protected val extension EEnumMapper enumMapper; + + public new(EClassMapper classMapper, EEnumMapper enumMapper) { + this.enumMapper = enumMapper + this.classMapper = classMapper + } + + public override transformEAttributes(Ecore2Logic_Trace trace, LogicProblem logicProblem, Iterable attributes) { + val attributeMapperTrace = new EAttributeMapper_RelationsOverTypes_Trace + trace.attributeMapperTrace = attributeMapperTrace + + for(attribute : attributes) { + val sourceType = trace.TypeofEClass(attribute.EContainingClass) + val rangeType = trace.TypeOfRange(attribute) + + // relations + val indicator = '''inAttribute «attribute.name» «attribute.EContainingClass.name»'''.RelationDeclaration(sourceType,rangeType) + + logicProblem.add(indicator) + attributeMapperTrace.indicators.put(attribute,indicator) + + // lower multiplicity + var Assertion lowerMultiplicity = null + if(attribute.lowerBound != 0) { + lowerMultiplicity = '''lowerMultiplicity «attribute.name» «attribute.EContainingClass.name»'''.Assertion( + Forall[ + val source = addVar('''src''', sourceType) + Exists[ context | + val targets = (1 .. attribute.lowerBound).map[context.addVar('''trg «it»''', rangeType)].toList + val attributeValue = And(targets.map[IsAttributeValue(trace, source, it, attribute)]) + if(targets.size > 1) return Distinct(targets) && attributeValue + else return attributeValue + ] + ] + ) + val annotation = createLowerMultiplicityAssertion => [ + it.lower = attribute.lowerBound + it.relation = indicator + ] + logicProblem.add(lowerMultiplicity) + logicProblem.annotations += annotation + lowerMultiplicity.annotations +=annotation + } + attributeMapperTrace.lowerMultiplicity.put(attribute,lowerMultiplicity) + + var Assertion upperMultiplicity = null + if(attribute.upperBound > 0) { + upperMultiplicity = '''upperMultiplicity «attribute.name» «attribute.EContainingClass.name»'''.Assertion( + Forall[ context | + val source = context.addVar('''src''', sourceType) + val targets = (1 .. attribute.upperBound+1).map[context.addVar('''trg «it»''', rangeType)].toList + And(targets.map[IsAttributeValue(trace, source, it, attribute)]) => ! Distinct(targets) + ]) + + val annotation = createUpperMultiplicityAssertion => [ + it.upper = attribute.upperBound + it.relation = indicator + ] + + logicProblem.add(upperMultiplicity) + logicProblem.annotations += annotation + upperMultiplicity.annotations += annotation + } + attributeMapperTrace.upperMultiplicity.put(attribute,upperMultiplicity) + } + } + + def asTrace(Trace trace) { return trace as EAttributeMapper_RelationsOverTypes_Trace} + + override IsAttributeValue(Ecore2Logic_Trace trace, TermDescription object, TermDescription value, EAttribute attribute) { + trace.attributeMapperTrace.asTrace.indicators.get(attribute).call(object,value) + } + + override TypeDescriptor TypeOfRange(Ecore2Logic_Trace trace, EAttribute attribute) { + if(attribute.EType instanceof EEnum) return enumMapper.TypeofEEnum(trace,attribute.EType as EEnum) + else if(attribute.EType.name.equals("EInt")) return LogicInt + else if(attribute.EType.name.equals("EBoolean")) return LogicBool + else if(attribute.EType.name.equals("EDouble") || + attribute.EType.name.equals("EFloat")) return LogicReal + else throw new UnsupportedOperationException('''Unsupported attribute type: «attribute.EType.name»''') + } + + override relationOfAttribute(Ecore2Logic_Trace trace, EAttribute attribute) { + trace.attributeMapperTrace.asTrace.indicators.get(attribute) + } +} \ No newline at end of file diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/ContainmentMapper.xtend b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/ContainmentMapper.xtend new file mode 100644 index 00000000..492be59f --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/ContainmentMapper.xtend @@ -0,0 +1,133 @@ +package hu.bme.mit.inf.dslreasoner.ecore2logic + +import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicProblemBuilder +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Constant +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem +import org.eclipse.emf.ecore.EReference +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Assertion + +interface ContainmentMapper { + def void transformContainment(Ecore2Logic_Trace trace, LogicProblem problem, Iterable references, boolean singleRoot); +} + +class ContainmentMapper_ReferenceConjuction_Trace implements Trace { + public var Constant root; + public var Relation contains + public var Assertion containsDefinition; + public var Assertion rootIsNotContained; + public var Assertion everithingElseContained; + public var Assertion notContainedByMore; +} + +class ContainmentMapper_ReferenceConjuction implements ContainmentMapper{ + val extension LogicProblemBuilder builder = new LogicProblemBuilder + val extension EClassMapper classMapper; + val extension EReferenceMapper referenceMapper + val int containmentAcyclicityApproximationLevel; + + public new(EClassMapper classMapper, EReferenceMapper referenceMapper, int containmentAcyclicityApproximationLevel) { + this.classMapper = classMapper + this.referenceMapper = referenceMapper + this.containmentAcyclicityApproximationLevel = containmentAcyclicityApproximationLevel + } + + override transformContainment(Ecore2Logic_Trace trace, LogicProblem problem, Iterable references, boolean singleRoot) { + val allClasses = classMapper.allClassesInScope(trace).map[classMapper.TypeofEClass(trace,it)] + val containmentRelation = references.filter[isContainment].map[referenceMapper.relationOfReference(trace,it)] + val containmentHierarchy = ContainmentHierarchy(allClasses,#[],containmentRelation,null) + problem.add(containmentHierarchy) + } +} + +/*val containmentMapperTrace = new ContainmentMapper_ReferenceConjuction_Trace + trace.containmentMapperTrace = containmentMapperTrace + + val containment = references.filter[containment] + + val contains = problem.add(RelationDeclaration('''contains''', getType(trace,references),getType(trace,references))) + containmentMapperTrace.contains = contains + containmentMapperTrace.containsDefinition = problem.add(Assertion('''containsDefinition''', + Forall[ + val parent = addVar("parent",getType(trace,references)) + val child = addVar("child",getType(trace,references)) + contains.call(parent,child) <=> Or(containment.map[IsInReference(trace,parent,child,it)]) + ] + )) + + + + containmentMapperTrace.notContainedByMore = problem.add(Assertion('''notContainedByMore''', + Forall[ + val child = addVar('''child''',getType(trace,references)) + val parent1 = addVar('''parent 1''',getType(trace,references)) + val parent2 = addVar('''parent 2''',getType(trace,references)) + (contains.call(parent1,child) && contains.call(parent2,child)) => (parent1 == parent2) + ] + )) + + (2..containmentAcyclicityApproximationLevel).forEach[problem.add(getAcyclicityConstraint(trace,references,it))] + + if (singleRoot) { + val root = problem.add(ConstantDeclaration('''root''', getType(trace, references))) + containmentMapperTrace.root = root + + containmentMapperTrace.rootIsNotContained = problem.add( + Assertion( + '''rootIsNotContained''', + Forall[ + val parent = addVar("parent", getType(trace, references)) + !contains.call(parent, root) + ] + )) + + containmentMapperTrace.everithingElseContained = problem.add( + Assertion( + '''nonrootIsContained''', + Forall[ + val child = addVar("child", getType(trace, references)) + (child != root) => Exists[ + val parent = addVar("parent", getType(trace, references)) + contains.call(parent, child) + ] + ] + )) + }*/ + + +// def asTrace(Trace trace) { trace as ContainmentMapper_ReferenceConjuction_Trace } +// +// def getAcyclicityConstraint(Ecore2Logic_Trace trace, Iterable references,int circleSize) { +// val newTrace = trace.containmentMapperTrace.asTrace +// //val newTrace2 = trace.containmentMapperTrace as ContainmentMapper_ReferenceConjuction_Trace // ??? +// +// Forall[context | +// val elements = (0..circleSize).map[context.addVar(getType(trace,references))].toList +// !(And((0..circleSize-1).map[newTrace.contains.call(elements.get(it),elements.get(it+1))]) && +// newTrace.contains.call(elements.last,elements.head)) +// ] +// } +// +// def private getType(Ecore2Logic_Trace trace, Iterable references) { +// trace.TypeofEClass(references.head.EContainingClass) +// } + + /*// This type is contained -> (From this type -> By those references) + val Map>> typeContainedBy = new HashMap + for(reference: references.filter[containment]) { + val sourceType = TypeofEClass(classMapperTrace, reference.EContainingClass) + val targetType = TypeofEClass(classMapperTrace, reference.EType as EClass) + if(typeContainedBy.containsKey(targetType)) { + val m = typeContainedBy.get(targetType) + if(m.containsKey(sourceType)) { + m.get(sourceType).add(reference) + } else { + m.put(sourceType,new HashSet => [add(reference)]) + } + } else { // initialise the collection + val Map> m = new HashMap + m.put(sourceType,new HashSet => [add(reference)]) + typeContainedBy.put(targetType,m) + } + }*/ + // Only one type \ No newline at end of file diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EClassMapper.xtend b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EClassMapper.xtend new file mode 100644 index 00000000..3949749b --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EClassMapper.xtend @@ -0,0 +1,53 @@ +package hu.bme.mit.inf.dslreasoner.ecore2logic + +import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicProblemBuilder +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem +import java.util.Map +import org.eclipse.emf.ecore.EClass +import java.util.HashMap + +interface EClassMapper { + def void transformEClasses(Ecore2Logic_Trace trace, LogicProblem problem, Iterable classes, int numberOfObjects, EcoreMetamodelDescriptor metamodelDescriptor) + def Iterable allClassesInScope(Ecore2Logic_Trace trace) + def Type TypeofEClass(Ecore2Logic_Trace trace, EClass type) +} + +class EClassMapper_AllElementAsObject_Trace implements Trace{ + public var Map typeMap = new HashMap; +} + +class EClassMapper_AllElementAsObject implements EClassMapper{ + val extension LogicProblemBuilder builder = new LogicProblemBuilder + + override transformEClasses(Ecore2Logic_Trace trace, LogicProblem problem, + Iterable classes, int numberOfObjects, EcoreMetamodelDescriptor metamodelDescriptor + ) { + val classMapperTrace = new EClassMapper_AllElementAsObject_Trace + trace.classMapperTrace = classMapperTrace + for(c:classes) { + val logicType = problem.add(TypeDeclaration('''class «c.name»''',c.isAbstract || c.isInterface)) + classMapperTrace.typeMap.put(c,logicType) + } + for(c:classes) { + for(s : c.ESuperTypes) { + Supertype(classMapperTrace.typeMap.get(c),classMapperTrace.typeMap.get(s)) + } + } + } + + def asTrace(Trace o) { o as EClassMapper_AllElementAsObject_Trace } + + override TypeofEClass(Ecore2Logic_Trace trace, EClass type) { + val typeMap = trace.classMapperTrace.asTrace.typeMap + if(typeMap.containsKey(type)) { + typeMap.get(type) + } else { + throw new IllegalArgumentException('''Class «type.name» is not translated to logic!''') + } + } + + override allClassesInScope(Ecore2Logic_Trace trace) { + trace.classMapperTrace.asTrace.typeMap.keySet + } +} diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EEnumMapper.xtend b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EEnumMapper.xtend new file mode 100644 index 00000000..eb7e9e44 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EEnumMapper.xtend @@ -0,0 +1,60 @@ +package hu.bme.mit.inf.dslreasoner.ecore2logic + +import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicProblemBuilder +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.DefinedElement +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TermDescription +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem +import java.util.ArrayList +import java.util.HashMap +import java.util.Map +import org.eclipse.emf.common.util.Enumerator +import org.eclipse.emf.ecore.EEnum + +import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* + +interface EEnumMapper { + def void transformEEnums(Ecore2Logic_Trace trace, LogicProblem problem, Iterable enums,Ecore2LogicConfiguration config) + def Type TypeofEEnum(Ecore2Logic_Trace trace, EEnum type) + def TermDescription Literal(Ecore2Logic_Trace trace, Enumerator literal) +} + +class EEnumMapper_PredefinedClasses_Trace implements Trace{ + public var Map enums + + public var Map literals +} + +class EEnumMapper_PredefinedClasses implements EEnumMapper { + val extension LogicProblemBuilder builder = new LogicProblemBuilder + + override transformEEnums(Ecore2Logic_Trace trace, LogicProblem problem, Iterable enums, Ecore2LogicConfiguration config) { + val enumTrace = new EEnumMapper_PredefinedClasses_Trace + trace.enumMapperTrace = enumTrace + enumTrace.enums = new HashMap + enumTrace.literals = new HashMap + + for(enum : enums) { + val l = new ArrayList(enum.ELiterals.size) + for(literal : enum.ELiterals.map[instance]) { + val element = Element('''«literal.name» «enum.name»''') + l+=element + enumTrace.literals.put(literal,element) + } + val type = TypeDefinition('''enum «enum.name»''',false,l) + problem.add(type) + enumTrace.enums.put(enum,type) + } + + } + + private def asTrace(Trace o) { o as EEnumMapper_PredefinedClasses_Trace } + + override TypeofEEnum(Ecore2Logic_Trace trace, EEnum type) { + trace.enumMapperTrace.asTrace.enums.get(type) + } + + override Literal(Ecore2Logic_Trace trace, Enumerator literal) { + literal.lookup(trace.enumMapperTrace.asTrace.literals) + } +} \ No newline at end of file diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EReferenceMapper.xtend b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EReferenceMapper.xtend new file mode 100644 index 00000000..e5de6584 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EReferenceMapper.xtend @@ -0,0 +1,154 @@ +package hu.bme.mit.inf.dslreasoner.ecore2logic + +import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsFactory +import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicProblemBuilder +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Assertion +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDeclaration +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Term +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TermDescription +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem +import java.util.HashMap +import java.util.Map +import org.eclipse.emf.ecore.EClass +import org.eclipse.emf.ecore.EReference + +interface EReferenceMapper{ + def void transformEReferences(Ecore2Logic_Trace trace, LogicProblem problem, Iterable classes); + def Term IsInReference(Ecore2Logic_Trace trace, TermDescription source, TermDescription target, EReference type) + def RelationDeclaration relationOfReference(Ecore2Logic_Trace trace, EReference reference) +} + +class EReferenceMapper_RelationsOverTypes_Trace implements Trace { + public var Map indicators; + public var Map typeCompliance + public var Map lowerMultiplicity + public var Map upperMultiplicity + public var Map inverseEdges +} + +class EReferenceMapper_RelationsOverTypes implements EReferenceMapper{ + val extension LogicProblemBuilder builder = new LogicProblemBuilder + val extension Ecore2logicannotationsFactory builder2 = Ecore2logicannotationsFactory.eINSTANCE + val extension EClassMapper classMapper; + + public new(EClassMapper classMapper) { + this.classMapper = classMapper + } + + def asTrace(Trace o) { o as EReferenceMapper_RelationsOverTypes_Trace } + + override transformEReferences(Ecore2Logic_Trace trace, LogicProblem problem, Iterable references) { + val newTrace = new EReferenceMapper_RelationsOverTypes_Trace + trace.referenceMapperTrace = newTrace + trace.createIndicatorDeclarations(problem,references) + trace.createMultiplicityConstraints(problem,references) + trace.createInverseReferenceConstraints(problem,references) + } + + def protected void createIndicatorDeclarations(Ecore2Logic_Trace trace, LogicProblem problem, Iterable references) { + trace.referenceMapperTrace.asTrace.indicators = new HashMap + for(reference : references) { + val relation = problem.add(RelationDeclaration( + '''inreference «reference.name» «reference.EContainingClass.name»''', + TypeofEClass(trace,reference.EContainingClass), + TypeofEClass(trace,reference.EType as EClass))) + trace.referenceMapperTrace.asTrace.indicators.put(reference,relation as RelationDeclaration) + } + } + + def void createMultiplicityConstraints(Ecore2Logic_Trace trace, LogicProblem problem, Iterable references) { + trace.referenceMapperTrace.asTrace.lowerMultiplicity = new HashMap + trace.referenceMapperTrace.asTrace.upperMultiplicity = new HashMap + + for(reference : references) { + val sourceType = reference.EContainingClass + val targetType = reference.EType as EClass + val lower = reference.lowerBound + val upper = reference.upperBound + + if (lower > 0) { + val assertion = Assertion('''lowerMultiplicity «reference.name» «sourceType.name»''', + Forall[ + val source = addVar('''src''', trace.TypeofEClass(sourceType)) + Exists[ context | + val targets = (1 .. lower).map[ + context.addVar('''trg «it»''', trace.TypeofEClass(targetType))].toList + val inReference = And(targets.map[IsInReference(trace, source, it, reference)]) + if(targets.size > 1) return Distinct(targets) && inReference + else return inReference + ] + ] + ) + val annotation = createLowerMultiplicityAssertion => [ + it.lower = lower + it.relation = trace.referenceMapperTrace.asTrace.indicators.get(reference) + ] + + problem.add(assertion) + problem.annotations += annotation + assertion.annotations +=annotation + trace.referenceMapperTrace.asTrace.lowerMultiplicity.put(reference,assertion) + } + else trace.referenceMapperTrace.asTrace.lowerMultiplicity.put(reference,null) + + if(upper != -1) { + val assertion = Assertion('''upperMultiplicity «reference.name» «sourceType.name»''', + Forall[ context | + val source = context.addVar('''src''', trace.TypeofEClass(sourceType)) + val targets = (1 .. upper+1).map[ + context.addVar('''trg «it»''', trace.TypeofEClass(targetType))].toList + And(targets.map[IsInReference(trace, source, it, reference)]) => ! Distinct(targets) + ]) + val annotation = createUpperMultiplicityAssertion => [ + it.upper = upper + it.relation = trace.referenceMapperTrace.asTrace.indicators.get(reference) + ] + + problem.add(assertion) + problem.annotations += annotation + assertion.annotations += annotation + trace.referenceMapperTrace.asTrace.lowerMultiplicity.put(reference,assertion) + } + else trace.referenceMapperTrace.asTrace.upperMultiplicity.put(reference,null) + } + } + + def createInverseReferenceConstraints(Ecore2Logic_Trace trace, LogicProblem problem, Iterable references) { + trace.referenceMapperTrace.asTrace.inverseEdges = new HashMap + for(reference : references) { + if(reference.EOpposite!=null) { + val opposite = reference.EOpposite + if(trace.referenceMapperTrace.asTrace.inverseEdges.containsKey(opposite)) { + trace.referenceMapperTrace.asTrace.inverseEdges.put(reference,trace.referenceMapperTrace.asTrace.inverseEdges.get(opposite)) + } else { + val sourceType = reference.EContainingClass + val targetType = reference.EType as EClass + val assertion = Assertion('''oppositeReference «reference.name» «sourceType.name»''', + Forall[ + val src = addVar('''src''', trace.TypeofEClass(sourceType)) + val trg = addVar('''trg''', trace.TypeofEClass(targetType)) + IsInReference(trace,src,trg,reference) <=> IsInReference(trace,trg,src,opposite) + ] + ) + problem.add(assertion) + trace.referenceMapperTrace.asTrace.inverseEdges.put(reference,assertion) + val annotation = createInverseRelationAssertion => [ + it.target = assertion + it.inverseA = trace.referenceMapperTrace.asTrace.indicators.get(reference) + it.inverseB = trace.referenceMapperTrace.asTrace.indicators.get(reference.EOpposite) + ] + problem.annotations += annotation + } + } + else trace.referenceMapperTrace.asTrace.inverseEdges.put(reference,null) + } + } + + override IsInReference(Ecore2Logic_Trace trace, TermDescription source, TermDescription target, EReference type) { + trace.referenceMapperTrace.asTrace.indicators.get(type).call(source,target) + } + + override relationOfReference(Ecore2Logic_Trace trace, EReference reference) { + trace.referenceMapperTrace.asTrace.indicators.get(reference) + } +} \ No newline at end of file diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/Ecore2Logic.xtend b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/Ecore2Logic.xtend new file mode 100644 index 00000000..cae489e3 --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/Ecore2Logic.xtend @@ -0,0 +1,98 @@ +package hu.bme.mit.inf.dslreasoner.ecore2logic + +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem +import java.util.List +import org.eclipse.emf.ecore.EAttribute +import org.eclipse.emf.ecore.EClass +import org.eclipse.emf.ecore.EEnum +import org.eclipse.emf.ecore.EEnumLiteral +import org.eclipse.emf.ecore.EReference +import org.eclipse.xtend.lib.annotations.Data +import org.eclipse.xtend.lib.annotations.Delegate +import hu.bme.mit.inf.dslreasoner.logic.model.builder.TracedOutput +import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicProblemBuilder +import java.util.Set +import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.ContainmentHierarchy + +@Data class EcoreMetamodelDescriptor { + val List classes; + val Set concretised; + val boolean isEObjectConcretised; + val List enums; + val List literals; + val List references; + val List attributes; + + def isConcretised(EClass clazz) {concretised.contains(clazz)} +} + +interface Trace {} + +class Ecore2Logic_Trace implements Trace { + public var ContainmentHierarchy containmentHierarchy; + public var Trace classMapperTrace + public var Trace enumMapperTrace + public var Trace referenceMapperTrace + public var Trace containmentMapperTrace + public var Trace attributeMapperTrace +} + +class Ecore2LogicConfiguration { + var public boolean singleRoot = true + var public int numberOfObjects = -1 + public static val Undefined = -1 +} + +class Ecore2LogicScope { + public static val int Unlimited = -1 + public var numberOfObjects = Unlimited +} + +class Ecore2Logic implements EClassMapper, EEnumMapper, EReferenceMapper, ContainmentMapper, EAttributeMapper { + @Delegate protected val EClassMapper classMapper + @Delegate protected val EEnumMapper enumMapper + @Delegate protected val EReferenceMapper referenceMapper + @Delegate protected val ContainmentMapper containmentMapper + @Delegate protected val EAttributeMapper attributeMapper + + public new() { + this.classMapper = new EClassMapper_AllElementAsObject + this.enumMapper = new EEnumMapper_PredefinedClasses + this.referenceMapper = new EReferenceMapper_RelationsOverTypes(this.classMapper) + this.containmentMapper = new ContainmentMapper_ReferenceConjuction(this.classMapper, this.referenceMapper,0) + this.attributeMapper = new EAttributeMapper_RelationsOverTypes(this.classMapper, this.enumMapper) + } + + public new( + EClassMapper classMapper, + EEnumMapper enumMapper, + EReferenceMapper referenceMapper, + ContainmentMapper containmentMapper, + EAttributeMapper attributeMapper) + { + if(classMapper === null || enumMapper === null || referenceMapper === null || containmentMapper === null || + attributeMapper === null) { + throw new IllegalArgumentException('''The mappers should not be null!''') + } + + this.classMapper = classMapper + this.enumMapper = enumMapper + this.referenceMapper = referenceMapper + this.containmentMapper = containmentMapper + this.attributeMapper = attributeMapper + } + + def public TracedOutput transformMetamodel(EcoreMetamodelDescriptor metamodel, Ecore2LogicConfiguration config) { + + + val Ecore2Logic_Trace trace = new Ecore2Logic_Trace + val LogicProblem problem = (new LogicProblemBuilder).createProblem + transformEClasses(trace,problem,metamodel.classes,config.numberOfObjects,metamodel) + transformEEnums(trace,problem,metamodel.enums,config) + transformEReferences(trace,problem,metamodel.references) + transformContainment(trace,problem,metamodel.references, config.singleRoot) + transformEAttributes(trace,problem,metamodel.attributes) + + return new TracedOutput(problem,trace) + } +} -- cgit v1.2.3-70-g09d2