Does Z3 support min function for integer, i.e. return the minimum of two numbers? I failed to find it on Z3’s web site.
Furthermore, does it support some kind of function which could return the minimum of a set of numbers? Something like this:
(assert (= y (min x1 x2 x3 x4 x5))),
where x and y are integers.
Thanks.
minis a reserved keyword for the forthcoming floating point theory.You can use the
define-funcommand to define the macrosmin2(binary),min3(ternary), etc.Here is an example defining
min2,min3andmin4.http://rise4fun.com/Z3/akWje
The SMT 2.0 standard does not support macros with arbitrary number of arguments.
If you prefer, you can use one of the Z3 APIs for doing that. The Python front-end is very flexible. Here is an example in Z3Py.
http://rise4fun.com/Z3Py/Vvp