User propagators vs. offline lemmas on demand, and clause deletion policies #7109
Replies: 7 comments 5 replies
-
The build-in solvers leverage propagation to cut branches before final check. Only one conflict survives, the first. Maybe a way of filtering conflicts based on conflict level can be adapted, or tagging along more lemmas. Remove note on using add_th_axiom. They are treated differently from lemmas, but do get removed when the scope is popped: z3/src/smt/theory_user_propagator.cpp Line 354 in 736d634 to use add_th_axiom instead. |
Beta Was this translation helpful? Give feedback.
-
We have a new way to avoid this. It is implemented for .Net and OCaml. It gets rid of the reference tracking at the Java level.
Only about clause deletion policy. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I thought about this workaround, but it does feel kinda sketchy. I will try it out and see how it goes though.
The solution confuses me. Doesn't this just put the burden of reference management on the user? I think people are in general not willing to do fine-granular disposal of each formula in a managed language (for large objects like solvers and contexts, this is fine). |
Beta Was this translation helpful? Give feedback.
-
I now tried this approach as follows: I have a PhantomReferences: |
Beta Was this translation helpful? Give feedback.
-
Adding an option to allow you to persist clauses set smt.up.persist_clauses=true |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I recently tried to replace an offline SMT approach (lemmas on demand) by a user propagator and found surprising regression.
In the former approach, we query a full model from the SMT solver, check for theory consistency, and then add new constraints (subsets of the model that are inconsistent) in an incremental fashion.
The user propagator based approach is pretty much the same, but we do the consistency check in the final check callback and raise conflicts on the inconsistent subsets.
On my (unsatisfiable) example benchmark, the former approach does around 350 consistency checks whereas the user propagator needed 5600. Even worse, the solving time goes from 8 seconds to over 9 minutes. From those 9 minutes, less than a minute is spent inside the user propagator itself, so it is not that the propagator itself is inefficient.
I was surprised to see such a high number of consistency checks. I guess this is because the conflict clauses are eligible for deletion. Is there a way to add non-deletable clauses from within the propagator? It seems adding standard clauses to the solver is forbidden.
Also, we raise a lot of conflicts in a single final callback. Does the solver generate conflict clauses for all of them or does he keep only those that, e.g., cause the most backtracking? We frequently observe that the final check is done at decision level 2000+ and afterwards the solver backtracks all the way down to somewhere around level 10.
Beta Was this translation helpful? Give feedback.
All reactions