diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend | 38 |
1 files changed, 23 insertions, 15 deletions
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 1ef82195..7caa3e19 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 | |||
@@ -153,6 +153,7 @@ class PatternGenerator { | |||
153 | Map<String,PQuery> fqn2PQuery, | 153 | Map<String,PQuery> fqn2PQuery, |
154 | TypeAnalysisResult typeAnalysisResult | 154 | TypeAnalysisResult typeAnalysisResult |
155 | ) { | 155 | ) { |
156 | |||
156 | return ''' | 157 | return ''' |
157 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" | 158 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" |
158 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" | 159 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" |
@@ -174,19 +175,23 @@ class PatternGenerator { | |||
174 | } or { | 175 | } or { |
175 | find interpretation(problem,interpetation); | 176 | find interpretation(problem,interpetation); |
176 | PartialInterpretation.newElements(interpetation,element); | 177 | PartialInterpretation.newElements(interpetation,element); |
177 | } or { | 178 | } |
179 | «IF problem.hasBoolean»or { | ||
178 | find interpretation(problem,interpetation); | 180 | find interpretation(problem,interpetation); |
179 | PartialInterpretation.booleanelements(interpetation,element); | 181 | PartialInterpretation.booleanelements(interpetation,element); |
180 | } or { | 182 | }«ENDIF» |
183 | «IF problem.hasInteger»or { | ||
181 | find interpretation(problem,interpetation); | 184 | find interpretation(problem,interpetation); |
182 | PartialInterpretation.integerelements(interpetation,element); | 185 | PartialInterpretation.integerelements(interpetation,element); |
183 | } or { | 186 | }«ENDIF» |
187 | «IF problem.hasReal»or { | ||
184 | find interpretation(problem,interpetation); | 188 | find interpretation(problem,interpetation); |
185 | PartialInterpretation.realelements(interpetation,element); | 189 | PartialInterpretation.realelements(interpetation,element); |
186 | } or { | 190 | }«ENDIF» |
191 | «IF problem.hasString»or { | ||
187 | find interpretation(problem,interpetation); | 192 | find interpretation(problem,interpetation); |
188 | PartialInterpretation.stringelements(interpetation,element); | 193 | PartialInterpretation.stringelements(interpetation,element); |
189 | } | 194 | }«ENDIF» |
190 | 195 | ||
191 | private pattern mayExist(problem:LogicProblem, interpetation:PartialInterpretation, element:DefinedElement) { | 196 | private pattern mayExist(problem:LogicProblem, interpetation:PartialInterpretation, element:DefinedElement) { |
192 | find mustExist(problem,interpetation,element); | 197 | find mustExist(problem,interpetation,element); |
@@ -194,32 +199,35 @@ class PatternGenerator { | |||
194 | find interpretation(problem,interpetation); | 199 | find interpretation(problem,interpetation); |
195 | neg find elementCloseWorld(interpetation); | 200 | neg find elementCloseWorld(interpetation); |
196 | PartialInterpretation.openWorldElementPrototypes(interpetation,element); | 201 | PartialInterpretation.openWorldElementPrototypes(interpetation,element); |
197 | } or { | 202 | } |
203 | «IF problem.hasInteger»or { | ||
198 | find interpretation(problem,interpetation); | 204 | find interpretation(problem,interpetation); |
199 | neg find integerCloseWorld(interpetation); | 205 | neg find integerCloseWorld(interpetation); |
200 | PartialInterpretation.newIntegers(interpetation,element); | 206 | PartialInterpretation.newIntegers(interpetation,element); |
201 | } or { | 207 | }«ENDIF» |
208 | «IF problem.hasReal»or { | ||
202 | find interpretation(problem,interpetation); | 209 | find interpretation(problem,interpetation); |
203 | neg find realCloseWorld(interpetation); | 210 | neg find realCloseWorld(interpetation); |
204 | PartialInterpretation.newReals(interpetation,element); | 211 | PartialInterpretation.newReals(interpetation,element); |
205 | } or { | 212 | }«ENDIF» |
213 | «IF problem.hasString»or { | ||
206 | find interpretation(problem,interpetation); | 214 | find interpretation(problem,interpetation); |
207 | neg find stringCloseWorld(interpetation); | 215 | neg find stringCloseWorld(interpetation); |
208 | PartialInterpretation.newStrings(interpetation,element); | 216 | PartialInterpretation.newStrings(interpetation,element); |
209 | } | 217 | }«ENDIF» |
210 | 218 | ||
211 | private pattern elementCloseWorld(interpetation:PartialInterpretation) { | 219 | private pattern elementCloseWorld(interpetation:PartialInterpretation) { |
212 | PartialInterpretation.maxNewElements(interpetation,0); | 220 | PartialInterpretation.maxNewElements(interpetation,0); |
213 | } | 221 | } |
214 | private pattern integerCloseWorld(interpetation:PartialInterpretation) { | 222 | «IF problem.hasInteger»private pattern integerCloseWorld(interpetation:PartialInterpretation) { |
215 | PartialInterpretation.maxNewIntegers(interpetation,0); | 223 | PartialInterpretation.maxNewIntegers(interpetation,0); |
216 | } | 224 | }«ENDIF» |
217 | private pattern realCloseWorld(interpetation:PartialInterpretation) { | 225 | «IF problem.hasReal»private pattern realCloseWorld(interpetation:PartialInterpretation) { |
218 | PartialInterpretation.maxNewReals(interpetation,0); | 226 | PartialInterpretation.maxNewReals(interpetation,0); |
219 | } | 227 | }«ENDIF» |
220 | private pattern stringCloseWorld(interpetation:PartialInterpretation) { | 228 | «IF problem.hasString»private pattern stringCloseWorld(interpetation:PartialInterpretation) { |
221 | PartialInterpretation.maxNewStrings(interpetation,0); | 229 | PartialInterpretation.maxNewStrings(interpetation,0); |
222 | } | 230 | }«ENDIF» |
223 | 231 | ||
224 | //////////////////////// | 232 | //////////////////////// |
225 | // 0.2 Equivalence | 233 | // 0.2 Equivalence |