diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeRefinementWithPreliminaryTypeAnalysis.xtend')
1 files changed, 6 insertions, 5 deletions
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{ | |||
27 | private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) | 27 | private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) |
28 | «FOR type :containment.typesOrderedInHierarchy SEPARATOR "or"»{ | 28 | «FOR type :containment.typesOrderedInHierarchy SEPARATOR "or"»{ |
29 | find interpretation(problem,interpretation); | 29 | find interpretation(problem,interpretation); |
30 | «base.typeIndexer.referInstanceOf(type,Modality.MAY,"root")» | 30 | «base.typeIndexer.referInstanceOf(type,Modality.MUST,"root")» |
31 | find mustExist(problem, interpretation, root); | 31 | find mustExist(problem, interpretation, root); |
32 | }«ENDFOR» | 32 | }«ENDFOR» |
33 | «FOR type:possibleNewDynamicType» | 33 | «FOR type:possibleNewDynamicType» |
@@ -36,7 +36,7 @@ class TypeRefinementWithPreliminaryTypeAnalysis extends TypeRefinementGenerator{ | |||
36 | «IF inverseRelations.containsKey(containmentRelation)» | 36 | «IF inverseRelations.containsKey(containmentRelation)» |
37 | pattern «this.patternName(containmentRelation,inverseRelations.get(containmentRelation),type)»( | 37 | pattern «this.patternName(containmentRelation,inverseRelations.get(containmentRelation),type)»( |
38 | problem:LogicProblem, interpretation:PartialInterpretation, | 38 | problem:LogicProblem, interpretation:PartialInterpretation, |
39 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialTypeInterpratation, | 39 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, |
40 | container:DefinedElement) | 40 | container:DefinedElement) |
41 | { | 41 | { |
42 | find interpretation(problem,interpretation); | 42 | find interpretation(problem,interpretation); |
@@ -55,7 +55,7 @@ class TypeRefinementWithPreliminaryTypeAnalysis extends TypeRefinementGenerator{ | |||
55 | «ELSE» | 55 | «ELSE» |
56 | pattern «this.patternName(containmentRelation,null,type)»( | 56 | pattern «this.patternName(containmentRelation,null,type)»( |
57 | problem:LogicProblem, interpretation:PartialInterpretation, | 57 | problem:LogicProblem, interpretation:PartialInterpretation, |
58 | relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialTypeInterpratation, | 58 | relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, |
59 | container:DefinedElement) | 59 | container:DefinedElement) |
60 | { | 60 | { |
61 | find interpretation(problem,interpretation); | 61 | find interpretation(problem,interpretation); |
@@ -73,7 +73,7 @@ class TypeRefinementWithPreliminaryTypeAnalysis extends TypeRefinementGenerator{ | |||
73 | «ENDFOR» | 73 | «ENDFOR» |
74 | pattern «patternName(null,null,type)»( | 74 | pattern «patternName(null,null,type)»( |
75 | problem:LogicProblem, interpretation:PartialInterpretation, | 75 | problem:LogicProblem, interpretation:PartialInterpretation, |
76 | typeInterpretation:PartialTypeInterpratation) | 76 | typeInterpretation:PartialComplexTypeInterpretation) |
77 | { | 77 | { |
78 | find interpretation(problem,interpretation); | 78 | find interpretation(problem,interpretation); |
79 | neg find hasElementInContainment(problem,interpretation); | 79 | neg find hasElementInContainment(problem,interpretation); |
@@ -86,7 +86,7 @@ class TypeRefinementWithPreliminaryTypeAnalysis extends TypeRefinementGenerator{ | |||
86 | «ELSE» | 86 | «ELSE» |
87 | pattern «this.patternName(null,null,type)»( | 87 | pattern «this.patternName(null,null,type)»( |
88 | problem:LogicProblem, interpretation:PartialInterpretation, | 88 | problem:LogicProblem, interpretation:PartialInterpretation, |
89 | typeInterpretation:PartialTypeInterpratation) | 89 | typeInterpretation:PartialComplexTypeInterpretation) |
90 | { | 90 | { |
91 | find interpretation(problem,interpretation); | 91 | find interpretation(problem,interpretation); |
92 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | 92 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); |
@@ -107,6 +107,7 @@ class TypeRefinementWithPreliminaryTypeAnalysis extends TypeRefinementGenerator{ | |||
107 | pattern refineTypeTo_«base.canonizeName(newTypeRefinement.targetType.name)»(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | 107 | pattern refineTypeTo_«base.canonizeName(newTypeRefinement.targetType.name)»(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { |
108 | find interpretation(problem,interpretation); | 108 | find interpretation(problem,interpretation); |
109 | PartialInterpretation.newElements(interpretation,element); | 109 | PartialInterpretation.newElements(interpretation,element); |
110 | «base.typeIndexer.referInstanceOf(newTypeRefinement.targetType,Modality.MAY,"element")» | ||
110 | «FOR inhibitorType : newTypeRefinement.inhibitorTypes» | 111 | «FOR inhibitorType : newTypeRefinement.inhibitorTypes» |
111 | neg «base.typeIndexer.referInstanceOf(inhibitorType,Modality.MUST,"element")» | 112 | neg «base.typeIndexer.referInstanceOf(inhibitorType,Modality.MUST,"element")» |
112 | «ENDFOR» | 113 | «ENDFOR» |