1

I found the macro to calculate the maximum value in Z3 Sat Solver.

(define-fun max_integ ((x Int) (y Int)) Int 
    (ite (< x y) y x)) 

How to program the same using C-API in Z3 Sat Solver?

Thank You,

Raj
  • 3,160
  • 7
  • 37
  • 62

1 Answers1

2

The define-fun command is just creating a macro. Note that the SMT 2.0 standard doesn’t allow recursive definitions. Z3 will expand every occurrence of max_integ during parsing time. The command define-fun may be used to make the input file simpler and easier to read, but internally it does not really help Z3. This issue is discussed in the following posts:

Community
  • 1
  • 1
Leonardo de Moura
  • 20,687
  • 2
  • 44
  • 51