Skip to content

Wrong answer if some unit clauses of variables in e1 level #11

@qmo1222

Description

@qmo1222

Bug Observation

Correct answer for the following test case.

p cnf 5 6
e 1 0
e 3 0
r 0.285714 2 0
r 0.461538 4 0
r 0.307692 5 0
-2 -1 0
2 1 0
1 -4 -3 0
1 4 3 0
-1 -5 -3 0
-1 5 3 0

But if I add a unit clause.

3 0

The answer will be 0 (wrong answer).

However, the following test case will be correct.

p cnf 2 3
e 1 0
r 0.285714 2 0
-2 -1 0
2 1 0
-1 0

Code Modification

I try to fix it by remove line 166 in src/ssat/core/SsatSolver.cc.
And add else condition to line 168~172 as

// save unit clauses
if (lits.size() == 1) {
    unitClause.push();
    lits.copyTo(_unitClause.last());
}
else
    S.addClause_(lits);

This modification makes the above instance correct.
But the solver cannot solve sand-castle benchmarks.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions