Does Z3 simplify () support absorption law?

Suppose I have a BoolExpr in the form

a & (a | b) or a | (a & b) 

and I want to simplify it to

a 

by calling the simplify () function. This does not work.

In addition, to limit the type

(a | b) & (b | a) 

simplify () cannot turn it into its simplest form

(a|b) or (b|a).

Is there a workaround?

@Nikolaj Bjorner: Thanks for your help, and I have one more question:

Here is my initial limitation:

Goal: (goal
  (or (> (type o) 2) (= (type o) 1))
  (or (= (type o) 1) (> (type o) 2)))

Here is the simplified version (ctx-solver-simplify):

(or (= (type o) 1) (not (<= (type o) 2)))

The actual limitation that I expect is the following:

(or (= (type o) 1) (> (type o) 2))

and I do not want to introduce any negation. What should I do?

+4
source share
1 answer

, . , . , . :

(declare-const a Bool)
(declare-const b Bool)
(assert (or a (and a b)))
(apply ctx-solver-simplify)

, . Z3 rise4fun.com .

Ctx-solver-simplify - . . ( ).

+5

All Articles