1

Is there any API call in minisat to extract unsat core or any other method for the same.

I want to extract the unsat core for every invocation of the solver and then work on the unsat core.

lava_07
  • 83
  • 1
  • 7
  • Look into minisats `analyzeFinal`. But before putting lots of work into it (understanding it incl. the necessary assumptions), i would recommend looking into [pysat](https://pysathq.github.io/usage.html) first during prototyping. Either as alternative wrapper or for analyzing how they use `analyzeFinal` (might be obfuscated due to patch-heavy install) – sascha Mar 18 '20 at 17:51
  • Unfortunately I am allowed to use only minisat. But what I've done so far is I have labelled each clause with an extra variable say !lbl(negative polarity) and while solving and in assumptions I am assuming lbl (positive) polarity.. so minisat has this vector called conflict.. which has all the lbl of the clauses that are in unsat core! – lava_07 Mar 19 '20 at 03:50

1 Answers1

1

MiniSat is quite an old program at this point. At the very least, you should look into one of the solvers entered into a recent SAT competition, e.g. Glucose. The competitions have required SAT solvers to emit DRAT proofs of unsatisfiability since 2013. Run whichever solver you choose and have it dump its DRAT proof into proof.out. Feed proof.out into the drat-trim utility with the -c option, which will produce an UNSAT core in DIMACS format. I.e.

drat-trim originalproblem.cnf proof.out -c core.cnf

Note that you don't have to use a MiniSat clone; any modern solver that emits DRAT proofs can have its proof fed into drat-trim to yield an UNSAT core.

Kyle Jones
  • 5,492
  • 1
  • 21
  • 30
  • Will surely look into this..Unfortunately I am allowed to use only minisat. But what I've done so far is I have labelled each clause with an extra variable say !lbl(negative polarity) and while solving in assumptions I am assuming lbl (positive) polarity.. so minisat has this vector called conflict.. which has all the lbl of the clauses that are in unsat core! – lava_07 Mar 19 '20 at 03:51