diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeIndexerWithPreliminaryTypeAnalysis.xtend')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeIndexerWithPreliminaryTypeAnalysis.xtend | 11 |
1 files changed, 11 insertions, 0 deletions
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 67a886d1..d3af0426 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 | |||
@@ -72,6 +72,15 @@ class TypeIndexerWithPreliminaryTypeAnalysis extends TypeIndexer{ | |||
72 | null | 72 | null |
73 | } | 73 | } |
74 | ''' | 74 | ''' |
75 | private pattern scopeDisallowsNew«base.canonizeName(type.name)»(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
76 | find interpretation(problem,interpretation); | ||
77 | PartialInterpretation.scopes(interpretation,scope); | ||
78 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
79 | Scope.maxNewElements(scope,0); | ||
80 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
81 | Type.name(type,"«type.name»"); | ||
82 | } | ||
83 | |||
75 | /** | 84 | /** |
76 | * An element may be an instance of type "«type.name»". | 85 | * An element may be an instance of type "«type.name»". |
77 | */ | 86 | */ |
@@ -82,6 +91,7 @@ class TypeIndexerWithPreliminaryTypeAnalysis extends TypeIndexer{ | |||
82 | «FOR inhibitorType : inhibitorTypes» | 91 | «FOR inhibitorType : inhibitorTypes» |
83 | neg «referInstanceOf(inhibitorType,Modality.MUST,"element")» | 92 | neg «referInstanceOf(inhibitorType,Modality.MUST,"element")» |
84 | «ENDFOR» | 93 | «ENDFOR» |
94 | neg find scopeDisallowsNew«base.canonizeName(type.name)»(problem, interpretation); | ||
85 | neg find isPrimitive(element); | 95 | neg find isPrimitive(element); |
86 | } or { | 96 | } or { |
87 | find interpretation(problem,interpretation); | 97 | find interpretation(problem,interpretation); |
@@ -89,6 +99,7 @@ class TypeIndexerWithPreliminaryTypeAnalysis extends TypeIndexer{ | |||
89 | «FOR inhibitorType : inhibitorTypes» | 99 | «FOR inhibitorType : inhibitorTypes» |
90 | neg «referInstanceOf(inhibitorType,Modality.MUST,"element")» | 100 | neg «referInstanceOf(inhibitorType,Modality.MUST,"element")» |
91 | «ENDFOR» | 101 | «ENDFOR» |
102 | neg find scopeDisallowsNew«base.canonizeName(type.name)»(problem, interpretation); | ||
92 | neg find isPrimitive(element); | 103 | neg find isPrimitive(element); |
93 | } or | 104 | } or |
94 | «ENDIF» | 105 | «ENDIF» |