aboutsummaryrefslogtreecommitdiffstats
path: root/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_Support.xtend
diff options
context:
space:
mode:
Diffstat (limited to 'Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_Support.xtend')
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_Support.xtend30
1 files changed, 24 insertions, 6 deletions
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_Support.xtend b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_Support.xtend
index 021cb0ea..8d00d3e7 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_Support.xtend
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_Support.xtend
@@ -37,11 +37,11 @@ class Logic2VampireLanguageMapper_Support {
37 def protected VLSVariable duplicate(VLSVariable term) { 37 def protected VLSVariable duplicate(VLSVariable term) {
38 return createVLSVariable => [it.name = term.name] 38 return createVLSVariable => [it.name = term.name]
39 } 39 }
40 40
41 def protected VLSFunctionAsTerm duplicate(VLSFunctionAsTerm term) { 41 def protected VLSFunctionAsTerm duplicate(VLSFunctionAsTerm term) {
42 return createVLSFunctionAsTerm => [it.functor = term.functor] 42 return createVLSFunctionAsTerm => [it.functor = term.functor]
43 } 43 }
44 44
45 def protected VLSConstant duplicate(VLSConstant term) { 45 def protected VLSConstant duplicate(VLSConstant term) {
46 return createVLSConstant => [it.name = term.name] 46 return createVLSConstant => [it.name = term.name]
47 } 47 }
@@ -61,14 +61,23 @@ class Logic2VampireLanguageMapper_Support {
61 it.terms += duplicate(v) 61 it.terms += duplicate(v)
62 ] 62 ]
63 } 63 }
64 64
65 def protected VLSFunction duplicate(VLSFunction term, List<VLSVariable> vars) {
66 return createVLSFunction => [
67 it.constant = term.constant
68 for (v : vars) {
69 it.terms += duplicate(v)
70 }
71 ]
72 }
73
65 def protected VLSFunction duplicate(VLSFunction term, VLSFunctionAsTerm v) { 74 def protected VLSFunction duplicate(VLSFunction term, VLSFunctionAsTerm v) {
66 return createVLSFunction => [ 75 return createVLSFunction => [
67 it.constant = term.constant 76 it.constant = term.constant
68 it.terms += duplicate(v) 77 it.terms += duplicate(v)
69 ] 78 ]
70 } 79 }
71 80
72 def protected VLSConstant toConstant(VLSFunctionAsTerm term) { 81 def protected VLSConstant toConstant(VLSFunctionAsTerm term) {
73 return createVLSConstant => [ 82 return createVLSConstant => [
74 it.name = term.functor 83 it.name = term.functor
@@ -84,6 +93,13 @@ class Logic2VampireLanguageMapper_Support {
84 ] 93 ]
85 } 94 }
86 95
96 def protected VLSFunction topLevelTypeFunc(VLSVariable v) {
97 return createVLSFunction => [
98 it.constant = "object"
99 it.terms += duplicate(v)
100 ]
101 }
102
87 def protected VLSFunction topLevelTypeFunc(VLSFunctionAsTerm v) { 103 def protected VLSFunction topLevelTypeFunc(VLSFunctionAsTerm v) {
88 return createVLSFunction => [ 104 return createVLSFunction => [
89 it.constant = "object" 105 it.constant = "object"
@@ -173,14 +189,16 @@ class Logic2VampireLanguageMapper_Support {
173 */ 189 */
174 // QUANTIFIERS + VARIABLES 190 // QUANTIFIERS + VARIABLES
175 def protected VLSTerm createQuantifiedExpression(Logic2VampireLanguageMapper mapper, 191 def protected VLSTerm createQuantifiedExpression(Logic2VampireLanguageMapper mapper,
176 QuantifiedExpression expression, Logic2VampireLanguageMapperTrace trace, Map<Variable, VLSVariable> variables, boolean isUniversal) { 192 QuantifiedExpression expression, Logic2VampireLanguageMapperTrace trace, Map<Variable, VLSVariable> variables,
193 boolean isUniversal) {
177 val variableMap = expression.quantifiedVariables.toInvertedMap [ v | 194 val variableMap = expression.quantifiedVariables.toInvertedMap [ v |
178 createVLSVariable => [it.name = toIDMultiple("V", v.name)] 195 createVLSVariable => [it.name = toIDMultiple("V", v.name)]
179 ] 196 ]
180 197
181 val typedefs = new ArrayList<VLSTerm> 198 val typedefs = new ArrayList<VLSTerm>
182 for (variable : expression.quantifiedVariables) { 199 for (variable : expression.quantifiedVariables) {
183 val eq = duplicate((variable.range as ComplexTypeReference).referred.lookup(trace.type2Predicate), variable.lookup(variableMap)) 200 val eq = duplicate((variable.range as ComplexTypeReference).referred.lookup(trace.type2Predicate),
201 variable.lookup(variableMap))
184 typedefs.add(eq) 202 typedefs.add(eq)
185 } 203 }
186 if (isUniversal) { 204 if (isUniversal) {