SMT incremental solver with the ability to drop a specific constraint

Is there an incremental SMT solver or API for some incremental SMT solution where I can add constraints in stages, where I can uniquely identify each constraint using some name / s?

The reason I want to uniquely identify the restrictions is because I can delete them later by specifying this name / s. The need to reduce restrictions is due to the fact that my earlier restrictions become irrelevant over time. I see that with Z3 I cannot use the incremental push / pop approach, because it follows a stack based idea, while my requirement is to discard specific early / old restrictions. With another incremental Z3 approach based on assumptions, I would have to run a check-sat format of "(check-sat p1 p2 p3)", i.e. If I had three statements to check, I would need three Boolean constants p1, p2, p3, but in my implementation I would have several thousand statements to check at that time, indirectly requiring thousands of logical constants.I also tested JavaSMT, the Java API for SMT solvers, to find out if the API gives a better way to handle this requirement, but I only see a way to add constraints using "addConstraint" or "push" and could not find a way to remove or remove certain constraints as pop is the only option available.

I would like to know if there is an incremental solver where I can add or remove constraints uniquely identified by names, or an API where there is an alternative way to handle it. I would appreciate any suggestions or comments.

+4
source share
1 answer

The stack-based approach is largely rooted in SMTLib, so I think it will be difficult to find a solver that will do exactly what you want. Although I agree that this will be a nice feature.

, . , . , , check-sat. , . , check-sat, , , . "" . , , , .

, , :

check-sat-

, , , . , , . , :

  (assert complicated_expression)

  ; for each constraint ci, do this:
  (declare-const ci Bool)
  (assert (= ci complicated_expression))
  ; then, check with whatever subset you want
  (check-sat-assuming (ci cj ck..))

, , "", . , , ; . . : https://github.com/Z3Prover/z3/issues/1048

reset -assertions : global-declarations

, check-sat. . , , , . , . :

(set-option :global-declarations true)

- . , "" , . . - , :

 (reset-assertions)
 (assert your-tracked-assertion-1)
 (assert your-tracked-assertion-2)
;(assert your-tracked-assertion-3)  <-- Note the comment, we're skipping
 (assert your-tracked-assertion-4) 
 ..etc

... "" , . , :global-declarations , , , reset-assertions, , .

, , .

- , , . SMTLib , , . . , , - . , , !

. , : Z3?

+4

Source: https://habr.com/ru/post/1678506/


All Articles