aboutsummaryrefslogtreecommitdiffstats
path: root/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/TypeHierarchyScopePropagator.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/TypeHierarchyScopePropagator.xtend')
-rw-r--r--Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/TypeHierarchyScopePropagator.xtend20
1 files changed, 14 insertions, 6 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/TypeHierarchyScopePropagator.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/TypeHierarchyScopePropagator.xtend
index be8ef00a..d1704b39 100644
--- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/TypeHierarchyScopePropagator.xtend
+++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/TypeHierarchyScopePropagator.xtend
@@ -27,12 +27,16 @@ class TypeHierarchyScopePropagator extends ScopePropagator {
27 } 27 }
28 28
29 private def propagateLowerLimitUp(Scope subScope, Scope superScope) { 29 private def propagateLowerLimitUp(Scope subScope, Scope superScope) {
30 var changed = false
30 if (subScope.minNewElements > superScope.minNewElements) { 31 if (subScope.minNewElements > superScope.minNewElements) {
31 superScope.minNewElements = subScope.minNewElements 32 superScope.minNewElements = subScope.minNewElements
32 return true 33 changed = true
33 } else { 34 }
34 return false 35 if (subScope.minNewElementsHeuristic > superScope.minNewElementsHeuristic) {
36 superScope.minNewElementsHeuristic = subScope.minNewElementsHeuristic
37 changed = true
35 } 38 }
39 changed
36 } 40 }
37 41
38 private def propagateUpperLimitDown(Scope subScope, Scope superScope) { 42 private def propagateUpperLimitDown(Scope subScope, Scope superScope) {
@@ -50,16 +54,20 @@ class TypeHierarchyScopePropagator extends ScopePropagator {
50 } 54 }
51 55
52 private def propagateLowerLimitUp(Scope subScope, PartialInterpretation p) { 56 private def propagateLowerLimitUp(Scope subScope, PartialInterpretation p) {
57 var changed = false
53 if (subScope.minNewElements > p.minNewElements) { 58 if (subScope.minNewElements > p.minNewElements) {
54// println(''' 59// println('''
55// «(subScope.targetTypeInterpretation as PartialComplexTypeInterpretation).interpretationOf.name» -> nodes 60// «(subScope.targetTypeInterpretation as PartialComplexTypeInterpretation).interpretationOf.name» -> nodes
56// p.minNewElements «p.minNewElements» = subScope.minNewElements «subScope.minNewElements» 61// p.minNewElements «p.minNewElements» = subScope.minNewElements «subScope.minNewElements»
57// ''') 62// ''')
58 p.minNewElements = subScope.minNewElements 63 p.minNewElements = subScope.minNewElements
59 return true 64 changed = true
60 } else { 65 }
61 return false 66 if (subScope.minNewElementsHeuristic > p.minNewElementsHeuristic) {
67 p.minNewElementsHeuristic = subScope.minNewElementsHeuristic
68 changed = true
62 } 69 }
70 changed
63 } 71 }
64 72
65 private def propagateUpperLimitDown(Scope subScope, PartialInterpretation p) { 73 private def propagateUpperLimitDown(Scope subScope, PartialInterpretation p) {