From 6d04f19e1c1fbf7714fbb95dc62648ac44b419dd Mon Sep 17 00:00:00 2001 From: Dejan Jovanović Date: Mon, 12 Dec 2011 09:47:37 +0000 Subject: * merging some uf stuff from incremental_work branch that somehow nobody merged-in * since two theories can propagate the same literal minisat now explicitly checks that a propagated literal has not been asserted yet --- src/prop/minisat/core/Solver.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/prop/minisat/core') diff --git a/src/prop/minisat/core/Solver.cc b/src/prop/minisat/core/Solver.cc index 8a883b1cb..e1a8ded8e 100644 --- a/src/prop/minisat/core/Solver.cc +++ b/src/prop/minisat/core/Solver.cc @@ -698,9 +698,18 @@ CRef Solver::propagate(TheoryCheckType type) void Solver::propagateTheory() { std::vector propagatedLiterals; proxy->theoryPropagate(propagatedLiterals); + int oldTrailSize = trail.size(); for (unsigned i = 0, i_end = propagatedLiterals.size(); i < i_end; ++ i) { Debug("minisat") << "Theory propagated: " << propagatedLiterals[i] << std::endl; - uncheckedEnqueue(propagatedLiterals[i], CRef_Lazy); + // multiple theories can propagate the same literal + Lit p = propagatedLiterals[i]; + if (value(p) == l_Undef) { + uncheckedEnqueue(p, CRef_Lazy); + } else { + // but we check that this is the case and that they agree + Assert(trail_index(var(p)) >= oldTrailSize); + Assert(value(p) == lbool(!sign(p))); + } } } -- cgit v1.2.3