aboutsummaryrefslogtreecommitdiffstats
path: root/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/ScopePropagator.xtend
diff options
context:
space:
mode:
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/ScopePropagator.xtend')
-rw-r--r--Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/ScopePropagator.xtend14
1 files changed, 11 insertions, 3 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/ScopePropagator.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/ScopePropagator.xtend
index 132ca8e8..3e95b2cc 100644
--- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/ScopePropagator.xtend
+++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/ScopePropagator.xtend
@@ -60,15 +60,23 @@ class ScopePropagator {
60 } 60 }
61 } 61 }
62 } while (changed) 62 } while (changed)
63 63
64 copyScopeBoundsToHeuristic() 64 copyScopeBoundsToHeuristic()
65 } 65 }
66 66
67 def propagateAllScopeConstraints() { 67 def propagateAllScopeConstraints() {
68 if (!valid) {
69 return
70 }
68 statistics.incrementScopePropagationCount() 71 statistics.incrementScopePropagationCount()
69 doPropagateAllScopeConstraints() 72 doPropagateAllScopeConstraints()
70 } 73 }
71 74
75 def isValid() {
76 partialInterpretation.maxNewElements == -1 ||
77 partialInterpretation.minNewElements <= partialInterpretation.maxNewElements
78 }
79
72 protected def copyScopeBoundsToHeuristic() { 80 protected def copyScopeBoundsToHeuristic() {
73 partialInterpretation.minNewElementsHeuristic = partialInterpretation.minNewElements 81 partialInterpretation.minNewElementsHeuristic = partialInterpretation.minNewElements
74 for (scope : partialInterpretation.scopes) { 82 for (scope : partialInterpretation.scopes) {
@@ -109,7 +117,7 @@ class ScopePropagator {
109// this.partialInterpretation.scopes.forEach[println(''' «(it.targetTypeInterpretation as PartialComplexTypeInterpretation).interpretationOf.name»: «it.minNewElements»-«it.maxNewElements»''')] 117// this.partialInterpretation.scopes.forEach[println(''' «(it.targetTypeInterpretation as PartialComplexTypeInterpretation).interpretationOf.name»: «it.minNewElements»-«it.maxNewElements»''')]
110// println('''All constraints are propagated upon increasing «(t as PartialComplexTypeInterpretation).interpretationOf.name»''') 118// println('''All constraints are propagated upon increasing «(t as PartialComplexTypeInterpretation).interpretationOf.name»''')
111 } 119 }
112 120
113 protected def setScopesInvalid() { 121 protected def setScopesInvalid() {
114 partialInterpretation.minNewElements = Integer.MAX_VALUE 122 partialInterpretation.minNewElements = Integer.MAX_VALUE
115 partialInterpretation.maxNewElements = 0 123 partialInterpretation.maxNewElements = 0