diff options
author | 2020-05-07 02:41:05 +0200 | |
---|---|---|
committer | 2020-05-07 02:41:05 +0200 | |
commit | 28a7fda89898ec9d32d97efe7a0e111f36a8cf87 (patch) | |
tree | 7638c7a5876ff02250c4014cf60b2d8140ad1544 /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns | |
parent | Adjustments to FamilyTree and Pledge Case studies (diff) | |
download | VIATRA-Generator-28a7fda89898ec9d32d97efe7a0e111f36a8cf87.tar.gz VIATRA-Generator-28a7fda89898ec9d32d97efe7a0e111f36a8cf87.tar.zst VIATRA-Generator-28a7fda89898ec9d32d97efe7a0e111f36a8cf87.zip |
viatra parsing fixes
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/UnitPropagationPreconditionGenerator.xtend | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/UnitPropagationPreconditionGenerator.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/UnitPropagationPreconditionGenerator.xtend index 6cd94657..f726a24f 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/UnitPropagationPreconditionGenerator.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/UnitPropagationPreconditionGenerator.xtend | |||
@@ -21,6 +21,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.Positi | |||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall | 21 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall |
22 | import java.util.Comparator | 22 | import java.util.Comparator |
23 | import java.util.ArrayList | 23 | import java.util.ArrayList |
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PDisjunction | ||
24 | 25 | ||
25 | @Data class UnitPropagation { | 26 | @Data class UnitPropagation { |
26 | val PQuery q | 27 | val PQuery q |
@@ -101,7 +102,7 @@ class UnitPropagationPreconditionGenerator { | |||
101 | } | 102 | } |
102 | 103 | ||
103 | def getOrGeneratePropagationRule(UnitPropagationPreconditionGenerationResult res, Relation relation, PQuery q, PConstraint c, PropagationModality pm, Modality m3) { | 104 | def getOrGeneratePropagationRule(UnitPropagationPreconditionGenerationResult res, Relation relation, PQuery q, PConstraint c, PropagationModality pm, Modality m3) { |
104 | if(!res.contains(q,c,pm,m3)) { | 105 | if(res.contains(q,c,pm,m3)) { |
105 | return res.getName(q,c,pm,m3) | 106 | return res.getName(q,c,pm,m3) |
106 | } else { | 107 | } else { |
107 | res.generatePropagationRule(relation,q,c,pm,m3) | 108 | res.generatePropagationRule(relation,q,c,pm,m3) |
@@ -121,8 +122,9 @@ class UnitPropagationPreconditionGenerator { | |||
121 | def void generatePropagationRule(UnitPropagationPreconditionGenerationResult res, Relation relation, PQuery q, PConstraint c, PropagationModality pm, Modality m3) { | 122 | def void generatePropagationRule(UnitPropagationPreconditionGenerationResult res, Relation relation, PQuery q, PConstraint c, PropagationModality pm, Modality m3) { |
122 | val name = relationDefinitionName(res,relation,q,c,pm,m3) | 123 | val name = relationDefinitionName(res,relation,q,c,pm,m3) |
123 | val constraintArity = c.arity | 124 | val constraintArity = c.arity |
125 | val bodies = (relation.annotations.filter(TransfomedViatraQuery).head.optimizedDisjunction as PDisjunction).bodies | ||
124 | val generatedBodies = new LinkedList | 126 | val generatedBodies = new LinkedList |
125 | for(body : q.disjunctBodies.bodies) { | 127 | for(body : bodies) { |
126 | if(body.constraints.contains(c)) { | 128 | if(body.constraints.contains(c)) { |
127 | if(pm === PropagationModality::UP) { | 129 | if(pm === PropagationModality::UP) { |
128 | generatedBodies += ''' | 130 | generatedBodies += ''' |