diff options
author | 2020-08-06 16:07:16 +0200 | |
---|---|---|
committer | 2020-08-06 16:07:16 +0200 | |
commit | a620f07468780778bd55dcffc30245def37ece69 (patch) | |
tree | 57189ad9c8bf15211a05a3cd50ee90e90f434557 /Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run | |
parent | Fix time measurement (diff) | |
download | VIATRA-Generator-a620f07468780778bd55dcffc30245def37ece69.tar.gz VIATRA-Generator-a620f07468780778bd55dcffc30245def37ece69.tar.zst VIATRA-Generator-a620f07468780778bd55dcffc30245def37ece69.zip |
MoDeS3 unit propagation WIP
Diffstat (limited to 'Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run')
5 files changed, 968 insertions, 0 deletions
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.Modes3ModelGenerator.xtendbin b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.Modes3ModelGenerator.xtendbin new file mode 100644 index 00000000..4f542a67 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.Modes3ModelGenerator.xtendbin | |||
Binary files differ | |||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.Modes3UnitPropagationGenerator.xtendbin b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.Modes3UnitPropagationGenerator.xtendbin new file mode 100644 index 00000000..28e763b9 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.Modes3UnitPropagationGenerator.xtendbin | |||
Binary files differ | |||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.gitignore b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.gitignore new file mode 100644 index 00000000..53dcf60f --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.gitignore | |||
@@ -0,0 +1,2 @@ | |||
1 | /.Modes3ModelGenerator.java._trace | ||
2 | /.Modes3UnitPropagationGenerator.java._trace | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/Modes3ModelGenerator.java b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/Modes3ModelGenerator.java new file mode 100644 index 00000000..c7364257 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/Modes3ModelGenerator.java | |||
@@ -0,0 +1,381 @@ | |||
1 | package modes3.run; | ||
2 | |||
3 | import com.google.common.base.Objects; | ||
4 | import com.google.common.collect.ImmutableList; | ||
5 | import com.google.common.collect.ImmutableSet; | ||
6 | import com.google.common.collect.Iterables; | ||
7 | import hu.bme.mit.inf.dslreasoner.ecore2logic.EReferenceMapper_RelationsOverTypes_Trace; | ||
8 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic; | ||
9 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2LogicConfiguration; | ||
10 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic_Trace; | ||
11 | import hu.bme.mit.inf.dslreasoner.ecore2logic.EcoreMetamodelDescriptor; | ||
12 | import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsFactory; | ||
13 | import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage; | ||
14 | import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.InverseRelationAssertion; | ||
15 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicProblemBuilder; | ||
16 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TracedOutput; | ||
17 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TypeScopes; | ||
18 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.VariableContext; | ||
19 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Assertion; | ||
20 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Iff; | ||
21 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.LogiclanguagePackage; | ||
22 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDeclaration; | ||
23 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.SymbolicValue; | ||
24 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TermDescription; | ||
25 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type; | ||
26 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDefinition; | ||
27 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Variable; | ||
28 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.Annotation; | ||
29 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem; | ||
30 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicproblemPackage; | ||
31 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult; | ||
32 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult; | ||
33 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2Logic; | ||
34 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2LogicConfiguration; | ||
35 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2LogicTrace; | ||
36 | import hu.bme.mit.inf.dslreasoner.viatra2logic.ViatraQuerySetDescriptor; | ||
37 | import hu.bme.mit.inf.dslreasoner.viatra2logic.viatra2logicannotations.Viatra2LogicAnnotationsPackage; | ||
38 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.TypeInferenceMethod; | ||
39 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.PolyhedralScopePropagatorConstraints; | ||
40 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.PolyhedralScopePropagatorSolver; | ||
41 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.ScopePropagatorStrategy; | ||
42 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2Logic; | ||
43 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.BinaryElementRelationLink; | ||
44 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialComplexTypeInterpretation; | ||
45 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation; | ||
46 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialRelationInterpretation; | ||
47 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialinterpretationPackage; | ||
48 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.RelationLink; | ||
49 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretation2Gml; | ||
50 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretationVisualisation; | ||
51 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.StateCoderStrategy; | ||
52 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasoner; | ||
53 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasonerConfiguration; | ||
54 | import hu.bme.mit.inf.dslreasoner.visualisation.pi2graphviz.GraphvizVisualiser; | ||
55 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace; | ||
56 | import java.util.Collections; | ||
57 | import java.util.List; | ||
58 | import java.util.Map; | ||
59 | import java.util.Set; | ||
60 | import java.util.function.Consumer; | ||
61 | import java.util.function.Predicate; | ||
62 | import modes3.Modes3Factory; | ||
63 | import modes3.Modes3ModelRoot; | ||
64 | import modes3.Modes3Package; | ||
65 | import modes3.queries.Modes3Queries; | ||
66 | import org.eclipse.emf.common.util.EList; | ||
67 | import org.eclipse.emf.common.util.URI; | ||
68 | import org.eclipse.emf.ecore.EAttribute; | ||
69 | import org.eclipse.emf.ecore.EClass; | ||
70 | import org.eclipse.emf.ecore.EEnum; | ||
71 | import org.eclipse.emf.ecore.EEnumLiteral; | ||
72 | import org.eclipse.emf.ecore.EObject; | ||
73 | import org.eclipse.emf.ecore.EReference; | ||
74 | import org.eclipse.emf.ecore.EStructuralFeature; | ||
75 | import org.eclipse.emf.ecore.resource.Resource; | ||
76 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; | ||
77 | import org.eclipse.viatra.query.patternlanguage.emf.EMFPatternLanguageStandaloneSetup; | ||
78 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
79 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngineOptions; | ||
80 | import org.eclipse.viatra.query.runtime.localsearch.matcher.integration.LocalSearchEMFBackendFactory; | ||
81 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
82 | import org.eclipse.viatra.query.runtime.rete.matcher.ReteBackendFactory; | ||
83 | import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor; | ||
84 | import org.eclipse.xtend2.lib.StringConcatenation; | ||
85 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; | ||
86 | import org.eclipse.xtext.xbase.lib.Exceptions; | ||
87 | import org.eclipse.xtext.xbase.lib.ExclusiveRange; | ||
88 | import org.eclipse.xtext.xbase.lib.Extension; | ||
89 | import org.eclipse.xtext.xbase.lib.Functions.Function1; | ||
90 | import org.eclipse.xtext.xbase.lib.InputOutput; | ||
91 | import org.eclipse.xtext.xbase.lib.IterableExtensions; | ||
92 | import org.eclipse.xtext.xbase.lib.ObjectExtensions; | ||
93 | import org.eclipse.xtext.xbase.lib.Procedures.Procedure1; | ||
94 | |||
95 | @FinalFieldsConstructor | ||
96 | @SuppressWarnings("all") | ||
97 | public class Modes3ModelGenerator { | ||
98 | private enum MonitoringQuery { | ||
99 | closeTrains, | ||
100 | |||
101 | misalignedTurnout; | ||
102 | } | ||
103 | |||
104 | private final Modes3ModelGenerator.MonitoringQuery monitoringQuery; | ||
105 | |||
106 | private final int modelSize; | ||
107 | |||
108 | private final Ecore2Logic ecore2Logic = new Ecore2Logic(); | ||
109 | |||
110 | private final InstanceModel2Logic instanceModel2Logic = new InstanceModel2Logic(); | ||
111 | |||
112 | private final Viatra2Logic viatra2Logic = new Viatra2Logic(this.ecore2Logic); | ||
113 | |||
114 | private final ViatraReasoner solver = new ViatraReasoner(); | ||
115 | |||
116 | @Extension | ||
117 | private final LogicProblemBuilder _logicProblemBuilder = new LogicProblemBuilder(); | ||
118 | |||
119 | public URI generate() { | ||
120 | try { | ||
121 | URI _xblockexpression = null; | ||
122 | { | ||
123 | final EcoreMetamodelDescriptor metamodel = Modes3ModelGenerator.createMetamodelDescriptor(); | ||
124 | Ecore2LogicConfiguration _ecore2LogicConfiguration = new Ecore2LogicConfiguration(); | ||
125 | final TracedOutput<LogicProblem, Ecore2Logic_Trace> metamodelLogic = this.ecore2Logic.transformMetamodel(metamodel, _ecore2LogicConfiguration); | ||
126 | final Type segment = this.ecore2Logic.TypeofEClass(metamodelLogic.getTrace(), Modes3Package.eINSTANCE.getSegment()); | ||
127 | final RelationDeclaration connectedTo = this.ecore2Logic.relationOfReference(metamodelLogic.getTrace(), | ||
128 | Modes3Package.eINSTANCE.getSegment_ConnectedTo()); | ||
129 | final RelationDeclaration connectedToIndicator = ((EReferenceMapper_RelationsOverTypes_Trace) metamodelLogic.getTrace().referenceMapperTrace).indicators.get( | ||
130 | Modes3Package.eINSTANCE.getSegment_ConnectedTo()); | ||
131 | StringConcatenation _builder = new StringConcatenation(); | ||
132 | _builder.append("oppositeReference "); | ||
133 | String _name = connectedTo.getName(); | ||
134 | _builder.append(_name); | ||
135 | _builder.append(" "); | ||
136 | String _name_1 = connectedTo.getName(); | ||
137 | _builder.append(_name_1); | ||
138 | final Function1<VariableContext, TermDescription> _function = (VariableContext it) -> { | ||
139 | Iff _xblockexpression_1 = null; | ||
140 | { | ||
141 | StringConcatenation _builder_1 = new StringConcatenation(); | ||
142 | _builder_1.append("src"); | ||
143 | final Variable src = it.addVar(_builder_1, segment); | ||
144 | StringConcatenation _builder_2 = new StringConcatenation(); | ||
145 | _builder_2.append("trg"); | ||
146 | final Variable trg = it.addVar(_builder_2, segment); | ||
147 | SymbolicValue _call = this._logicProblemBuilder.call(connectedToIndicator, src, trg); | ||
148 | SymbolicValue _call_1 = this._logicProblemBuilder.call(connectedToIndicator, trg, src); | ||
149 | _xblockexpression_1 = this._logicProblemBuilder.operator_spaceship(_call, _call_1); | ||
150 | } | ||
151 | return _xblockexpression_1; | ||
152 | }; | ||
153 | final Assertion inverseAssertion = this._logicProblemBuilder.Assertion(_builder, | ||
154 | this._logicProblemBuilder.Forall(_function)); | ||
155 | EList<Assertion> _assertions = metamodelLogic.getOutput().getAssertions(); | ||
156 | _assertions.add(inverseAssertion); | ||
157 | InverseRelationAssertion _createInverseRelationAssertion = Ecore2logicannotationsFactory.eINSTANCE.createInverseRelationAssertion(); | ||
158 | final Procedure1<InverseRelationAssertion> _function_1 = (InverseRelationAssertion it) -> { | ||
159 | it.setTarget(inverseAssertion); | ||
160 | it.setInverseA(connectedTo); | ||
161 | it.setInverseB(connectedTo); | ||
162 | }; | ||
163 | final InverseRelationAssertion inverseAnnotation = ObjectExtensions.<InverseRelationAssertion>operator_doubleArrow(_createInverseRelationAssertion, _function_1); | ||
164 | EList<Annotation> _annotations = metamodelLogic.getOutput().getAnnotations(); | ||
165 | _annotations.add(inverseAnnotation); | ||
166 | final List<EObject> initialModel = Modes3ModelGenerator.loadInitialModel(); | ||
167 | final TracedOutput<LogicProblem, Ecore2Logic_Trace> initialModelLogic = this.instanceModel2Logic.transform(metamodelLogic, initialModel); | ||
168 | final ViatraQuerySetDescriptor queries = this.loadQueries(); | ||
169 | Viatra2LogicConfiguration _viatra2LogicConfiguration = new Viatra2LogicConfiguration(); | ||
170 | final TracedOutput<LogicProblem, Viatra2LogicTrace> logic = this.viatra2Logic.transformQueries(queries, initialModelLogic, _viatra2LogicConfiguration); | ||
171 | ViatraReasonerConfiguration _viatraReasonerConfiguration = new ViatraReasonerConfiguration(); | ||
172 | final Procedure1<ViatraReasonerConfiguration> _function_2 = (ViatraReasonerConfiguration it) -> { | ||
173 | it.runtimeLimit = 3600; | ||
174 | final Procedure1<TypeScopes> _function_3 = (TypeScopes it_1) -> { | ||
175 | it_1.minNewElements = this.modelSize; | ||
176 | it_1.maxNewElements = this.modelSize; | ||
177 | final Procedure1<Map<Type, Integer>> _function_4 = (Map<Type, Integer> it_2) -> { | ||
178 | it_2.put(this.ecore2Logic.TypeofEClass(metamodelLogic.getTrace(), Modes3Package.eINSTANCE.getTurnout()), Integer.valueOf(1)); | ||
179 | }; | ||
180 | ObjectExtensions.<Map<Type, Integer>>operator_doubleArrow( | ||
181 | it_1.minNewElementsByType, _function_4); | ||
182 | final Procedure1<Map<Type, Integer>> _function_5 = (Map<Type, Integer> it_2) -> { | ||
183 | it_2.put(this.ecore2Logic.TypeofEClass(metamodelLogic.getTrace(), Modes3Package.eINSTANCE.getTrain()), Integer.valueOf(5)); | ||
184 | }; | ||
185 | ObjectExtensions.<Map<Type, Integer>>operator_doubleArrow( | ||
186 | it_1.maxNewElementsByType, _function_5); | ||
187 | }; | ||
188 | ObjectExtensions.<TypeScopes>operator_doubleArrow( | ||
189 | it.typeScopes, _function_3); | ||
190 | it.solutionScope.numberOfRequiredSolutions = 1; | ||
191 | it.nameNewElements = false; | ||
192 | it.typeInferenceMethod = TypeInferenceMethod.PreliminaryAnalysis; | ||
193 | it.stateCoderStrategy = StateCoderStrategy.Neighbourhood; | ||
194 | ScopePropagatorStrategy.Polyhedral _polyhedral = new ScopePropagatorStrategy.Polyhedral( | ||
195 | PolyhedralScopePropagatorConstraints.Relational, PolyhedralScopePropagatorSolver.Clp); | ||
196 | it.scopePropagatorStrategy = _polyhedral; | ||
197 | it.debugConfiguration.partialInterpretatioVisualiser = null; | ||
198 | }; | ||
199 | final ViatraReasonerConfiguration config = ObjectExtensions.<ViatraReasonerConfiguration>operator_doubleArrow(_viatraReasonerConfiguration, _function_2); | ||
200 | final FileSystemWorkspace workspace = new FileSystemWorkspace("output/", ""); | ||
201 | final LogicResult solution = this.solver.solve(logic.getOutput(), config, workspace); | ||
202 | URI _xifexpression = null; | ||
203 | if ((solution instanceof ModelResult)) { | ||
204 | InputOutput.<String>println("Saving generated solutions"); | ||
205 | final EList<Object> representations = ((ModelResult)solution).getRepresentation(); | ||
206 | int _size = representations.size(); | ||
207 | ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _size, true); | ||
208 | for (final Integer representationIndex : _doubleDotLessThan) { | ||
209 | { | ||
210 | final Object representation = representations.get((representationIndex).intValue()); | ||
211 | final int representationNumber = ((representationIndex).intValue() + 1); | ||
212 | if ((representation instanceof PartialInterpretation)) { | ||
213 | StringConcatenation _builder_1 = new StringConcatenation(); | ||
214 | _builder_1.append("solution"); | ||
215 | _builder_1.append(representationNumber); | ||
216 | _builder_1.append(".partialinterpretation"); | ||
217 | workspace.writeModel(((EObject)representation), _builder_1.toString()); | ||
218 | final PartialInterpretation2Gml partialInterpretation2GML = new PartialInterpretation2Gml(); | ||
219 | final String gml = partialInterpretation2GML.transform(((PartialInterpretation)representation)); | ||
220 | StringConcatenation _builder_2 = new StringConcatenation(); | ||
221 | _builder_2.append("solution"); | ||
222 | _builder_2.append(representationNumber); | ||
223 | _builder_2.append(".gml"); | ||
224 | workspace.writeText(_builder_2.toString(), gml); | ||
225 | int _size_1 = ((PartialInterpretation)representation).getNewElements().size(); | ||
226 | boolean _lessThan = (_size_1 < 160); | ||
227 | if (_lessThan) { | ||
228 | if ((representation instanceof PartialInterpretation)) { | ||
229 | final Consumer<Type> _function_3 = (Type it) -> { | ||
230 | InputOutput.<String>println(it.getName()); | ||
231 | }; | ||
232 | ((PartialInterpretation)representation).getProblem().getTypes().forEach(_function_3); | ||
233 | final Function1<Type, Boolean> _function_4 = (Type it) -> { | ||
234 | String _name_2 = it.getName(); | ||
235 | return Boolean.valueOf(Objects.equal(_name_2, "Modes3ModelRoot class DefinedPart")); | ||
236 | }; | ||
237 | Type _findFirst = IterableExtensions.<Type>findFirst(((PartialInterpretation)representation).getProblem().getTypes(), _function_4); | ||
238 | final TypeDefinition rootType = ((TypeDefinition) _findFirst); | ||
239 | final Function1<PartialComplexTypeInterpretation, Boolean> _function_5 = (PartialComplexTypeInterpretation it) -> { | ||
240 | String _name_2 = it.getInterpretationOf().getName(); | ||
241 | return Boolean.valueOf(Objects.equal(_name_2, "Modes3ModelRoot class")); | ||
242 | }; | ||
243 | final PartialComplexTypeInterpretation rootIntepretation = IterableExtensions.<PartialComplexTypeInterpretation>findFirst(Iterables.<PartialComplexTypeInterpretation>filter(((PartialInterpretation)representation).getPartialtypeinterpratation(), | ||
244 | PartialComplexTypeInterpretation.class), _function_5); | ||
245 | rootIntepretation.getElements().removeAll(rootType.getElements()); | ||
246 | ((PartialInterpretation)representation).getProblem().getElements().removeAll(rootType.getElements()); | ||
247 | EList<PartialRelationInterpretation> _partialrelationinterpretation = ((PartialInterpretation)representation).getPartialrelationinterpretation(); | ||
248 | for (final PartialRelationInterpretation relationInterpretation : _partialrelationinterpretation) { | ||
249 | final Predicate<RelationLink> _function_6 = (RelationLink link) -> { | ||
250 | boolean _xifexpression_1 = false; | ||
251 | if ((link instanceof BinaryElementRelationLink)) { | ||
252 | _xifexpression_1 = (rootType.getElements().contains(((BinaryElementRelationLink)link).getParam1()) || rootType.getElements().contains(((BinaryElementRelationLink)link).getParam2())); | ||
253 | } else { | ||
254 | _xifexpression_1 = false; | ||
255 | } | ||
256 | return _xifexpression_1; | ||
257 | }; | ||
258 | relationInterpretation.getRelationlinks().removeIf(_function_6); | ||
259 | } | ||
260 | rootType.getElements().clear(); | ||
261 | } | ||
262 | final GraphvizVisualiser visualiser = new GraphvizVisualiser(); | ||
263 | final PartialInterpretationVisualisation visualisation = visualiser.visualiseConcretization(((PartialInterpretation)representation)); | ||
264 | StringConcatenation _builder_3 = new StringConcatenation(); | ||
265 | _builder_3.append("solution"); | ||
266 | _builder_3.append(representationNumber); | ||
267 | _builder_3.append(".png"); | ||
268 | visualisation.writeToFile(workspace, _builder_3.toString()); | ||
269 | } | ||
270 | } else { | ||
271 | StringConcatenation _builder_4 = new StringConcatenation(); | ||
272 | _builder_4.append("solution"); | ||
273 | _builder_4.append(representationNumber); | ||
274 | _builder_4.append(".txt"); | ||
275 | workspace.writeText(_builder_4.toString(), representation.toString()); | ||
276 | } | ||
277 | } | ||
278 | } | ||
279 | } else { | ||
280 | URI _xblockexpression_1 = null; | ||
281 | { | ||
282 | InputOutput.<String>println("Failed to solver problem"); | ||
283 | final LogicProblem partial = logic.getOutput(); | ||
284 | _xblockexpression_1 = workspace.writeModel(partial, "solution.partialinterpretation"); | ||
285 | } | ||
286 | _xifexpression = _xblockexpression_1; | ||
287 | } | ||
288 | _xblockexpression = _xifexpression; | ||
289 | } | ||
290 | return _xblockexpression; | ||
291 | } catch (Throwable _e) { | ||
292 | throw Exceptions.sneakyThrow(_e); | ||
293 | } | ||
294 | } | ||
295 | |||
296 | public static EcoreMetamodelDescriptor createMetamodelDescriptor() { | ||
297 | EcoreMetamodelDescriptor _xblockexpression = null; | ||
298 | { | ||
299 | final ImmutableList<EClass> eClasses = ImmutableList.<EClass>copyOf(Iterables.<EClass>filter(Modes3Package.eINSTANCE.getEClassifiers(), EClass.class)); | ||
300 | Set<EClass> _emptySet = CollectionLiterals.<EClass>emptySet(); | ||
301 | List<EEnum> _emptyList = CollectionLiterals.<EEnum>emptyList(); | ||
302 | List<EEnumLiteral> _emptyList_1 = CollectionLiterals.<EEnumLiteral>emptyList(); | ||
303 | final Function1<EClass, EList<EReference>> _function = (EClass it) -> { | ||
304 | return it.getEReferences(); | ||
305 | }; | ||
306 | ImmutableList<EReference> _copyOf = ImmutableList.<EReference>copyOf(IterableExtensions.<EClass, EReference>flatMap(eClasses, _function)); | ||
307 | List<EAttribute> _emptyList_2 = CollectionLiterals.<EAttribute>emptyList(); | ||
308 | _xblockexpression = new EcoreMetamodelDescriptor(eClasses, _emptySet, | ||
309 | false, _emptyList, _emptyList_1, _copyOf, _emptyList_2); | ||
310 | } | ||
311 | return _xblockexpression; | ||
312 | } | ||
313 | |||
314 | public static List<EObject> loadInitialModel() { | ||
315 | Modes3ModelRoot _createModes3ModelRoot = Modes3Factory.eINSTANCE.createModes3ModelRoot(); | ||
316 | return Collections.<EObject>unmodifiableList(CollectionLiterals.<EObject>newArrayList(_createModes3ModelRoot)); | ||
317 | } | ||
318 | |||
319 | public ViatraQuerySetDescriptor loadQueries() { | ||
320 | ViatraQuerySetDescriptor _xblockexpression = null; | ||
321 | { | ||
322 | final ImmutableList.Builder<IQuerySpecification<?>> patternsBuilder = ImmutableList.<IQuerySpecification<?>>builder(); | ||
323 | patternsBuilder.addAll(Modes3Queries.instance().getSpecifications()); | ||
324 | final ImmutableList<IQuerySpecification<?>> patterns = patternsBuilder.build(); | ||
325 | final Function1<IQuerySpecification<?>, Boolean> _function = (IQuerySpecification<?> pattern) -> { | ||
326 | final Function1<PAnnotation, Boolean> _function_1 = (PAnnotation it) -> { | ||
327 | String _name = it.getName(); | ||
328 | return Boolean.valueOf(Objects.equal(_name, "Constraint")); | ||
329 | }; | ||
330 | return Boolean.valueOf(IterableExtensions.<PAnnotation>exists(pattern.getAllAnnotations(), _function_1)); | ||
331 | }; | ||
332 | final ImmutableSet<IQuerySpecification<?>> validationPatterns = ImmutableSet.<IQuerySpecification<?>>copyOf(IterableExtensions.<IQuerySpecification<?>>filter(patterns, _function)); | ||
333 | Map<IQuerySpecification<?>, EStructuralFeature> _emptyMap = CollectionLiterals.<IQuerySpecification<?>, EStructuralFeature>emptyMap(); | ||
334 | _xblockexpression = new ViatraQuerySetDescriptor(patterns, validationPatterns, _emptyMap); | ||
335 | } | ||
336 | return _xblockexpression; | ||
337 | } | ||
338 | |||
339 | public static Object init() { | ||
340 | Object _xblockexpression = null; | ||
341 | { | ||
342 | EMFPatternLanguageStandaloneSetup.doSetup(); | ||
343 | ViatraQueryEngineOptions.setSystemDefaultBackends(ReteBackendFactory.INSTANCE, ReteBackendFactory.INSTANCE, | ||
344 | LocalSearchEMFBackendFactory.INSTANCE); | ||
345 | LogiclanguagePackage.eINSTANCE.getClass(); | ||
346 | LogicproblemPackage.eINSTANCE.getClass(); | ||
347 | PartialinterpretationPackage.eINSTANCE.getClass(); | ||
348 | Ecore2logicannotationsPackage.eINSTANCE.getClass(); | ||
349 | Viatra2LogicAnnotationsPackage.eINSTANCE.getClass(); | ||
350 | Map<String, Object> _extensionToFactoryMap = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap(); | ||
351 | XMIResourceFactoryImpl _xMIResourceFactoryImpl = new XMIResourceFactoryImpl(); | ||
352 | _extensionToFactoryMap.put("ecore", _xMIResourceFactoryImpl); | ||
353 | Map<String, Object> _extensionToFactoryMap_1 = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap(); | ||
354 | XMIResourceFactoryImpl _xMIResourceFactoryImpl_1 = new XMIResourceFactoryImpl(); | ||
355 | _extensionToFactoryMap_1.put("logicproblem", _xMIResourceFactoryImpl_1); | ||
356 | Map<String, Object> _extensionToFactoryMap_2 = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap(); | ||
357 | XMIResourceFactoryImpl _xMIResourceFactoryImpl_2 = new XMIResourceFactoryImpl(); | ||
358 | _xblockexpression = _extensionToFactoryMap_2.put("partialinterpretation", _xMIResourceFactoryImpl_2); | ||
359 | } | ||
360 | return _xblockexpression; | ||
361 | } | ||
362 | |||
363 | public static void main(final String[] args) { | ||
364 | int _length = args.length; | ||
365 | boolean _notEquals = (_length != 2); | ||
366 | if (_notEquals) { | ||
367 | System.err.println("Usage: <query> <model size>"); | ||
368 | } | ||
369 | final Modes3ModelGenerator.MonitoringQuery monitoringQuery = Modes3ModelGenerator.MonitoringQuery.valueOf(args[0]); | ||
370 | final int modelSize = Integer.parseInt(args[1]); | ||
371 | Modes3ModelGenerator.init(); | ||
372 | final Modes3ModelGenerator generator = new Modes3ModelGenerator(monitoringQuery, modelSize); | ||
373 | generator.generate(); | ||
374 | } | ||
375 | |||
376 | public Modes3ModelGenerator(final Modes3ModelGenerator.MonitoringQuery monitoringQuery, final int modelSize) { | ||
377 | super(); | ||
378 | this.monitoringQuery = monitoringQuery; | ||
379 | this.modelSize = modelSize; | ||
380 | } | ||
381 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/Modes3UnitPropagationGenerator.java b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/Modes3UnitPropagationGenerator.java new file mode 100644 index 00000000..91adaaaa --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/Modes3UnitPropagationGenerator.java | |||
@@ -0,0 +1,585 @@ | |||
1 | package modes3.run; | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic; | ||
4 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic_Trace; | ||
5 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation; | ||
6 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type; | ||
7 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.Modality; | ||
8 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.PatternGenerator; | ||
9 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.UnitPropagationPatternGenerator; | ||
10 | import java.util.Collections; | ||
11 | import java.util.Map; | ||
12 | import modes3.Modes3Package; | ||
13 | import modes3.queries.ExtraInputOfTurnout; | ||
14 | import modes3.queries.Output; | ||
15 | import modes3.queries.TurnoutOutput; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQuery; | ||
17 | import org.eclipse.xtend2.lib.StringConcatenationClient; | ||
18 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; | ||
19 | import org.eclipse.xtext.xbase.lib.Extension; | ||
20 | import org.eclipse.xtext.xbase.lib.Pair; | ||
21 | |||
22 | @SuppressWarnings("all") | ||
23 | public class Modes3UnitPropagationGenerator implements UnitPropagationPatternGenerator { | ||
24 | private static final String MUST_NOT_CONNECTED_TO = "mustNotConnectedTo"; | ||
25 | |||
26 | private static final String MUST_NOT_CONNECTED_TO_HELPER = "mustNotConnectedTo_helper"; | ||
27 | |||
28 | private static final String MUST_NOT_TURNOUT_OUTPUT = "mustNotTurnoutOutput"; | ||
29 | |||
30 | private static final String MUST_NOT_STRAIGHT = "mustNotStraight"; | ||
31 | |||
32 | private static final String MUST_NOT_DIVERGENT = "mustNotDivergent"; | ||
33 | |||
34 | private final Type segmentType; | ||
35 | |||
36 | private final Type turnoutType; | ||
37 | |||
38 | private final Relation connectedToRelation; | ||
39 | |||
40 | private final Relation straightRelation; | ||
41 | |||
42 | private final Relation divergentRelation; | ||
43 | |||
44 | public Modes3UnitPropagationGenerator(@Extension final Ecore2Logic ecore2Logic, final Ecore2Logic_Trace ecore2LogicTrace) { | ||
45 | @Extension | ||
46 | final Modes3Package Modes3Package = modes3.Modes3Package.eINSTANCE; | ||
47 | this.segmentType = ecore2Logic.TypeofEClass(ecore2LogicTrace, Modes3Package.getSegment()); | ||
48 | this.turnoutType = ecore2Logic.TypeofEClass(ecore2LogicTrace, Modes3Package.getTurnout()); | ||
49 | this.connectedToRelation = ecore2Logic.relationOfReference(ecore2LogicTrace, Modes3Package.getSegment_ConnectedTo()); | ||
50 | this.straightRelation = ecore2Logic.relationOfReference(ecore2LogicTrace, Modes3Package.getTurnout_Straight()); | ||
51 | this.divergentRelation = ecore2Logic.relationOfReference(ecore2LogicTrace, Modes3Package.getTurnout_Divergent()); | ||
52 | } | ||
53 | |||
54 | @Override | ||
55 | public Map<Relation, String> getMustPatterns() { | ||
56 | return CollectionLiterals.<Relation, String>emptyMap(); | ||
57 | } | ||
58 | |||
59 | @Override | ||
60 | public Map<Relation, String> getMustNotPatterns() { | ||
61 | Pair<Relation, String> _mappedTo = Pair.<Relation, String>of(this.connectedToRelation, Modes3UnitPropagationGenerator.MUST_NOT_CONNECTED_TO); | ||
62 | Pair<Relation, String> _mappedTo_1 = Pair.<Relation, String>of(this.straightRelation, Modes3UnitPropagationGenerator.MUST_NOT_STRAIGHT); | ||
63 | Pair<Relation, String> _mappedTo_2 = Pair.<Relation, String>of(this.divergentRelation, Modes3UnitPropagationGenerator.MUST_NOT_DIVERGENT); | ||
64 | return Collections.<Relation, String>unmodifiableMap(CollectionLiterals.<Relation, String>newHashMap(_mappedTo, _mappedTo_1, _mappedTo_2)); | ||
65 | } | ||
66 | |||
67 | @Override | ||
68 | public StringConcatenationClient getAdditionalPatterns(@Extension final PatternGenerator generator, final Map<String, PQuery> fqnToPQuery) { | ||
69 | StringConcatenationClient _xblockexpression = null; | ||
70 | { | ||
71 | StringConcatenationClient _client = new StringConcatenationClient() { | ||
72 | @Override | ||
73 | protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) { | ||
74 | _builder.append("problem: LogicProblem, interpretation: PartialInterpretation,"); | ||
75 | _builder.newLine(); | ||
76 | _builder.append("source: DefinedElement, target: DefinedElement"); | ||
77 | _builder.newLine(); | ||
78 | } | ||
79 | }; | ||
80 | final StringConcatenationClient parameters = _client; | ||
81 | StringConcatenationClient _client_1 = new StringConcatenationClient() { | ||
82 | @Override | ||
83 | protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) { | ||
84 | _builder.append("find interpretation(problem, interpretation);"); | ||
85 | _builder.newLine(); | ||
86 | _builder.append("find mustExist(problem, interpretation, source);"); | ||
87 | _builder.newLine(); | ||
88 | _builder.append("find mustExist(problem, interpretation, target);"); | ||
89 | _builder.newLine(); | ||
90 | } | ||
91 | }; | ||
92 | final StringConcatenationClient commonParameterConstraints = _client_1; | ||
93 | StringConcatenationClient _client_2 = new StringConcatenationClient() { | ||
94 | @Override | ||
95 | protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) { | ||
96 | _builder.append("pattern "); | ||
97 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_CONNECTED_TO_HELPER); | ||
98 | _builder.append("("); | ||
99 | _builder.append(parameters); | ||
100 | _builder.append(") {"); | ||
101 | _builder.newLineIfNotEmpty(); | ||
102 | _builder.append("\t"); | ||
103 | _builder.append("// connectedToReflexive unit propagation"); | ||
104 | _builder.newLine(); | ||
105 | _builder.append("\t"); | ||
106 | _builder.append(commonParameterConstraints, "\t"); | ||
107 | _builder.newLineIfNotEmpty(); | ||
108 | _builder.append("\t"); | ||
109 | CharSequence _referInstanceOf = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "source"); | ||
110 | _builder.append(_referInstanceOf, "\t"); | ||
111 | _builder.newLineIfNotEmpty(); | ||
112 | _builder.append("\t"); | ||
113 | CharSequence _referInstanceOf_1 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
114 | _builder.append(_referInstanceOf_1, "\t"); | ||
115 | _builder.newLineIfNotEmpty(); | ||
116 | _builder.append("\t"); | ||
117 | _builder.append("source == target;"); | ||
118 | _builder.newLine(); | ||
119 | _builder.append("} or {"); | ||
120 | _builder.newLine(); | ||
121 | _builder.append("\t"); | ||
122 | _builder.append("// tooManyInputsOfSegment unit propagation"); | ||
123 | _builder.newLine(); | ||
124 | _builder.append("\t"); | ||
125 | _builder.append(commonParameterConstraints, "\t"); | ||
126 | _builder.newLineIfNotEmpty(); | ||
127 | _builder.append("\t"); | ||
128 | CharSequence _referInstanceOf_2 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "source"); | ||
129 | _builder.append(_referInstanceOf_2, "\t"); | ||
130 | _builder.newLineIfNotEmpty(); | ||
131 | _builder.append("\t"); | ||
132 | CharSequence _referInstanceOf_3 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
133 | _builder.append(_referInstanceOf_3, "\t"); | ||
134 | _builder.newLineIfNotEmpty(); | ||
135 | _builder.append("\t"); | ||
136 | CharSequence _referInstanceOf_4 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "input1"); | ||
137 | _builder.append(_referInstanceOf_4, "\t"); | ||
138 | _builder.newLineIfNotEmpty(); | ||
139 | _builder.append("\t"); | ||
140 | CharSequence _referInstanceOf_5 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "input2"); | ||
141 | _builder.append(_referInstanceOf_5, "\t"); | ||
142 | _builder.newLineIfNotEmpty(); | ||
143 | _builder.append("\t"); | ||
144 | _builder.append("neg "); | ||
145 | CharSequence _referInstanceOf_6 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MAY, "source"); | ||
146 | _builder.append(_referInstanceOf_6, "\t"); | ||
147 | _builder.newLineIfNotEmpty(); | ||
148 | _builder.append("\t"); | ||
149 | CharSequence _referPattern = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(Output.instance().getFullyQualifiedName()), new String[] { "input1", "source" }, Modality.MUST, true, false); | ||
150 | _builder.append(_referPattern, "\t"); | ||
151 | _builder.newLineIfNotEmpty(); | ||
152 | _builder.append("\t"); | ||
153 | CharSequence _referPattern_1 = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(Output.instance().getFullyQualifiedName()), new String[] { "input2", "source" }, Modality.MUST, true, false); | ||
154 | _builder.append(_referPattern_1, "\t"); | ||
155 | _builder.newLineIfNotEmpty(); | ||
156 | _builder.append("\t"); | ||
157 | _builder.append("input1 != input2;"); | ||
158 | _builder.newLine(); | ||
159 | _builder.append("\t"); | ||
160 | _builder.append("input1 != target;"); | ||
161 | _builder.newLine(); | ||
162 | _builder.append("\t"); | ||
163 | _builder.append("input2 != target;"); | ||
164 | _builder.newLine(); | ||
165 | _builder.append("} or {"); | ||
166 | _builder.newLine(); | ||
167 | _builder.append("\t"); | ||
168 | _builder.append("// turnoutConnectedToBothOutputs unit propagation 1"); | ||
169 | _builder.newLine(); | ||
170 | _builder.append("\t"); | ||
171 | _builder.append(commonParameterConstraints, "\t"); | ||
172 | _builder.newLineIfNotEmpty(); | ||
173 | _builder.append("\t"); | ||
174 | CharSequence _referInstanceOf_7 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
175 | _builder.append(_referInstanceOf_7, "\t"); | ||
176 | _builder.newLineIfNotEmpty(); | ||
177 | _builder.append("\t"); | ||
178 | CharSequence _referInstanceOf_8 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
179 | _builder.append(_referInstanceOf_8, "\t"); | ||
180 | _builder.newLineIfNotEmpty(); | ||
181 | _builder.append("\t"); | ||
182 | CharSequence _referInstanceOf_9 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "divergent"); | ||
183 | _builder.append(_referInstanceOf_9, "\t"); | ||
184 | _builder.newLineIfNotEmpty(); | ||
185 | _builder.append("\t"); | ||
186 | CharSequence _referRelation = generator.referRelation(Modes3UnitPropagationGenerator.this.straightRelation, "source", "target", Modality.MUST, fqnToPQuery); | ||
187 | _builder.append(_referRelation, "\t"); | ||
188 | _builder.newLineIfNotEmpty(); | ||
189 | _builder.append("\t"); | ||
190 | CharSequence _referRelation_1 = generator.referRelation(Modes3UnitPropagationGenerator.this.divergentRelation, "source", "divergent", Modality.MUST, fqnToPQuery); | ||
191 | _builder.append(_referRelation_1, "\t"); | ||
192 | _builder.newLineIfNotEmpty(); | ||
193 | _builder.append("\t"); | ||
194 | CharSequence _referRelation_2 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "divergent", Modality.MUST, fqnToPQuery); | ||
195 | _builder.append(_referRelation_2, "\t"); | ||
196 | _builder.newLineIfNotEmpty(); | ||
197 | _builder.append("} or {"); | ||
198 | _builder.newLine(); | ||
199 | _builder.append("\t"); | ||
200 | _builder.append("// turnoutConnectedToBothOutputs unit propagation 2"); | ||
201 | _builder.newLine(); | ||
202 | _builder.append("\t"); | ||
203 | _builder.append(commonParameterConstraints, "\t"); | ||
204 | _builder.newLineIfNotEmpty(); | ||
205 | _builder.append("\t"); | ||
206 | CharSequence _referInstanceOf_10 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
207 | _builder.append(_referInstanceOf_10, "\t"); | ||
208 | _builder.newLineIfNotEmpty(); | ||
209 | _builder.append("\t"); | ||
210 | CharSequence _referInstanceOf_11 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
211 | _builder.append(_referInstanceOf_11, "\t"); | ||
212 | _builder.newLineIfNotEmpty(); | ||
213 | _builder.append("\t"); | ||
214 | CharSequence _referInstanceOf_12 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "straight"); | ||
215 | _builder.append(_referInstanceOf_12, "\t"); | ||
216 | _builder.newLineIfNotEmpty(); | ||
217 | _builder.append("\t"); | ||
218 | CharSequence _referRelation_3 = generator.referRelation(Modes3UnitPropagationGenerator.this.straightRelation, "source", "straight", Modality.MUST, fqnToPQuery); | ||
219 | _builder.append(_referRelation_3, "\t"); | ||
220 | _builder.newLineIfNotEmpty(); | ||
221 | _builder.append("\t"); | ||
222 | CharSequence _referRelation_4 = generator.referRelation(Modes3UnitPropagationGenerator.this.divergentRelation, "source", "target", Modality.MUST, fqnToPQuery); | ||
223 | _builder.append(_referRelation_4, "\t"); | ||
224 | _builder.newLineIfNotEmpty(); | ||
225 | _builder.append("\t"); | ||
226 | CharSequence _referRelation_5 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "straight", Modality.MUST, fqnToPQuery); | ||
227 | _builder.append(_referRelation_5, "\t"); | ||
228 | _builder.newLineIfNotEmpty(); | ||
229 | _builder.append("} or {"); | ||
230 | _builder.newLine(); | ||
231 | _builder.append("\t"); | ||
232 | _builder.append("// tooManyExtraInputsOfTurnout unit propagation"); | ||
233 | _builder.newLine(); | ||
234 | _builder.append("\t"); | ||
235 | _builder.append(commonParameterConstraints, "\t"); | ||
236 | _builder.newLineIfNotEmpty(); | ||
237 | _builder.append("\t"); | ||
238 | CharSequence _referInstanceOf_13 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
239 | _builder.append(_referInstanceOf_13, "\t"); | ||
240 | _builder.newLineIfNotEmpty(); | ||
241 | _builder.append("\t"); | ||
242 | CharSequence _referInstanceOf_14 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
243 | _builder.append(_referInstanceOf_14, "\t"); | ||
244 | _builder.newLineIfNotEmpty(); | ||
245 | _builder.append("\t"); | ||
246 | CharSequence _referInstanceOf_15 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "extraInput"); | ||
247 | _builder.append(_referInstanceOf_15, "\t"); | ||
248 | _builder.newLineIfNotEmpty(); | ||
249 | _builder.append("\t"); | ||
250 | CharSequence _referPattern_2 = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(TurnoutOutput.instance().getFullyQualifiedName()), new String[] { "source", "target" }, Modality.MAY, false, false); | ||
251 | _builder.append(_referPattern_2, "\t"); | ||
252 | _builder.newLineIfNotEmpty(); | ||
253 | _builder.append("\t"); | ||
254 | CharSequence _referPattern_3 = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(ExtraInputOfTurnout.instance().getFullyQualifiedName()), new String[] { "source", "extraInput" }, Modality.MUST, true, false); | ||
255 | _builder.append(_referPattern_3, "\t"); | ||
256 | _builder.newLineIfNotEmpty(); | ||
257 | _builder.append("\t"); | ||
258 | _builder.append("target != extraInput;"); | ||
259 | _builder.newLine(); | ||
260 | _builder.append("}"); | ||
261 | _builder.newLine(); | ||
262 | _builder.newLine(); | ||
263 | _builder.append("pattern "); | ||
264 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_CONNECTED_TO); | ||
265 | _builder.append("("); | ||
266 | _builder.append(parameters); | ||
267 | _builder.append(") {"); | ||
268 | _builder.newLineIfNotEmpty(); | ||
269 | _builder.append("\t"); | ||
270 | _builder.append("find "); | ||
271 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_CONNECTED_TO_HELPER, "\t"); | ||
272 | _builder.append("(problem, interpretation, source, target);"); | ||
273 | _builder.newLineIfNotEmpty(); | ||
274 | _builder.append("} or {"); | ||
275 | _builder.newLine(); | ||
276 | _builder.append("\t"); | ||
277 | _builder.append("find "); | ||
278 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_CONNECTED_TO_HELPER, "\t"); | ||
279 | _builder.append("(problem, interpretation, target, source);"); | ||
280 | _builder.newLineIfNotEmpty(); | ||
281 | _builder.append("}"); | ||
282 | _builder.newLine(); | ||
283 | _builder.newLine(); | ||
284 | _builder.append("pattern "); | ||
285 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_TURNOUT_OUTPUT); | ||
286 | _builder.append("("); | ||
287 | _builder.append(parameters); | ||
288 | _builder.append(") {"); | ||
289 | _builder.newLineIfNotEmpty(); | ||
290 | _builder.append("\t"); | ||
291 | _builder.append("// outputReflexive unit propagation"); | ||
292 | _builder.newLine(); | ||
293 | _builder.append("\t"); | ||
294 | _builder.append(commonParameterConstraints, "\t"); | ||
295 | _builder.newLineIfNotEmpty(); | ||
296 | _builder.append("\t"); | ||
297 | CharSequence _referInstanceOf_16 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
298 | _builder.append(_referInstanceOf_16, "\t"); | ||
299 | _builder.newLineIfNotEmpty(); | ||
300 | _builder.append("\t"); | ||
301 | CharSequence _referInstanceOf_17 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "target"); | ||
302 | _builder.append(_referInstanceOf_17, "\t"); | ||
303 | _builder.newLineIfNotEmpty(); | ||
304 | _builder.append("\t"); | ||
305 | _builder.append("source == target;"); | ||
306 | _builder.newLine(); | ||
307 | _builder.append("} or {"); | ||
308 | _builder.newLine(); | ||
309 | _builder.append("\t"); | ||
310 | _builder.append("// tooManyInputsOfSegment unit propagation"); | ||
311 | _builder.newLine(); | ||
312 | _builder.append("\t"); | ||
313 | _builder.append(commonParameterConstraints, "\t"); | ||
314 | _builder.newLineIfNotEmpty(); | ||
315 | _builder.append("\t"); | ||
316 | CharSequence _referInstanceOf_18 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
317 | _builder.append(_referInstanceOf_18, "\t"); | ||
318 | _builder.newLineIfNotEmpty(); | ||
319 | _builder.append("\t"); | ||
320 | CharSequence _referInstanceOf_19 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
321 | _builder.append(_referInstanceOf_19, "\t"); | ||
322 | _builder.newLineIfNotEmpty(); | ||
323 | _builder.append("\t"); | ||
324 | CharSequence _referInstanceOf_20 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "input1"); | ||
325 | _builder.append(_referInstanceOf_20, "\t"); | ||
326 | _builder.newLineIfNotEmpty(); | ||
327 | _builder.append("\t"); | ||
328 | CharSequence _referInstanceOf_21 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "input2"); | ||
329 | _builder.append(_referInstanceOf_21, "\t"); | ||
330 | _builder.newLineIfNotEmpty(); | ||
331 | _builder.append("\t"); | ||
332 | _builder.append("neg "); | ||
333 | CharSequence _referInstanceOf_22 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MAY, "target"); | ||
334 | _builder.append(_referInstanceOf_22, "\t"); | ||
335 | _builder.newLineIfNotEmpty(); | ||
336 | _builder.append("\t"); | ||
337 | CharSequence _referPattern_4 = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(Output.instance().getFullyQualifiedName()), new String[] { "input1", "target" }, Modality.MUST, true, false); | ||
338 | _builder.append(_referPattern_4, "\t"); | ||
339 | _builder.newLineIfNotEmpty(); | ||
340 | _builder.append("\t"); | ||
341 | CharSequence _referPattern_5 = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(Output.instance().getFullyQualifiedName()), new String[] { "input2", "target" }, Modality.MUST, true, false); | ||
342 | _builder.append(_referPattern_5, "\t"); | ||
343 | _builder.newLineIfNotEmpty(); | ||
344 | _builder.append("\t"); | ||
345 | _builder.append("input1 != input2;"); | ||
346 | _builder.newLine(); | ||
347 | _builder.append("\t"); | ||
348 | _builder.append("input1 != source;"); | ||
349 | _builder.newLine(); | ||
350 | _builder.append("\t"); | ||
351 | _builder.append("input2 != source;"); | ||
352 | _builder.newLine(); | ||
353 | _builder.append("}"); | ||
354 | _builder.newLine(); | ||
355 | _builder.newLine(); | ||
356 | _builder.append("pattern "); | ||
357 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_STRAIGHT); | ||
358 | _builder.append("("); | ||
359 | _builder.append(parameters); | ||
360 | _builder.append(") {"); | ||
361 | _builder.newLineIfNotEmpty(); | ||
362 | _builder.append("\t"); | ||
363 | _builder.append("find "); | ||
364 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_TURNOUT_OUTPUT, "\t"); | ||
365 | _builder.append("(problem, interpretation, source, target);"); | ||
366 | _builder.newLineIfNotEmpty(); | ||
367 | _builder.append("} or {"); | ||
368 | _builder.newLine(); | ||
369 | _builder.append("\t"); | ||
370 | _builder.append("// turnoutOutputsAreSame unit propagation"); | ||
371 | _builder.newLine(); | ||
372 | _builder.append("\t"); | ||
373 | _builder.append(commonParameterConstraints, "\t"); | ||
374 | _builder.newLineIfNotEmpty(); | ||
375 | _builder.append("\t"); | ||
376 | CharSequence _referInstanceOf_23 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
377 | _builder.append(_referInstanceOf_23, "\t"); | ||
378 | _builder.newLineIfNotEmpty(); | ||
379 | _builder.append("\t"); | ||
380 | CharSequence _referInstanceOf_24 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
381 | _builder.append(_referInstanceOf_24, "\t"); | ||
382 | _builder.newLineIfNotEmpty(); | ||
383 | _builder.append("\t"); | ||
384 | CharSequence _referRelation_6 = generator.referRelation(Modes3UnitPropagationGenerator.this.divergentRelation, "source", "target", Modality.MUST, fqnToPQuery); | ||
385 | _builder.append(_referRelation_6, "\t"); | ||
386 | _builder.newLineIfNotEmpty(); | ||
387 | _builder.append("} or {"); | ||
388 | _builder.newLine(); | ||
389 | _builder.append("\t"); | ||
390 | _builder.append("// turnoutConnectedToBothOutputs unit propagation"); | ||
391 | _builder.newLine(); | ||
392 | _builder.append("\t"); | ||
393 | _builder.append(commonParameterConstraints, "\t"); | ||
394 | _builder.newLineIfNotEmpty(); | ||
395 | _builder.append("\t"); | ||
396 | CharSequence _referInstanceOf_25 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
397 | _builder.append(_referInstanceOf_25, "\t"); | ||
398 | _builder.newLineIfNotEmpty(); | ||
399 | _builder.append("\t"); | ||
400 | CharSequence _referInstanceOf_26 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
401 | _builder.append(_referInstanceOf_26, "\t"); | ||
402 | _builder.newLineIfNotEmpty(); | ||
403 | _builder.append("\t"); | ||
404 | CharSequence _referInstanceOf_27 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "divergent"); | ||
405 | _builder.append(_referInstanceOf_27, "\t"); | ||
406 | _builder.newLineIfNotEmpty(); | ||
407 | _builder.append("\t"); | ||
408 | CharSequence _referRelation_7 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "target", Modality.MUST, fqnToPQuery); | ||
409 | _builder.append(_referRelation_7, "\t"); | ||
410 | _builder.newLineIfNotEmpty(); | ||
411 | _builder.append("\t"); | ||
412 | CharSequence _referRelation_8 = generator.referRelation(Modes3UnitPropagationGenerator.this.divergentRelation, "source", "divergent", Modality.MUST, fqnToPQuery); | ||
413 | _builder.append(_referRelation_8, "\t"); | ||
414 | _builder.newLineIfNotEmpty(); | ||
415 | _builder.append("\t"); | ||
416 | CharSequence _referRelation_9 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "divergent", Modality.MUST, fqnToPQuery); | ||
417 | _builder.append(_referRelation_9, "\t"); | ||
418 | _builder.newLineIfNotEmpty(); | ||
419 | _builder.append("} or {"); | ||
420 | _builder.newLine(); | ||
421 | _builder.append("\t"); | ||
422 | _builder.append("// tooManyExtraInputsOfTurnout unit propagation"); | ||
423 | _builder.newLine(); | ||
424 | _builder.append("\t"); | ||
425 | _builder.append(commonParameterConstraints, "\t"); | ||
426 | _builder.newLineIfNotEmpty(); | ||
427 | _builder.append("\t"); | ||
428 | CharSequence _referInstanceOf_28 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
429 | _builder.append(_referInstanceOf_28, "\t"); | ||
430 | _builder.newLineIfNotEmpty(); | ||
431 | _builder.append("\t"); | ||
432 | CharSequence _referInstanceOf_29 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
433 | _builder.append(_referInstanceOf_29, "\t"); | ||
434 | _builder.newLineIfNotEmpty(); | ||
435 | _builder.append("\t"); | ||
436 | CharSequence _referInstanceOf_30 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "extraInput"); | ||
437 | _builder.append(_referInstanceOf_30, "\t"); | ||
438 | _builder.newLineIfNotEmpty(); | ||
439 | _builder.append("\t"); | ||
440 | CharSequence _referInstanceOf_31 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "potentialExtraInput"); | ||
441 | _builder.append(_referInstanceOf_31, "\t"); | ||
442 | _builder.newLineIfNotEmpty(); | ||
443 | _builder.append("\t"); | ||
444 | CharSequence _referPattern_6 = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(ExtraInputOfTurnout.instance().getFullyQualifiedName()), new String[] { "source", "extraInput" }, Modality.MUST, true, false); | ||
445 | _builder.append(_referPattern_6, "\t"); | ||
446 | _builder.newLineIfNotEmpty(); | ||
447 | _builder.append("\t"); | ||
448 | CharSequence _referRelation_10 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "potentialExtraInput", Modality.MUST, fqnToPQuery); | ||
449 | _builder.append(_referRelation_10, "\t"); | ||
450 | _builder.newLineIfNotEmpty(); | ||
451 | _builder.append("\t"); | ||
452 | _builder.append("neg "); | ||
453 | CharSequence _referRelation_11 = generator.referRelation(Modes3UnitPropagationGenerator.this.divergentRelation, "source", "potentialExtraInput", Modality.MAY, fqnToPQuery); | ||
454 | _builder.append(_referRelation_11, "\t"); | ||
455 | _builder.newLineIfNotEmpty(); | ||
456 | _builder.append("\t"); | ||
457 | _builder.append("extraInput != potentialExtraInput;"); | ||
458 | _builder.newLine(); | ||
459 | _builder.append("\t"); | ||
460 | _builder.append("extraInput != target;"); | ||
461 | _builder.newLine(); | ||
462 | _builder.append("\t"); | ||
463 | _builder.append("potentialExtraInput != target;"); | ||
464 | _builder.newLine(); | ||
465 | _builder.append("}"); | ||
466 | _builder.newLine(); | ||
467 | _builder.newLine(); | ||
468 | _builder.append("pattern "); | ||
469 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_DIVERGENT); | ||
470 | _builder.append("("); | ||
471 | _builder.append(parameters); | ||
472 | _builder.append(") {"); | ||
473 | _builder.newLineIfNotEmpty(); | ||
474 | _builder.append("\t"); | ||
475 | _builder.append("find "); | ||
476 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_TURNOUT_OUTPUT, "\t"); | ||
477 | _builder.append("(problem, interpretation, source, target);"); | ||
478 | _builder.newLineIfNotEmpty(); | ||
479 | _builder.append("} or {"); | ||
480 | _builder.newLine(); | ||
481 | _builder.append("\t"); | ||
482 | _builder.append("// turnoutOutputsAreSame unit propagation"); | ||
483 | _builder.newLine(); | ||
484 | _builder.append("\t"); | ||
485 | _builder.append(commonParameterConstraints, "\t"); | ||
486 | _builder.newLineIfNotEmpty(); | ||
487 | _builder.append("\t"); | ||
488 | CharSequence _referInstanceOf_32 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
489 | _builder.append(_referInstanceOf_32, "\t"); | ||
490 | _builder.newLineIfNotEmpty(); | ||
491 | _builder.append("\t"); | ||
492 | CharSequence _referInstanceOf_33 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
493 | _builder.append(_referInstanceOf_33, "\t"); | ||
494 | _builder.newLineIfNotEmpty(); | ||
495 | _builder.append("\t"); | ||
496 | CharSequence _referRelation_12 = generator.referRelation(Modes3UnitPropagationGenerator.this.straightRelation, "source", "target", Modality.MUST, fqnToPQuery); | ||
497 | _builder.append(_referRelation_12, "\t"); | ||
498 | _builder.newLineIfNotEmpty(); | ||
499 | _builder.append("} or {"); | ||
500 | _builder.newLine(); | ||
501 | _builder.append("\t"); | ||
502 | _builder.append("// turnoutConnectedToBothOutputs unit propagation"); | ||
503 | _builder.newLine(); | ||
504 | _builder.append("\t"); | ||
505 | _builder.append(commonParameterConstraints, "\t"); | ||
506 | _builder.newLineIfNotEmpty(); | ||
507 | _builder.append("\t"); | ||
508 | CharSequence _referInstanceOf_34 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
509 | _builder.append(_referInstanceOf_34, "\t"); | ||
510 | _builder.newLineIfNotEmpty(); | ||
511 | _builder.append("\t"); | ||
512 | CharSequence _referInstanceOf_35 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
513 | _builder.append(_referInstanceOf_35, "\t"); | ||
514 | _builder.newLineIfNotEmpty(); | ||
515 | _builder.append("\t"); | ||
516 | CharSequence _referInstanceOf_36 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "straight"); | ||
517 | _builder.append(_referInstanceOf_36, "\t"); | ||
518 | _builder.newLineIfNotEmpty(); | ||
519 | _builder.append("\t"); | ||
520 | CharSequence _referRelation_13 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "target", Modality.MUST, fqnToPQuery); | ||
521 | _builder.append(_referRelation_13, "\t"); | ||
522 | _builder.newLineIfNotEmpty(); | ||
523 | _builder.append("\t"); | ||
524 | CharSequence _referRelation_14 = generator.referRelation(Modes3UnitPropagationGenerator.this.straightRelation, "source", "straight", Modality.MUST, fqnToPQuery); | ||
525 | _builder.append(_referRelation_14, "\t"); | ||
526 | _builder.newLineIfNotEmpty(); | ||
527 | _builder.append("\t"); | ||
528 | CharSequence _referRelation_15 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "straight", Modality.MUST, fqnToPQuery); | ||
529 | _builder.append(_referRelation_15, "\t"); | ||
530 | _builder.newLineIfNotEmpty(); | ||
531 | _builder.append("} or {"); | ||
532 | _builder.newLine(); | ||
533 | _builder.append("\t"); | ||
534 | _builder.append("// tooManyExtraInputsOfTurnout unit propagation"); | ||
535 | _builder.newLine(); | ||
536 | _builder.append("\t"); | ||
537 | _builder.append(commonParameterConstraints, "\t"); | ||
538 | _builder.newLineIfNotEmpty(); | ||
539 | _builder.append("\t"); | ||
540 | CharSequence _referInstanceOf_37 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
541 | _builder.append(_referInstanceOf_37, "\t"); | ||
542 | _builder.newLineIfNotEmpty(); | ||
543 | _builder.append("\t"); | ||
544 | CharSequence _referInstanceOf_38 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
545 | _builder.append(_referInstanceOf_38, "\t"); | ||
546 | _builder.newLineIfNotEmpty(); | ||
547 | _builder.append("\t"); | ||
548 | CharSequence _referInstanceOf_39 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "extraInput"); | ||
549 | _builder.append(_referInstanceOf_39, "\t"); | ||
550 | _builder.newLineIfNotEmpty(); | ||
551 | _builder.append("\t"); | ||
552 | CharSequence _referInstanceOf_40 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "potentialExtraInput"); | ||
553 | _builder.append(_referInstanceOf_40, "\t"); | ||
554 | _builder.newLineIfNotEmpty(); | ||
555 | _builder.append("\t"); | ||
556 | CharSequence _referPattern_7 = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(ExtraInputOfTurnout.instance().getFullyQualifiedName()), new String[] { "source", "extraInput" }, Modality.MUST, true, false); | ||
557 | _builder.append(_referPattern_7, "\t"); | ||
558 | _builder.newLineIfNotEmpty(); | ||
559 | _builder.append("\t"); | ||
560 | CharSequence _referRelation_16 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "potentialExtraInput", Modality.MUST, fqnToPQuery); | ||
561 | _builder.append(_referRelation_16, "\t"); | ||
562 | _builder.newLineIfNotEmpty(); | ||
563 | _builder.append("\t"); | ||
564 | _builder.append("neg "); | ||
565 | CharSequence _referRelation_17 = generator.referRelation(Modes3UnitPropagationGenerator.this.straightRelation, "source", "potentialExtraInput", Modality.MAY, fqnToPQuery); | ||
566 | _builder.append(_referRelation_17, "\t"); | ||
567 | _builder.newLineIfNotEmpty(); | ||
568 | _builder.append("\t"); | ||
569 | _builder.append("extraInput != potentialExtraInput;"); | ||
570 | _builder.newLine(); | ||
571 | _builder.append("\t"); | ||
572 | _builder.append("extraInput != target;"); | ||
573 | _builder.newLine(); | ||
574 | _builder.append("\t"); | ||
575 | _builder.append("potentialExtraInput != target;"); | ||
576 | _builder.newLine(); | ||
577 | _builder.append("}"); | ||
578 | _builder.newLine(); | ||
579 | } | ||
580 | }; | ||
581 | _xblockexpression = _client_2; | ||
582 | } | ||
583 | return _xblockexpression; | ||
584 | } | ||
585 | } | ||