I have been using Z3 to check if terms can be satisfied. But in addition I need to simplify terms for human consumption e.g. when n is an Int simplify And(n>4 , n != 5) to n > 5. Dose any one know how to do this in Z3 or via other tools?
Asked
Active
Viewed 210 times
1
-
1Please, try to read this: http://stackoverflow.com/about. Namely do not ask about: **Questions you haven't tried to find an answer for (show your work!)** – Radim Köhler Jun 21 '13 at 03:01
2 Answers
2
As you probably already noticed Z3 has a simplifier exposed over the API and you can also use it from SMT-LIB. The tutorials on Z3 from rise4fun.com/z3 and rise4fun.com/z3py give several examples of the simplifier. However, the simplifier does not attempt any normal form conversions, so it will unlikely produce results of the style you hint you want. In particular it does not simplify the conjunction And(n > 4, n != 5) to n > 5.

Nikolaj Bjorner
- 8,229
- 14
- 15
0
Possible answer:
n = Int('n')
antecedent = And(n >4, n != 5)
claim1 = n > 5
prove(Implies(antecedent, claim1))
Output:
proved

Juan Ospina
- 1,317
- 1
- 7
- 15