summaryrefslogtreecommitdiff
path: root/impl/VariableAssignment.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'impl/VariableAssignment.hpp')
-rw-r--r--impl/VariableAssignment.hpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/impl/VariableAssignment.hpp b/impl/VariableAssignment.hpp
index 21226ac..19403a8 100644
--- a/impl/VariableAssignment.hpp
+++ b/impl/VariableAssignment.hpp
@@ -55,15 +55,26 @@ struct DynamicVariableAssignment : public VariableAssignment<Domain> {
return _values[var];
}
- void invalidate(const Variable<Domain>& x) {
+ void invalidate(const Variable<Domain>& x, bool also_solve=true) {
log::fixpoint << indent() << "Invalidating " << x << std::endl;
if (_stable.contains(x)) {
_stable.remove(x);
_values[x] = unknown(infinity<Domain>());
- solve(x);
- if (_values[x] == infinity<Domain>())
- _values[x] = _values[x].asKnown();
+ IdSet<Variable<Domain> > infl = _influence[x];
+ for (typename IdSet<Variable<Domain> >::iterator
+ it = infl.begin(),
+ ei = infl.end();
+ it != ei;
+ ++it) {
+ invalidate(_system.variable(*it), false);
+ }
+
+ if (also_solve) {
+ solve(x);
+ if (_values[x] == infinity<Domain>())
+ _values[x] = _values[x].asKnown();
+ }
}
}