I want to eliminate the expressions and convert the final result to cnf using z3, however, there is an error said “(error “tactic failed: operator not supported, apply simplifier before invoking this strategy”)” what’s the problem in the script?
(set-option :produce-models true)
(declare-var t Real)
(declare-var tc Real)
(declare-var t1 Real)
(declare-var t1c Real)
(assert
(and
(not (and (and (<= 0.0 t)(<= 0.0 t1))(= t1c 2.0)(= tc 1.0)))
(not (and (and (<= 0.0 t)(<= 0.0 t1))(< 2.0 t1c)(= tc 1.0)))
(not (and (and (and (<= 0.0 t)(<= 0.0 t1))(< 1.0 tc)) (= t1c 2.0)))
(not (and (and (and (<= 0.0 t)(<= 0.0 t1))(< 1.0 tc)) (< 2.0 t1c)))
(or (and (and (and (<= 0.0 t)(<= 0.0 t1))(<= 0.0 t1c))(<= 0.0 tc)(< tc 1.0))
(and (and (and (<= 0.0 t) (<= 0.0 t1))(<= 0.0 t1c))(< 1.0 tc)(< t1c 2.0))
(and (and (and (<= 0.0 t)(<= 0.0 t1))(< 1.0 tc)) (= t1c 2.0))
(and (and (and (<= 0.0 t) (<= 0.0 t1))(<= 0.0 t1c))
(= tc 1.0)
(or (and (and (and (<= 0.0 t) (<= 0.0 t1))(<= 0.0 t1c))
(< t1c 2.0)
(= tc 1.0)
)
(and (and (<= 0.0 t)(<= 0.0 t1))(= t1c 2.0)(= tc 1.0))
)
)
)
)
)
(apply (then ctx-solver-simplify propagate-values (par-then (repeat (or-else split-clause skip)) propagate-ineqs) tseitin-cnf))
Some tactics (e.g.,
tseitin-cnf) assume that some operators (e.g.,and,distinct, …) have been eliminated. In your example, the problem is the occurrence of the operatorandnested inside the formula. You can eliminate it using the tactic(! simplify :elim-and true).Here is the updated script:
(apply (then (! simplify :elim-and true) ctx-solver-simplify propagate-values (par-then (repeat (or-else split-clause skip)) propagate-ineqs) tseitin-cnf))That being said, in the next release, we will make the tactics such as
tseitin-cnfmore “user friendly”. That is, it will automatically apply the required transformations when needed.