Gbury / mSAT

A modular sat/smt solver with proof output.
https://gbury.github.io/mSAT/
Apache License 2.0
95 stars 8 forks source link

How to get non-deterministic solutions? #27

Open bergwerf opened 2 years ago

bergwerf commented 2 years ago

I want to use mSAT to solve (a lot of) quite small CNFs (~40 variables), but I want to get non-deterministic solutions (e.g. a uniform pick from the set of solutions). Could I (easily) do that with this library? I appreciate all suggestions :).

Gbury commented 2 years ago

I haven't yet thought about this use-case. Currently, I'd say you can get some amount of non-determinism by randomizing the order in which you add clauses to the solver (which will in turn randomize the order in which the variables are added to the heap, and thus which variables are decided on when there is a tie in the activity score, which is what should happen for all the first decisions, which is likely to significantly influence how the solver will explore the clauses, and thus the solution returned), but I haven't tried it before, so it'd probably be best to try it on some small hand-crafted examples and see whether it works.