From 6bd475a3eced9d9a912f76e24f91d2ad8da13d54 Mon Sep 17 00:00:00 2001 From: OszkarSemerath Date: Mon, 25 Jun 2018 00:16:48 +0200 Subject: Fixing multiple true/false + bug preventing generation without PS --- .../logic2viatra/patterns/GenericTypeIndexer.xtend | 7 ++ .../patterns/GenericTypeRefinementGenerator.xtend | 10 +-- .../logic2viatra/patterns/PatternGenerator.xtend | 26 +++---- .../logic2viatra/patterns/TypeIndexer.xtend | 14 ++++ .../TypeIndexerWithPreliminaryTypeAnalysis.xtend | 26 ++++--- ...TypeRefinementWithPreliminaryTypeAnalysis.xtend | 11 +-- .../PartialTypeInterpratation.java | 19 +++++ .../PartialinterpretationPackage.java | 84 +++++++++++++++++++++- .../partialinterpretation/Scope.java | 4 +- .../impl/PartialTypeInterpratationImpl.java | 68 ++++++++++++++++++ .../impl/PartialinterpretationPackageImpl.java | 13 +++- .../partialinterpretation/impl/ScopeImpl.java | 59 ++++++++++++++- .../model/PartialInterpretation.aird | 61 ++++++++-------- .../model/PartialInterpretation.ecore | 4 +- .../viatrasolver/reasoner/ViatraReasoner.xtend | 5 +- .../dse/BestFirstStrategyForModelGeneration.java | 35 ++++++--- 16 files changed, 363 insertions(+), 83 deletions(-) (limited to 'Solvers/VIATRA-Solver') diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeIndexer.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeIndexer.xtend index 2dae95be..dce04a7f 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeIndexer.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeIndexer.xtend @@ -80,6 +80,11 @@ class GenericTypeIndexer extends TypeIndexer { Type.isAbstract(dynamic,false); } + + private pattern isPrimitive(element: PrimitiveElement) { + PrimitiveElement(element); + } + private pattern possibleDynamicType(problem: LogicProblem, interpretation:PartialInterpretation, dynamic:Type, element:DefinedElement) // case 1: element is defined at least once { @@ -94,6 +99,8 @@ class GenericTypeIndexer extends TypeIndexer { neg find dynamicTypeIsSubtypeOfANonDefinition(problem,interpretation,element,dynamic); // 4: T is not abstract Type.isAbstract(dynamic,false); + // 5. element is not primitive datatype + neg find isPrimitive(element); } or // case 2: element is not defined anywhere { diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeRefinementGenerator.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeRefinementGenerator.xtend index 1aa3b955..2e03d6ed 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeRefinementGenerator.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeRefinementGenerator.xtend @@ -28,7 +28,7 @@ class GenericTypeRefinementGenerator extends TypeRefinementGenerator { private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) «FOR type :containment.typesOrderedInHierarchy SEPARATOR "or"»{ find interpretation(problem,interpretation); - «base.typeIndexer.referInstanceOf(type,Modality.MAY,"root")» + «base.typeIndexer.referInstanceOf(type,Modality.MUST,"root")» find mustExist(problem, interpretation, root); }«ENDFOR» «FOR type:newObjectTypes» @@ -37,7 +37,7 @@ class GenericTypeRefinementGenerator extends TypeRefinementGenerator { «IF inverseRelations.containsKey(containmentRelation)» pattern «this.patternName(containmentRelation,inverseRelations.get(containmentRelation),type)»( problem:LogicProblem, interpretation:PartialInterpretation, - relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation ,typeInterpretation:PartialTypeInterpratation, + relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation ,typeInterpretation:PartialComplexTypeInterpretation, container:DefinedElement) { find interpretation(problem,interpretation); @@ -56,7 +56,7 @@ class GenericTypeRefinementGenerator extends TypeRefinementGenerator { «ELSE» pattern «this.patternName(containmentRelation,null,type)»( problem:LogicProblem, interpretation:PartialInterpretation, - relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialTypeInterpratation, + relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, container:DefinedElement) { find interpretation(problem,interpretation); @@ -74,7 +74,7 @@ class GenericTypeRefinementGenerator extends TypeRefinementGenerator { «ENDFOR» pattern «patternName(null,null,type)»( problem:LogicProblem, interpretation:PartialInterpretation, - typeInterpretation:PartialTypeInterpratation) + typeInterpretation:PartialComplexTypeInterpretation) { find interpretation(problem,interpretation); neg find hasElementInContainment(problem,interpretation); @@ -87,7 +87,7 @@ class GenericTypeRefinementGenerator extends TypeRefinementGenerator { «ELSE» pattern createObject_«this.patternName(null,null,type)»( problem:LogicProblem, interpretation:PartialInterpretation, - typeInterpretation:PartialTypeInterpratation) + typeInterpretation:PartialComplexTypeInterpretation) { find interpretation(problem,interpretation); PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend index 001ff13f..0fed5c76 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend @@ -163,35 +163,35 @@ class PatternGenerator { ////////// // 0. Util ////////// - private pattern interpretation(problem:LogicProblem, interpetation:PartialInterpretation) { - PartialInterpretation.problem(interpetation,problem); + private pattern interpretation(problem:LogicProblem, interpretation:PartialInterpretation) { + PartialInterpretation.problem(interpretation,problem); } ///////////////////////// // 0.1 Existence ///////////////////////// - private pattern mustExist(problem:LogicProblem, interpetation:PartialInterpretation, element:DefinedElement) { - find interpretation(problem,interpetation); + private pattern mustExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { + find interpretation(problem,interpretation); LogicProblem.elements(problem,element); } or { - find interpretation(problem,interpetation); - PartialInterpretation.newElements(interpetation,element); + find interpretation(problem,interpretation); + PartialInterpretation.newElements(interpretation,element); } - private pattern mayExist(problem:LogicProblem, interpetation:PartialInterpretation, element:DefinedElement) { - find mustExist(problem,interpetation,element); + private pattern mayExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { + find mustExist(problem,interpretation,element); } or { - find interpretation(problem,interpetation); - neg find elementCloseWorld(interpetation); - PartialInterpretation.openWorldElements(interpetation,element); + find interpretation(problem,interpretation); + neg find elementCloseWorld(element); + PartialInterpretation.openWorldElements(interpretation,element); } private pattern elementCloseWorld(element:DefinedElement) { PartialInterpretation.newElements(i,element); PartialInterpretation.maxNewElements(i,0); } or { - Scope.targetTypeInterpretation(scope,interpetation); - PartialTypeInterpratation.elements(interpetation,element); + Scope.targetTypeInterpretation(scope,interpretation); + PartialTypeInterpratation.elements(interpretation,element); Scope.maxNewElements(scope,0); } diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeIndexer.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeIndexer.xtend index 630fad51..d1d57189 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeIndexer.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeIndexer.xtend @@ -11,6 +11,7 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.BoolTypeReference import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.IntTypeReference import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RealTypeReference import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.StringTypeReference +import java.math.BigDecimal abstract class TypeIndexer { public def CharSequence getRequiredQueries() @@ -34,5 +35,18 @@ abstract class TypeIndexer { public def dispatch CharSequence referInstanceOfByReference(StringTypeReference reference, Modality modality, String variableName) { '''StringElement(«variableName»);''' } + public def dispatch CharSequence referPrimitiveValue(String variableName, Boolean value) { + '''BooleanElement.value(«variableName»,«value»);''' + } + public def dispatch CharSequence referPrimitiveValue(String variableName, Integer value) { + '''IntegerElement.value(«variableName»,«value»);''' + } + public def dispatch CharSequence referPrimitiveValue(String variableName, BigDecimal value) { + '''RealElement.value(«variableName»,«value»);''' + } + ///TODO: de-escaping string literals + public def dispatch CharSequence referPrimitiveValue(String variableName, String value) { + '''StringElement.value(«variableName»,"«value»");''' + } } \ No newline at end of file diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeIndexerWithPreliminaryTypeAnalysis.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeIndexerWithPreliminaryTypeAnalysis.xtend index 7bdb9a5b..fde5f4b6 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeIndexerWithPreliminaryTypeAnalysis.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeIndexerWithPreliminaryTypeAnalysis.xtend @@ -4,10 +4,9 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.Modality import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.TypeAnalysisResult +import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.TypeRefinementPrecondition import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation import org.eclipse.emf.ecore.EClass -import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.TypeRefinementPrecondition -import java.util.Collections class TypeIndexerWithPreliminaryTypeAnalysis extends TypeIndexer{ val PatternGenerator base; @@ -18,22 +17,26 @@ class TypeIndexerWithPreliminaryTypeAnalysis extends TypeIndexer{ override requiresTypeAnalysis() { true } override getRequiredQueries() ''' - private pattern typeInterpretation(problem:LogicProblem, interpetation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { - find interpretation(problem,interpetation); + private pattern typeInterpretation(problem:LogicProblem, interpretation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { + find interpretation(problem,interpretation); LogicProblem.types(problem,type); - PartialInterpretation.partialtypeinterpratation(interpetation,typeInterpretation); + PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); } - private pattern directInstanceOf(problem:LogicProblem, interpetation:PartialInterpretation, element:DefinedElement, type:Type) { - find interpretation(problem,interpetation); + private pattern directInstanceOf(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement, type:Type) { + find interpretation(problem,interpretation); LogicProblem.types(problem,type); TypeDefinition.elements(type,element); } or { - find interpretation(problem,interpetation); - find typeInterpretation(problem,interpetation,type,typeInterpretation); + find interpretation(problem,interpretation); + find typeInterpretation(problem,interpretation,type,typeInterpretation); PartialComplexTypeInterpretation.elements(typeInterpretation,element); } + + private pattern isPrimitive(element: PrimitiveElement) { + PrimitiveElement(element); + } ''' override generateInstanceOfQueries(LogicProblem problem, PartialInterpretation emptySolution, TypeAnalysisResult typeAnalysisResult) { @@ -73,15 +76,16 @@ class TypeIndexerWithPreliminaryTypeAnalysis extends TypeIndexer{ * An element may be an instance of type "«type.name»". */ private pattern «patternName(type,Modality.MAY)»(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) - «IF inhibitorTypes != null»{ + «IF inhibitorTypes !== null»{ find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); «FOR inhibitorType : inhibitorTypes» neg «referInstanceOf(inhibitorType,Modality.MUST,"element")» «ENDFOR» + neg find isPrimitive(element); } or { find interpretation(problem,interpretation); - PartialInterpretation.openWorldElements(interpetation,element); + PartialInterpretation.openWorldElements(interpretation,element); } or «ENDIF» { «referInstanceOf(type,Modality.MUST,"element")» } diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeRefinementWithPreliminaryTypeAnalysis.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeRefinementWithPreliminaryTypeAnalysis.xtend index 7c5f507b..cbbbcb08 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeRefinementWithPreliminaryTypeAnalysis.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeRefinementWithPreliminaryTypeAnalysis.xtend @@ -27,7 +27,7 @@ class TypeRefinementWithPreliminaryTypeAnalysis extends TypeRefinementGenerator{ private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) «FOR type :containment.typesOrderedInHierarchy SEPARATOR "or"»{ find interpretation(problem,interpretation); - «base.typeIndexer.referInstanceOf(type,Modality.MAY,"root")» + «base.typeIndexer.referInstanceOf(type,Modality.MUST,"root")» find mustExist(problem, interpretation, root); }«ENDFOR» «FOR type:possibleNewDynamicType» @@ -36,7 +36,7 @@ class TypeRefinementWithPreliminaryTypeAnalysis extends TypeRefinementGenerator{ «IF inverseRelations.containsKey(containmentRelation)» pattern «this.patternName(containmentRelation,inverseRelations.get(containmentRelation),type)»( problem:LogicProblem, interpretation:PartialInterpretation, - relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialTypeInterpratation, + relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, container:DefinedElement) { find interpretation(problem,interpretation); @@ -55,7 +55,7 @@ class TypeRefinementWithPreliminaryTypeAnalysis extends TypeRefinementGenerator{ «ELSE» pattern «this.patternName(containmentRelation,null,type)»( problem:LogicProblem, interpretation:PartialInterpretation, - relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialTypeInterpratation, + relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, container:DefinedElement) { find interpretation(problem,interpretation); @@ -73,7 +73,7 @@ class TypeRefinementWithPreliminaryTypeAnalysis extends TypeRefinementGenerator{ «ENDFOR» pattern «patternName(null,null,type)»( problem:LogicProblem, interpretation:PartialInterpretation, - typeInterpretation:PartialTypeInterpratation) + typeInterpretation:PartialComplexTypeInterpretation) { find interpretation(problem,interpretation); neg find hasElementInContainment(problem,interpretation); @@ -86,7 +86,7 @@ class TypeRefinementWithPreliminaryTypeAnalysis extends TypeRefinementGenerator{ «ELSE» pattern «this.patternName(null,null,type)»( problem:LogicProblem, interpretation:PartialInterpretation, - typeInterpretation:PartialTypeInterpratation) + typeInterpretation:PartialComplexTypeInterpretation) { find interpretation(problem,interpretation); PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); @@ -107,6 +107,7 @@ class TypeRefinementWithPreliminaryTypeAnalysis extends TypeRefinementGenerator{ pattern refineTypeTo_«base.canonizeName(newTypeRefinement.targetType.name)»(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); + «base.typeIndexer.referInstanceOf(newTypeRefinement.targetType,Modality.MAY,"element")» «FOR inhibitorType : newTypeRefinement.inhibitorTypes» neg «base.typeIndexer.referInstanceOf(inhibitorType,Modality.MUST,"element")» «ENDFOR» diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/PartialTypeInterpratation.java b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/PartialTypeInterpratation.java index 8e2def20..1d61421b 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/PartialTypeInterpratation.java +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/PartialTypeInterpratation.java @@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.EObject; *

* * * @see hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialinterpretationPackage#getPartialTypeInterpratation() @@ -39,4 +40,22 @@ public interface PartialTypeInterpratation extends EObject { */ EList getElements(); + /** + * Returns the value of the 'Scopes' reference list. + * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.Scope}. + * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.Scope#getTargetTypeInterpretation Target Type Interpretation}'. + * + *

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

+ * + * @return the value of the 'Scopes' reference list. + * @see hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialinterpretationPackage#getPartialTypeInterpratation_Scopes() + * @see hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.Scope#getTargetTypeInterpretation + * @model opposite="targetTypeInterpretation" + * @generated + */ + EList getScopes(); + } // PartialTypeInterpratation diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/PartialinterpretationPackage.java b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/PartialinterpretationPackage.java index ba04bca8..4f34b9b7 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/PartialinterpretationPackage.java +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/PartialinterpretationPackage.java @@ -341,6 +341,15 @@ public interface PartialinterpretationPackage extends EPackage { */ int PARTIAL_TYPE_INTERPRATATION__ELEMENTS = 0; + /** + * The feature id for the 'Scopes' reference list. + * + * + * @generated + * @ordered + */ + int PARTIAL_TYPE_INTERPRATATION__SCOPES = 1; + /** * The number of structural features of the 'Partial Type Interpratation' class. * @@ -348,7 +357,7 @@ public interface PartialinterpretationPackage extends EPackage { * @generated * @ordered */ - int PARTIAL_TYPE_INTERPRATATION_FEATURE_COUNT = 1; + int PARTIAL_TYPE_INTERPRATATION_FEATURE_COUNT = 2; /** * The number of operations of the 'Partial Type Interpratation' class. @@ -940,6 +949,15 @@ public interface PartialinterpretationPackage extends EPackage { */ int PARTIAL_PRIMITIVE_INTERPRETATION__ELEMENTS = PARTIAL_TYPE_INTERPRATATION__ELEMENTS; + /** + * The feature id for the 'Scopes' reference list. + * + * + * @generated + * @ordered + */ + int PARTIAL_PRIMITIVE_INTERPRETATION__SCOPES = PARTIAL_TYPE_INTERPRATATION__SCOPES; + /** * The number of structural features of the 'Partial Primitive Interpretation' class. * @@ -977,6 +995,15 @@ public interface PartialinterpretationPackage extends EPackage { */ int PARTIAL_BOOLEAN_INTERPRETATION__ELEMENTS = PARTIAL_PRIMITIVE_INTERPRETATION__ELEMENTS; + /** + * The feature id for the 'Scopes' reference list. + * + * + * @generated + * @ordered + */ + int PARTIAL_BOOLEAN_INTERPRETATION__SCOPES = PARTIAL_PRIMITIVE_INTERPRETATION__SCOPES; + /** * The number of structural features of the 'Partial Boolean Interpretation' class. * @@ -1014,6 +1041,15 @@ public interface PartialinterpretationPackage extends EPackage { */ int PARTIAL_INTEGER_INTERPRETATION__ELEMENTS = PARTIAL_PRIMITIVE_INTERPRETATION__ELEMENTS; + /** + * The feature id for the 'Scopes' reference list. + * + * + * @generated + * @ordered + */ + int PARTIAL_INTEGER_INTERPRETATION__SCOPES = PARTIAL_PRIMITIVE_INTERPRETATION__SCOPES; + /** * The number of structural features of the 'Partial Integer Interpretation' class. * @@ -1051,6 +1087,15 @@ public interface PartialinterpretationPackage extends EPackage { */ int PARTIAL_REAL_INTERPRETATION__ELEMENTS = PARTIAL_PRIMITIVE_INTERPRETATION__ELEMENTS; + /** + * The feature id for the 'Scopes' reference list. + * + * + * @generated + * @ordered + */ + int PARTIAL_REAL_INTERPRETATION__SCOPES = PARTIAL_PRIMITIVE_INTERPRETATION__SCOPES; + /** * The number of structural features of the 'Partial Real Interpretation' class. * @@ -1088,6 +1133,15 @@ public interface PartialinterpretationPackage extends EPackage { */ int PARTIAL_STRING_INTERPRETATION__ELEMENTS = PARTIAL_PRIMITIVE_INTERPRETATION__ELEMENTS; + /** + * The feature id for the 'Scopes' reference list. + * + * + * @generated + * @ordered + */ + int PARTIAL_STRING_INTERPRETATION__SCOPES = PARTIAL_PRIMITIVE_INTERPRETATION__SCOPES; + /** * The number of structural features of the 'Partial String Interpretation' class. * @@ -1126,6 +1180,15 @@ public interface PartialinterpretationPackage extends EPackage { */ int PARTIAL_COMPLEX_TYPE_INTERPRETATION__ELEMENTS = PARTIAL_TYPE_INTERPRATATION__ELEMENTS; + /** + * The feature id for the 'Scopes' reference list. + * + * + * @generated + * @ordered + */ + int PARTIAL_COMPLEX_TYPE_INTERPRETATION__SCOPES = PARTIAL_TYPE_INTERPRATATION__SCOPES; + /** * The feature id for the 'Supertype Interpretation' reference list. * @@ -1411,6 +1474,17 @@ public interface PartialinterpretationPackage extends EPackage { */ EReference getPartialTypeInterpratation_Elements(); + /** + * Returns the meta object for the reference list '{@link hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialTypeInterpratation#getScopes Scopes}'. + * + * + * @return the meta object for the reference list 'Scopes'. + * @see hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialTypeInterpratation#getScopes() + * @see #getPartialTypeInterpratation() + * @generated + */ + EReference getPartialTypeInterpratation_Scopes(); + /** * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.RelationLink Relation Link}'. * @@ -1974,6 +2048,14 @@ public interface PartialinterpretationPackage extends EPackage { */ EReference PARTIAL_TYPE_INTERPRATATION__ELEMENTS = eINSTANCE.getPartialTypeInterpratation_Elements(); + /** + * The meta object literal for the 'Scopes' reference list feature. + * + * + * @generated + */ + EReference PARTIAL_TYPE_INTERPRATATION__SCOPES = eINSTANCE.getPartialTypeInterpratation_Scopes(); + /** * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.impl.RelationLinkImpl Relation Link}' class. * diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/Scope.java b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/Scope.java index ba9435c2..155b9f00 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/Scope.java +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/Scope.java @@ -79,6 +79,7 @@ public interface Scope extends EObject { /** * Returns the value of the 'Target Type Interpretation' reference. + * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialTypeInterpratation#getScopes Scopes}'. * *

* If the meaning of the 'Target Type Interpretation' reference isn't clear, @@ -88,7 +89,8 @@ public interface Scope extends EObject { * @return the value of the 'Target Type Interpretation' reference. * @see #setTargetTypeInterpretation(PartialTypeInterpratation) * @see hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialinterpretationPackage#getScope_TargetTypeInterpretation() - * @model required="true" + * @see hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialTypeInterpratation#getScopes + * @model opposite="scopes" required="true" * @generated */ PartialTypeInterpratation getTargetTypeInterpretation(); diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/impl/PartialTypeInterpratationImpl.java b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/impl/PartialTypeInterpratationImpl.java index beb45529..da9b1472 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/impl/PartialTypeInterpratationImpl.java +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/impl/PartialTypeInterpratationImpl.java @@ -6,11 +6,16 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.DefinedElement; import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialTypeInterpratation; import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialinterpretationPackage; +import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.Scope; import java.util.Collection; +import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; /** * @@ -21,6 +26,7 @@ import org.eclipse.emf.ecore.util.EObjectResolvingEList; *

*
    *
  • {@link hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.impl.PartialTypeInterpratationImpl#getElements Elements}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.impl.PartialTypeInterpratationImpl#getScopes Scopes}
  • *
* * @generated @@ -36,6 +42,16 @@ public abstract class PartialTypeInterpratationImpl extends MinimalEObjectImpl.C */ protected EList elements; + /** + * The cached value of the '{@link #getScopes() Scopes}' reference list. + * + * + * @see #getScopes() + * @generated + * @ordered + */ + protected EList scopes; + /** * * @@ -67,6 +83,47 @@ public abstract class PartialTypeInterpratationImpl extends MinimalEObjectImpl.C return elements; } + /** + * + * + * @generated + */ + public EList getScopes() { + if (scopes == null) { + scopes = new EObjectWithInverseResolvingEList(Scope.class, this, PartialinterpretationPackage.PARTIAL_TYPE_INTERPRATATION__SCOPES, PartialinterpretationPackage.SCOPE__TARGET_TYPE_INTERPRETATION); + } + return scopes; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PartialinterpretationPackage.PARTIAL_TYPE_INTERPRATATION__SCOPES: + return ((InternalEList)(InternalEList)getScopes()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PartialinterpretationPackage.PARTIAL_TYPE_INTERPRATATION__SCOPES: + return ((InternalEList)getScopes()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + /** * * @@ -77,6 +134,8 @@ public abstract class PartialTypeInterpratationImpl extends MinimalEObjectImpl.C switch (featureID) { case PartialinterpretationPackage.PARTIAL_TYPE_INTERPRATATION__ELEMENTS: return getElements(); + case PartialinterpretationPackage.PARTIAL_TYPE_INTERPRATATION__SCOPES: + return getScopes(); } return super.eGet(featureID, resolve, coreType); } @@ -94,6 +153,10 @@ public abstract class PartialTypeInterpratationImpl extends MinimalEObjectImpl.C getElements().clear(); getElements().addAll((Collection)newValue); return; + case PartialinterpretationPackage.PARTIAL_TYPE_INTERPRATATION__SCOPES: + getScopes().clear(); + getScopes().addAll((Collection)newValue); + return; } super.eSet(featureID, newValue); } @@ -109,6 +172,9 @@ public abstract class PartialTypeInterpratationImpl extends MinimalEObjectImpl.C case PartialinterpretationPackage.PARTIAL_TYPE_INTERPRATATION__ELEMENTS: getElements().clear(); return; + case PartialinterpretationPackage.PARTIAL_TYPE_INTERPRATATION__SCOPES: + getScopes().clear(); + return; } super.eUnset(featureID); } @@ -123,6 +189,8 @@ public abstract class PartialTypeInterpratationImpl extends MinimalEObjectImpl.C switch (featureID) { case PartialinterpretationPackage.PARTIAL_TYPE_INTERPRATATION__ELEMENTS: return elements != null && !elements.isEmpty(); + case PartialinterpretationPackage.PARTIAL_TYPE_INTERPRATATION__SCOPES: + return scopes != null && !scopes.isEmpty(); } return super.eIsSet(featureID); } diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/impl/PartialinterpretationPackageImpl.java b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/impl/PartialinterpretationPackageImpl.java index c0515c43..a21dc306 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/impl/PartialinterpretationPackageImpl.java +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/impl/PartialinterpretationPackageImpl.java @@ -471,6 +471,15 @@ public class PartialinterpretationPackageImpl extends EPackageImpl implements Pa return (EReference)partialTypeInterpratationEClass.getEStructuralFeatures().get(0); } + /** + * + * + * @generated + */ + public EReference getPartialTypeInterpratation_Scopes() { + return (EReference)partialTypeInterpratationEClass.getEStructuralFeatures().get(1); + } + /** * * @@ -823,6 +832,7 @@ public class PartialinterpretationPackageImpl extends EPackageImpl implements Pa partialTypeInterpratationEClass = createEClass(PARTIAL_TYPE_INTERPRATATION); createEReference(partialTypeInterpratationEClass, PARTIAL_TYPE_INTERPRATATION__ELEMENTS); + createEReference(partialTypeInterpratationEClass, PARTIAL_TYPE_INTERPRATATION__SCOPES); relationLinkEClass = createEClass(RELATION_LINK); @@ -950,6 +960,7 @@ public class PartialinterpretationPackageImpl extends EPackageImpl implements Pa initEClass(partialTypeInterpratationEClass, PartialTypeInterpratation.class, "PartialTypeInterpratation", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getPartialTypeInterpratation_Elements(), theLogiclanguagePackage.getDefinedElement(), null, "elements", null, 0, -1, PartialTypeInterpratation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getPartialTypeInterpratation_Scopes(), this.getScope(), this.getScope_TargetTypeInterpretation(), "scopes", null, 0, -1, PartialTypeInterpratation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(relationLinkEClass, RelationLink.class, "RelationLink", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -985,7 +996,7 @@ public class PartialinterpretationPackageImpl extends EPackageImpl implements Pa initEClass(scopeEClass, Scope.class, "Scope", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getScope_MinNewElements(), ecorePackage.getEInt(), "minNewElements", "0", 1, 1, Scope.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getScope_MaxNewElements(), ecorePackage.getEInt(), "maxNewElements", "-1", 1, 1, Scope.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getScope_TargetTypeInterpretation(), this.getPartialTypeInterpratation(), null, "targetTypeInterpretation", null, 1, 1, Scope.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getScope_TargetTypeInterpretation(), this.getPartialTypeInterpratation(), this.getPartialTypeInterpratation_Scopes(), "targetTypeInterpretation", null, 1, 1, Scope.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(partialPrimitiveInterpretationEClass, PartialPrimitiveInterpretation.class, "PartialPrimitiveInterpretation", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/impl/ScopeImpl.java b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/impl/ScopeImpl.java index 4699aef6..d8ade871 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/impl/ScopeImpl.java +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/ecore-gen/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/partialinterpretation/impl/ScopeImpl.java @@ -8,6 +8,7 @@ import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.par import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; @@ -172,11 +173,63 @@ public class ScopeImpl extends MinimalEObjectImpl.Container implements Scope { * * @generated */ - public void setTargetTypeInterpretation(PartialTypeInterpratation newTargetTypeInterpretation) { + public NotificationChain basicSetTargetTypeInterpretation(PartialTypeInterpratation newTargetTypeInterpretation, NotificationChain msgs) { PartialTypeInterpratation oldTargetTypeInterpretation = targetTypeInterpretation; targetTypeInterpretation = newTargetTypeInterpretation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PartialinterpretationPackage.SCOPE__TARGET_TYPE_INTERPRETATION, oldTargetTypeInterpretation, targetTypeInterpretation)); + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PartialinterpretationPackage.SCOPE__TARGET_TYPE_INTERPRETATION, oldTargetTypeInterpretation, newTargetTypeInterpretation); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setTargetTypeInterpretation(PartialTypeInterpratation newTargetTypeInterpretation) { + if (newTargetTypeInterpretation != targetTypeInterpretation) { + NotificationChain msgs = null; + if (targetTypeInterpretation != null) + msgs = ((InternalEObject)targetTypeInterpretation).eInverseRemove(this, PartialinterpretationPackage.PARTIAL_TYPE_INTERPRATATION__SCOPES, PartialTypeInterpratation.class, msgs); + if (newTargetTypeInterpretation != null) + msgs = ((InternalEObject)newTargetTypeInterpretation).eInverseAdd(this, PartialinterpretationPackage.PARTIAL_TYPE_INTERPRATATION__SCOPES, PartialTypeInterpratation.class, msgs); + msgs = basicSetTargetTypeInterpretation(newTargetTypeInterpretation, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PartialinterpretationPackage.SCOPE__TARGET_TYPE_INTERPRETATION, newTargetTypeInterpretation, newTargetTypeInterpretation)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PartialinterpretationPackage.SCOPE__TARGET_TYPE_INTERPRETATION: + if (targetTypeInterpretation != null) + msgs = ((InternalEObject)targetTypeInterpretation).eInverseRemove(this, PartialinterpretationPackage.PARTIAL_TYPE_INTERPRATATION__SCOPES, PartialTypeInterpratation.class, msgs); + return basicSetTargetTypeInterpretation((PartialTypeInterpratation)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PartialinterpretationPackage.SCOPE__TARGET_TYPE_INTERPRETATION: + return basicSetTargetTypeInterpretation(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); } /** diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/model/PartialInterpretation.aird b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/model/PartialInterpretation.aird index 7fba84f6..f2a97719 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/model/PartialInterpretation.aird +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/model/PartialInterpretation.aird @@ -2873,22 +2873,6 @@ - - - - - - - - - - - - - - - - @@ -3057,6 +3041,22 @@ + + + + + + + + + + + + + + + + @@ -3337,7 +3337,7 @@ - + KEEP_LOCATION @@ -3584,7 +3584,7 @@ - + KEEP_LOCATION @@ -3612,20 +3612,6 @@ - - - - - - labelSize - bold - - - labelSize - - - - @@ -3778,6 +3764,17 @@ + + + + + + + + + + + diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/model/PartialInterpretation.ecore b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/model/PartialInterpretation.ecore index afee2d42..acf82a3f 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/model/PartialInterpretation.ecore +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/model/PartialInterpretation.ecore @@ -47,6 +47,8 @@ + @@ -89,7 +91,7 @@ + lowerBound="1" eType="#//PartialTypeInterpratation" eOpposite="#//PartialTypeInterpratation/scopes"/> diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend index 45379e36..378adf65 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend @@ -1,5 +1,6 @@ package hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner +import hu.bme.mit.inf.dslreasoner.logic.model.builder.DocumentationLevel import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicReasoner import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicReasonerException import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicSolverConfiguration @@ -29,7 +30,6 @@ import org.eclipse.viatra.dse.api.DesignSpaceExplorer import org.eclipse.viatra.dse.api.DesignSpaceExplorer.DseLoggingLevel import org.eclipse.viatra.dse.solutionstore.SolutionStore import org.eclipse.viatra.dse.statecode.IStateCoderFactory -import javax.security.auth.login.Configuration.Parameters class ViatraReasoner extends LogicReasoner{ val PartialInterpretationInitialiser initialiser = new PartialInterpretationInitialiser() @@ -56,6 +56,9 @@ class ViatraReasoner extends LogicReasoner{ val transformationStartTime = System.nanoTime val emptySolution = initialiser.initialisePartialInterpretation(problem,viatraConfig.typeScopes).output + if(viatraConfig.documentationLevel == DocumentationLevel::FULL && workspace !== null) { + workspace.writeModel(emptySolution,"init.partialmodel") + } emptySolution.problemConainer = problem val method = modelGenerationMethodProvider.createModelGenerationMethod( diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/BestFirstStrategyForModelGeneration.java b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/BestFirstStrategyForModelGeneration.java index 7862262b..effc37f8 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/BestFirstStrategyForModelGeneration.java +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/BestFirstStrategyForModelGeneration.java @@ -32,6 +32,7 @@ import org.eclipse.viatra.query.runtime.api.IQuerySpecification; import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; +import hu.bme.mit.inf.dslreasoner.logic.model.builder.DocumentationLevel; import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicReasoner; import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem; import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.InconsistencyResult; @@ -113,12 +114,12 @@ public class BestFirstStrategyForModelGeneration implements IStrategy { ViatraQueryEngine engine = context.getQueryEngine(); // // TODO: visualisation -// matchers = new LinkedList>(); -// for(IQuerySpecification> p : this.method.getAllPatterns()) { -// System.out.println(p.getSimpleName()); -// ViatraQueryMatcher matcher = p.getMatcher(engine); -// matchers.add(matcher); -// } + matchers = new LinkedList>(); + for(IQuerySpecification> p : this.method.getAllPatterns()) { + //System.out.println(p.getSimpleName()); + ViatraQueryMatcher matcher = p.getMatcher(engine); + matchers.add(matcher); + } this.solutionStoreWithCopy = new SolutionStoreWithCopy(); this.solutionStoreWithDiversityDescriptor = new SolutionStoreWithDiversityDescriptor(configuration.diversityRequirement); @@ -152,7 +153,18 @@ public class BestFirstStrategyForModelGeneration implements IStrategy { final Object[] firstTrajectory = context.getTrajectory().toArray(new Object[0]); TrajectoryWithFitness currentTrajectoryWithFittness = new TrajectoryWithFitness(firstTrajectory, firstFittness); trajectoiresToExplore.add(currentTrajectoryWithFittness); - + + //if(configuration) + visualiseCurrentState(); +// for(ViatraQueryMatcher matcher : matchers) { +// System.out.println(matcher.getPatternName()); +// System.out.println("---------"); +// for(IPatternMatch m : matcher.getAllMatches()) { +// System.out.println(m); +// } +// System.out.println("---------"); +// } + mainLoop: while (!isInterrupted && !configuration.progressMonitor.isCancelled()) { if (currentTrajectoryWithFittness == null) { @@ -189,7 +201,12 @@ public class BestFirstStrategyForModelGeneration implements IStrategy { visualiseCurrentState(); // for(ViatraQueryMatcher matcher : matchers) { -// System.out.println(matcher.getPatternName() + " - " + matcher.getAllValues("element")); +// System.out.println(matcher.getPatternName()); +// System.out.println("---------"); +// for(IPatternMatch m : matcher.getAllMatches()) { +// System.out.println(m); +// } +// System.out.println("---------"); // } boolean consistencyCheckResult = checkConsistency(currentTrajectoryWithFittness); @@ -295,7 +312,7 @@ public class BestFirstStrategyForModelGeneration implements IStrategy { public void visualiseCurrentState() { PartialInterpretationVisualiser partialInterpretatioVisualiser = configuration.debugCongiguration.partialInterpretatioVisualiser; - if(partialInterpretatioVisualiser != null) { + if(partialInterpretatioVisualiser != null && this.configuration.documentationLevel == DocumentationLevel.FULL && workspace != null) { PartialInterpretation p = (PartialInterpretation) (context.getModel()); int id = ++numberOfPrintedModel; if (id % configuration.debugCongiguration.partalInterpretationVisualisationFrequency == 0) { -- cgit v1.2.3-70-g09d2