diff options
author | ArenBabikian <aren.babikian@mail.mcgill.ca> | 2019-03-05 21:33:28 -0500 |
---|---|---|
committer | ArenBabikian <aren.babikian@mail.mcgill.ca> | 2019-03-05 21:33:28 -0500 |
commit | 89929078ca93c74a80ad70d58934d5d6d43d0e4f (patch) | |
tree | a8dd965a65a3545b9919f1276151b509d29c82e2 /Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_Support.java | |
parent | Implement type scope handling (diff) | |
download | VIATRA-Generator-89929078ca93c74a80ad70d58934d5d6d43d0e4f.tar.gz VIATRA-Generator-89929078ca93c74a80ad70d58934d5d6d43d0e4f.tar.zst VIATRA-Generator-89929078ca93c74a80ad70d58934d5d6d43d0e4f.zip |
Partially improve coding style (leaving for soccer)
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 | 54 |
1 files changed, 52 insertions, 2 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 dfe624be..35497eab 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 | |||
@@ -17,6 +17,7 @@ import com.google.common.collect.Iterables; | |||
17 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.ComplexTypeReference; | 17 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.ComplexTypeReference; |
18 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.QuantifiedExpression; | 18 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.QuantifiedExpression; |
19 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Term; | 19 | 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.TypeReference; | 21 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeReference; |
21 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Variable; | 22 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Variable; |
22 | import java.util.ArrayList; | 23 | import java.util.ArrayList; |
@@ -52,14 +53,39 @@ public class Logic2VampireLanguageMapper_Support { | |||
52 | return IterableExtensions.join(((Iterable<?>)Conversions.doWrapArray(ids.split("\\s+"))), "_"); | 53 | return IterableExtensions.join(((Iterable<?>)Conversions.doWrapArray(ids.split("\\s+"))), "_"); |
53 | } | 54 | } |
54 | 55 | ||
55 | protected VLSVariable duplicate(final VLSVariable vrbl) { | 56 | protected VLSVariable duplicate(final VLSVariable term) { |
56 | VLSVariable _createVLSVariable = this.factory.createVLSVariable(); | 57 | VLSVariable _createVLSVariable = this.factory.createVLSVariable(); |
57 | final Procedure1<VLSVariable> _function = (VLSVariable it) -> { | 58 | final Procedure1<VLSVariable> _function = (VLSVariable it) -> { |
58 | it.setName(vrbl.getName()); | 59 | it.setName(term.getName()); |
59 | }; | 60 | }; |
60 | return ObjectExtensions.<VLSVariable>operator_doubleArrow(_createVLSVariable, _function); | 61 | return ObjectExtensions.<VLSVariable>operator_doubleArrow(_createVLSVariable, _function); |
61 | } | 62 | } |
62 | 63 | ||
64 | protected VLSFunction duplicate(final VLSFunction term) { | ||
65 | VLSFunction _createVLSFunction = this.factory.createVLSFunction(); | ||
66 | final Procedure1<VLSFunction> _function = (VLSFunction it) -> { | ||
67 | it.setConstant(term.getConstant()); | ||
68 | EList<VLSTerm> _terms = term.getTerms(); | ||
69 | for (final VLSTerm v : _terms) { | ||
70 | EList<VLSTerm> _terms_1 = it.getTerms(); | ||
71 | VLSVariable _duplicate = this.duplicate(((VLSVariable) v)); | ||
72 | _terms_1.add(_duplicate); | ||
73 | } | ||
74 | }; | ||
75 | return ObjectExtensions.<VLSFunction>operator_doubleArrow(_createVLSFunction, _function); | ||
76 | } | ||
77 | |||
78 | protected VLSFunction duplicate(final VLSFunction term, final VLSVariable v) { | ||
79 | VLSFunction _createVLSFunction = this.factory.createVLSFunction(); | ||
80 | final Procedure1<VLSFunction> _function = (VLSFunction it) -> { | ||
81 | it.setConstant(term.getConstant()); | ||
82 | EList<VLSTerm> _terms = it.getTerms(); | ||
83 | VLSVariable _duplicate = this.duplicate(v); | ||
84 | _terms.add(_duplicate); | ||
85 | }; | ||
86 | return ObjectExtensions.<VLSFunction>operator_doubleArrow(_createVLSFunction, _function); | ||
87 | } | ||
88 | |||
63 | protected VLSFunction topLevelTypeFunc() { | 89 | protected VLSFunction topLevelTypeFunc() { |
64 | VLSFunction _createVLSFunction = this.factory.createVLSFunction(); | 90 | VLSFunction _createVLSFunction = this.factory.createVLSFunction(); |
65 | final Procedure1<VLSFunction> _function = (VLSFunction it) -> { | 91 | final Procedure1<VLSFunction> _function = (VLSFunction it) -> { |
@@ -287,6 +313,30 @@ public class Logic2VampireLanguageMapper_Support { | |||
287 | return _xblockexpression; | 313 | return _xblockexpression; |
288 | } | 314 | } |
289 | 315 | ||
316 | protected boolean dfsSupertypeCheck(final Type type, final Type type2) { | ||
317 | boolean _xifexpression = false; | ||
318 | boolean _isEmpty = type.getSupertypes().isEmpty(); | ||
319 | if (_isEmpty) { | ||
320 | return false; | ||
321 | } else { | ||
322 | boolean _xifexpression_1 = false; | ||
323 | boolean _contains = type.getSupertypes().contains(type2); | ||
324 | if (_contains) { | ||
325 | return true; | ||
326 | } else { | ||
327 | EList<Type> _supertypes = type.getSupertypes(); | ||
328 | for (final Type supertype : _supertypes) { | ||
329 | boolean _dfsSupertypeCheck = this.dfsSupertypeCheck(supertype, type2); | ||
330 | if (_dfsSupertypeCheck) { | ||
331 | return true; | ||
332 | } | ||
333 | } | ||
334 | } | ||
335 | _xifexpression = _xifexpression_1; | ||
336 | } | ||
337 | return _xifexpression; | ||
338 | } | ||
339 | |||
290 | protected HashMap<Variable, VLSVariable> withAddition(final Map<Variable, VLSVariable> map1, final Map<Variable, VLSVariable> map2) { | 340 | protected HashMap<Variable, VLSVariable> withAddition(final Map<Variable, VLSVariable> map1, final Map<Variable, VLSVariable> map2) { |
291 | HashMap<Variable, VLSVariable> _hashMap = new HashMap<Variable, VLSVariable>(map1); | 341 | HashMap<Variable, VLSVariable> _hashMap = new HashMap<Variable, VLSVariable>(map1); |
292 | final Procedure1<HashMap<Variable, VLSVariable>> _function = (HashMap<Variable, VLSVariable> it) -> { | 342 | final Procedure1<HashMap<Variable, VLSVariable>> _function = (HashMap<Variable, VLSVariable> it) -> { |