diff options
Diffstat (limited to 'Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.java')
-rw-r--r-- | Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.java | 60 |
1 files changed, 56 insertions, 4 deletions
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.java index c8961c6e..dc5ec788 100644 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.java +++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.java | |||
@@ -54,6 +54,7 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type; | |||
54 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeReference; | 54 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeReference; |
55 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Variable; | 55 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Variable; |
56 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.impl.RelationDeclarationImpl; | 56 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.impl.RelationDeclarationImpl; |
57 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.impl.RelationDefinitionImpl; | ||
57 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem; | 58 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem; |
58 | import hu.bme.mit.inf.dslreasoner.util.CollectionsUtil; | 59 | import hu.bme.mit.inf.dslreasoner.util.CollectionsUtil; |
59 | import java.util.Arrays; | 60 | import java.util.Arrays; |
@@ -65,6 +66,9 @@ import java.util.function.Consumer; | |||
65 | import org.eclipse.emf.common.util.EList; | 66 | import org.eclipse.emf.common.util.EList; |
66 | import org.eclipse.xtend.lib.annotations.AccessorType; | 67 | import org.eclipse.xtend.lib.annotations.AccessorType; |
67 | import org.eclipse.xtend.lib.annotations.Accessors; | 68 | import org.eclipse.xtend.lib.annotations.Accessors; |
69 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; | ||
70 | import org.eclipse.xtext.xbase.lib.Conversions; | ||
71 | import org.eclipse.xtext.xbase.lib.ExclusiveRange; | ||
68 | import org.eclipse.xtext.xbase.lib.Extension; | 72 | import org.eclipse.xtext.xbase.lib.Extension; |
69 | import org.eclipse.xtext.xbase.lib.Functions.Function1; | 73 | import org.eclipse.xtext.xbase.lib.Functions.Function1; |
70 | import org.eclipse.xtext.xbase.lib.IterableExtensions; | 74 | import org.eclipse.xtext.xbase.lib.IterableExtensions; |
@@ -118,18 +122,23 @@ public class Logic2VampireLanguageMapper { | |||
118 | this.typeMapper.transformTypes(problem.getTypes(), problem.getElements(), this, trace); | 122 | this.typeMapper.transformTypes(problem.getTypes(), problem.getElements(), this, trace); |
119 | } | 123 | } |
120 | trace.relationDefinitions = this.collectRelationDefinitions(problem); | 124 | trace.relationDefinitions = this.collectRelationDefinitions(problem); |
121 | final Consumer<Relation> _function_3 = (Relation it) -> { | 125 | final Function1<Relation, Boolean> _function_3 = (Relation it) -> { |
126 | Class<? extends Relation> _class = it.getClass(); | ||
127 | return Boolean.valueOf(Objects.equal(_class, RelationDefinitionImpl.class)); | ||
128 | }; | ||
129 | this.toTrace(IterableExtensions.<Relation>filter(problem.getRelations(), _function_3), trace); | ||
130 | final Consumer<Relation> _function_4 = (Relation it) -> { | ||
122 | Logic2VampireLanguageMapper _logic2VampireLanguageMapper = new Logic2VampireLanguageMapper(); | 131 | Logic2VampireLanguageMapper _logic2VampireLanguageMapper = new Logic2VampireLanguageMapper(); |
123 | this.relationMapper.transformRelation(it, trace, _logic2VampireLanguageMapper); | 132 | this.relationMapper.transformRelation(it, trace, _logic2VampireLanguageMapper); |
124 | }; | 133 | }; |
125 | problem.getRelations().forEach(_function_3); | 134 | problem.getRelations().forEach(_function_4); |
126 | this.containmentMapper.transformContainment(config, problem.getContainmentHierarchies(), trace); | 135 | this.containmentMapper.transformContainment(config, problem.getContainmentHierarchies(), trace); |
127 | this.scopeMapper.transformScope(problem.getTypes(), config, trace); | 136 | this.scopeMapper.transformScope(problem.getTypes(), config, trace); |
128 | trace.constantDefinitions = this.collectConstantDefinitions(problem); | 137 | trace.constantDefinitions = this.collectConstantDefinitions(problem); |
129 | final Consumer<ConstantDefinition> _function_4 = (ConstantDefinition it) -> { | 138 | final Consumer<ConstantDefinition> _function_5 = (ConstantDefinition it) -> { |
130 | this.constantMapper.transformConstantDefinitionSpecification(it, trace); | 139 | this.constantMapper.transformConstantDefinitionSpecification(it, trace); |
131 | }; | 140 | }; |
132 | Iterables.<ConstantDefinition>filter(problem.getConstants(), ConstantDefinition.class).forEach(_function_4); | 141 | Iterables.<ConstantDefinition>filter(problem.getConstants(), ConstantDefinition.class).forEach(_function_5); |
133 | EList<Assertion> _assertions = problem.getAssertions(); | 142 | EList<Assertion> _assertions = problem.getAssertions(); |
134 | for (final Assertion assertion : _assertions) { | 143 | for (final Assertion assertion : _assertions) { |
135 | this.transformAssertion(assertion, trace); | 144 | this.transformAssertion(assertion, trace); |
@@ -137,6 +146,49 @@ public class Logic2VampireLanguageMapper { | |||
137 | return new TracedOutput<VampireModel, Logic2VampireLanguageMapperTrace>(specification, trace); | 146 | return new TracedOutput<VampireModel, Logic2VampireLanguageMapperTrace>(specification, trace); |
138 | } | 147 | } |
139 | 148 | ||
149 | public void toTrace(final Iterable<Relation> relations, final Logic2VampireLanguageMapperTrace trace) { | ||
150 | final List<VLSVariable> vars = CollectionLiterals.<VLSVariable>newArrayList(); | ||
151 | for (final Relation rel : relations) { | ||
152 | { | ||
153 | final String[] nameArray = rel.getName().split(" "); | ||
154 | String relNameVar = ""; | ||
155 | int _length = nameArray.length; | ||
156 | boolean _equals = (_length == 3); | ||
157 | if (_equals) { | ||
158 | relNameVar = this.support.toIDMultiple(nameArray[0], nameArray[2]); | ||
159 | } else { | ||
160 | relNameVar = rel.getName(); | ||
161 | } | ||
162 | final String relName = relNameVar; | ||
163 | final RelationDefinition relDef = ((RelationDefinition) rel); | ||
164 | int _length_1 = ((Object[])Conversions.unwrapArray(rel.getParameters(), Object.class)).length; | ||
165 | ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _length_1, true); | ||
166 | for (final Integer i : _doubleDotLessThan) { | ||
167 | { | ||
168 | VLSVariable _createVLSVariable = this.factory.createVLSVariable(); | ||
169 | final Procedure1<VLSVariable> _function = (VLSVariable it) -> { | ||
170 | it.setName(this.support.toIDMultiple("V", i.toString())); | ||
171 | }; | ||
172 | final VLSVariable v = ObjectExtensions.<VLSVariable>operator_doubleArrow(_createVLSVariable, _function); | ||
173 | vars.add(v); | ||
174 | } | ||
175 | } | ||
176 | VLSFunction _createVLSFunction = this.factory.createVLSFunction(); | ||
177 | final Procedure1<VLSFunction> _function = (VLSFunction it) -> { | ||
178 | it.setConstant(this.support.toIDMultiple("r", relName)); | ||
179 | for (final VLSVariable v : vars) { | ||
180 | EList<VLSTerm> _terms = it.getTerms(); | ||
181 | VLSVariable _duplicate = this.support.duplicate(v); | ||
182 | _terms.add(_duplicate); | ||
183 | } | ||
184 | }; | ||
185 | final VLSFunction relFunc = ObjectExtensions.<VLSFunction>operator_doubleArrow(_createVLSFunction, _function); | ||
186 | trace.relDef2Predicate.put(relDef, relFunc); | ||
187 | trace.predicate2RelDef.put(relFunc, relDef); | ||
188 | } | ||
189 | } | ||
190 | } | ||
191 | |||
140 | protected VLSTerm _transformTypeReference(final BoolTypeReference boolTypeReference, final Logic2VampireLanguageMapperTrace trace) { | 192 | protected VLSTerm _transformTypeReference(final BoolTypeReference boolTypeReference, final Logic2VampireLanguageMapperTrace trace) { |
141 | return null; | 193 | return null; |
142 | } | 194 | } |