diff options
author | 2021-02-14 08:01:00 +0100 | |
---|---|---|
committer | 2021-02-14 08:01:00 +0100 | |
commit | a8eb346fb97b54b6ee693da4840abd8be8b43843 (patch) | |
tree | 7f63b8432cd50150bff6509e3ff985a40b8763fb /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra | |
parent | add cs scalability case study artifacts (diff) | |
download | VIATRA-Generator-a8eb346fb97b54b6ee693da4840abd8be8b43843.tar.gz VIATRA-Generator-a8eb346fb97b54b6ee693da4840abd8be8b43843.tar.zst VIATRA-Generator-a8eb346fb97b54b6ee693da4840abd8be8b43843.zip |
Add strategy flag + implement alost working crossingScenarioStrategy
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/RelationDefinitionIndexer.xtend | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/RelationDefinitionIndexer.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/RelationDefinitionIndexer.xtend index 338a9af2..0c9612e8 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/RelationDefinitionIndexer.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/RelationDefinitionIndexer.xtend | |||
@@ -11,6 +11,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PDisjunction | |||
11 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQuery | 11 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQuery |
12 | 12 | ||
13 | import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* | 13 | import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* |
14 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation | ||
14 | 15 | ||
15 | class RelationDefinitionIndexer { | 16 | class RelationDefinitionIndexer { |
16 | public val PatternGenerator base; | 17 | public val PatternGenerator base; |
@@ -70,6 +71,19 @@ class RelationDefinitionIndexer { | |||
70 | private def transformPattern(RelationDefinition relation, PQuery p, Modality modality) { | 71 | private def transformPattern(RelationDefinition relation, PQuery p, Modality modality) { |
71 | try { | 72 | try { |
72 | val bodies = (relation.annotations.filter(TransfomedViatraQuery).head.optimizedDisjunction as PDisjunction).bodies | 73 | val bodies = (relation.annotations.filter(TransfomedViatraQuery).head.optimizedDisjunction as PDisjunction).bodies |
74 | |||
75 | //TODO ISSUE if a structural and numeric constraint are ORed in the same pattern | ||
76 | var boolean isCheck = false | ||
77 | for (body : bodies) { | ||
78 | for (constraint : body.constraints) { | ||
79 | if (constraint instanceof ExpressionEvaluation) { | ||
80 | // below not working | ||
81 | // return "" | ||
82 | isCheck = true | ||
83 | } | ||
84 | } | ||
85 | } | ||
86 | |||
73 | return ''' | 87 | return ''' |
74 | private pattern «relationDefinitionName(relation,modality)»( | 88 | private pattern «relationDefinitionName(relation,modality)»( |
75 | problem:LogicProblem, interpretation:PartialInterpretation, | 89 | problem:LogicProblem, interpretation:PartialInterpretation, |
@@ -79,6 +93,7 @@ class RelationDefinitionIndexer { | |||
79 | «FOR constraint : body.constraints» | 93 | «FOR constraint : body.constraints» |
80 | «this.constraintTransformer.transformConstraint(constraint,modality,relation.annotations.filter(TransfomedViatraQuery).head.variableTrace)» | 94 | «this.constraintTransformer.transformConstraint(constraint,modality,relation.annotations.filter(TransfomedViatraQuery).head.variableTrace)» |
81 | «ENDFOR» | 95 | «ENDFOR» |
96 | «IF isCheck»1 == 0;«ENDIF» | ||
82 | }«ENDFOR» | 97 | }«ENDFOR» |
83 | ''' | 98 | ''' |
84 | } catch(UnsupportedOperationException e) { | 99 | } catch(UnsupportedOperationException e) { |