diff options
Diffstat (limited to 'Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_Support.java')
-rw-r--r-- | Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_Support.java | 102 |
1 files changed, 33 insertions, 69 deletions
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_Support.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_Support.java index 35497eab..72ca44e9 100644 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_Support.java +++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_Support.java | |||
@@ -20,6 +20,7 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Term; | |||
20 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type; | 20 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type; |
21 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeReference; | 21 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeReference; |
22 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Variable; | 22 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Variable; |
23 | import hu.bme.mit.inf.dslreasoner.util.CollectionsUtil; | ||
23 | import java.util.ArrayList; | 24 | import java.util.ArrayList; |
24 | import java.util.Collection; | 25 | import java.util.Collection; |
25 | import java.util.HashMap; | 26 | import java.util.HashMap; |
@@ -220,13 +221,13 @@ public class Logic2VampireLanguageMapper_Support { | |||
220 | * ids.map[it.split("\\s+").join("'")].join("'") | 221 | * ids.map[it.split("\\s+").join("'")].join("'") |
221 | * } | 222 | * } |
222 | */ | 223 | */ |
223 | protected VLSTerm createUniversallyQuantifiedExpression(final Logic2VampireLanguageMapper mapper, final QuantifiedExpression expression, final Logic2VampireLanguageMapperTrace trace, final Map<Variable, VLSVariable> variables) { | 224 | protected VLSTerm createQuantifiedExpression(final Logic2VampireLanguageMapper mapper, final QuantifiedExpression expression, final Logic2VampireLanguageMapperTrace trace, final Map<Variable, VLSVariable> variables, final boolean isUniversal) { |
224 | VLSUniversalQuantifier _xblockexpression = null; | 225 | VLSTerm _xblockexpression = null; |
225 | { | 226 | { |
226 | final Function1<Variable, VLSVariable> _function = (Variable v) -> { | 227 | final Function1<Variable, VLSVariable> _function = (Variable v) -> { |
227 | VLSVariable _createVLSVariable = this.factory.createVLSVariable(); | 228 | VLSVariable _createVLSVariable = this.factory.createVLSVariable(); |
228 | final Procedure1<VLSVariable> _function_1 = (VLSVariable it) -> { | 229 | final Procedure1<VLSVariable> _function_1 = (VLSVariable it) -> { |
229 | it.setName(this.toIDMultiple("Var", v.getName())); | 230 | it.setName(this.toIDMultiple("V", v.getName())); |
230 | }; | 231 | }; |
231 | return ObjectExtensions.<VLSVariable>operator_doubleArrow(_createVLSVariable, _function_1); | 232 | return ObjectExtensions.<VLSVariable>operator_doubleArrow(_createVLSVariable, _function_1); |
232 | }; | 233 | }; |
@@ -235,80 +236,43 @@ public class Logic2VampireLanguageMapper_Support { | |||
235 | EList<Variable> _quantifiedVariables = expression.getQuantifiedVariables(); | 236 | EList<Variable> _quantifiedVariables = expression.getQuantifiedVariables(); |
236 | for (final Variable variable : _quantifiedVariables) { | 237 | for (final Variable variable : _quantifiedVariables) { |
237 | { | 238 | { |
238 | VLSFunction _createVLSFunction = this.factory.createVLSFunction(); | 239 | TypeReference _range = variable.getRange(); |
239 | final Procedure1<VLSFunction> _function_1 = (VLSFunction it) -> { | 240 | final VLSFunction eq = this.duplicate(CollectionsUtil.<Type, VLSFunction>lookup(((ComplexTypeReference) _range).getReferred(), trace.type2Predicate), CollectionsUtil.<Variable, VLSVariable>lookup(variable, variableMap)); |
240 | TypeReference _range = variable.getRange(); | ||
241 | it.setConstant(this.toIDMultiple("t", ((ComplexTypeReference) _range).getReferred().getName())); | ||
242 | EList<VLSTerm> _terms = it.getTerms(); | ||
243 | VLSVariable _createVLSVariable = this.factory.createVLSVariable(); | ||
244 | final Procedure1<VLSVariable> _function_2 = (VLSVariable it_1) -> { | ||
245 | it_1.setName(this.toIDMultiple("Var", variable.getName())); | ||
246 | }; | ||
247 | VLSVariable _doubleArrow = ObjectExtensions.<VLSVariable>operator_doubleArrow(_createVLSVariable, _function_2); | ||
248 | _terms.add(_doubleArrow); | ||
249 | }; | ||
250 | final VLSFunction eq = ObjectExtensions.<VLSFunction>operator_doubleArrow(_createVLSFunction, _function_1); | ||
251 | typedefs.add(eq); | 241 | typedefs.add(eq); |
252 | } | 242 | } |
253 | } | 243 | } |
254 | VLSUniversalQuantifier _createVLSUniversalQuantifier = this.factory.createVLSUniversalQuantifier(); | 244 | VLSTerm _xifexpression = null; |
255 | final Procedure1<VLSUniversalQuantifier> _function_1 = (VLSUniversalQuantifier it) -> { | 245 | if (isUniversal) { |
256 | EList<VLSVariable> _variables = it.getVariables(); | 246 | VLSUniversalQuantifier _createVLSUniversalQuantifier = this.factory.createVLSUniversalQuantifier(); |
257 | Collection<VLSVariable> _values = variableMap.values(); | 247 | final Procedure1<VLSUniversalQuantifier> _function_1 = (VLSUniversalQuantifier it) -> { |
258 | Iterables.<VLSVariable>addAll(_variables, _values); | 248 | EList<VLSVariable> _variables = it.getVariables(); |
259 | VLSImplies _createVLSImplies = this.factory.createVLSImplies(); | 249 | Collection<VLSVariable> _values = variableMap.values(); |
260 | final Procedure1<VLSImplies> _function_2 = (VLSImplies it_1) -> { | 250 | Iterables.<VLSVariable>addAll(_variables, _values); |
261 | it_1.setLeft(this.unfoldAnd(typedefs)); | 251 | VLSImplies _createVLSImplies = this.factory.createVLSImplies(); |
262 | it_1.setRight(mapper.transformTerm(expression.getExpression(), trace, this.withAddition(variables, variableMap))); | 252 | final Procedure1<VLSImplies> _function_2 = (VLSImplies it_1) -> { |
263 | }; | 253 | it_1.setLeft(this.unfoldAnd(typedefs)); |
264 | VLSImplies _doubleArrow = ObjectExtensions.<VLSImplies>operator_doubleArrow(_createVLSImplies, _function_2); | 254 | it_1.setRight(mapper.transformTerm(expression.getExpression(), trace, this.withAddition(variables, variableMap))); |
265 | it.setOperand(_doubleArrow); | 255 | }; |
266 | }; | 256 | VLSImplies _doubleArrow = ObjectExtensions.<VLSImplies>operator_doubleArrow(_createVLSImplies, _function_2); |
267 | _xblockexpression = ObjectExtensions.<VLSUniversalQuantifier>operator_doubleArrow(_createVLSUniversalQuantifier, _function_1); | 257 | it.setOperand(_doubleArrow); |
268 | } | ||
269 | return _xblockexpression; | ||
270 | } | ||
271 | |||
272 | protected VLSTerm createExistentiallyQuantifiedExpression(final Logic2VampireLanguageMapper mapper, final QuantifiedExpression expression, final Logic2VampireLanguageMapperTrace trace, final Map<Variable, VLSVariable> variables) { | ||
273 | VLSExistentialQuantifier _xblockexpression = null; | ||
274 | { | ||
275 | final Function1<Variable, VLSVariable> _function = (Variable v) -> { | ||
276 | VLSVariable _createVLSVariable = this.factory.createVLSVariable(); | ||
277 | final Procedure1<VLSVariable> _function_1 = (VLSVariable it) -> { | ||
278 | it.setName(this.toIDMultiple("Var", v.getName())); | ||
279 | }; | 258 | }; |
280 | return ObjectExtensions.<VLSVariable>operator_doubleArrow(_createVLSVariable, _function_1); | 259 | _xifexpression = ObjectExtensions.<VLSUniversalQuantifier>operator_doubleArrow(_createVLSUniversalQuantifier, _function_1); |
281 | }; | 260 | } else { |
282 | final Map<Variable, VLSVariable> variableMap = IterableExtensions.<Variable, VLSVariable>toInvertedMap(expression.getQuantifiedVariables(), _function); | 261 | VLSExistentialQuantifier _xblockexpression_1 = null; |
283 | final ArrayList<VLSTerm> typedefs = new ArrayList<VLSTerm>(); | ||
284 | EList<Variable> _quantifiedVariables = expression.getQuantifiedVariables(); | ||
285 | for (final Variable variable : _quantifiedVariables) { | ||
286 | { | 262 | { |
287 | VLSFunction _createVLSFunction = this.factory.createVLSFunction(); | 263 | typedefs.add(mapper.transformTerm(expression.getExpression(), trace, this.withAddition(variables, variableMap))); |
288 | final Procedure1<VLSFunction> _function_1 = (VLSFunction it) -> { | 264 | VLSExistentialQuantifier _createVLSExistentialQuantifier = this.factory.createVLSExistentialQuantifier(); |
289 | TypeReference _range = variable.getRange(); | 265 | final Procedure1<VLSExistentialQuantifier> _function_2 = (VLSExistentialQuantifier it) -> { |
290 | it.setConstant(this.toIDMultiple("t", ((ComplexTypeReference) _range).getReferred().getName())); | 266 | EList<VLSVariable> _variables = it.getVariables(); |
291 | EList<VLSTerm> _terms = it.getTerms(); | 267 | Collection<VLSVariable> _values = variableMap.values(); |
292 | VLSVariable _createVLSVariable = this.factory.createVLSVariable(); | 268 | Iterables.<VLSVariable>addAll(_variables, _values); |
293 | final Procedure1<VLSVariable> _function_2 = (VLSVariable it_1) -> { | 269 | it.setOperand(this.unfoldAnd(typedefs)); |
294 | it_1.setName(this.toIDMultiple("Var", variable.getName())); | ||
295 | }; | ||
296 | VLSVariable _doubleArrow = ObjectExtensions.<VLSVariable>operator_doubleArrow(_createVLSVariable, _function_2); | ||
297 | _terms.add(_doubleArrow); | ||
298 | }; | 270 | }; |
299 | final VLSFunction eq = ObjectExtensions.<VLSFunction>operator_doubleArrow(_createVLSFunction, _function_1); | 271 | _xblockexpression_1 = ObjectExtensions.<VLSExistentialQuantifier>operator_doubleArrow(_createVLSExistentialQuantifier, _function_2); |
300 | typedefs.add(eq); | ||
301 | } | 272 | } |
273 | _xifexpression = _xblockexpression_1; | ||
302 | } | 274 | } |
303 | typedefs.add(mapper.transformTerm(expression.getExpression(), trace, this.withAddition(variables, variableMap))); | 275 | _xblockexpression = _xifexpression; |
304 | VLSExistentialQuantifier _createVLSExistentialQuantifier = this.factory.createVLSExistentialQuantifier(); | ||
305 | final Procedure1<VLSExistentialQuantifier> _function_1 = (VLSExistentialQuantifier it) -> { | ||
306 | EList<VLSVariable> _variables = it.getVariables(); | ||
307 | Collection<VLSVariable> _values = variableMap.values(); | ||
308 | Iterables.<VLSVariable>addAll(_variables, _values); | ||
309 | it.setOperand(this.unfoldAnd(typedefs)); | ||
310 | }; | ||
311 | _xblockexpression = ObjectExtensions.<VLSExistentialQuantifier>operator_doubleArrow(_createVLSExistentialQuantifier, _function_1); | ||
312 | } | 276 | } |
313 | return _xblockexpression; | 277 | return _xblockexpression; |
314 | } | 278 | } |