Use Z3 and SMT-LIB to define sqrt function with a real number
问题 How I can write sqrt function in smt-libv2 format. Note: To get a maximum of two values, i found a useful link here: Use Z3 and SMT-LIB to get a maximum of two values. 回答1: Suppose that your formula is quantifier free, then you can define square-roots implicitly by introducing fresh variables and adding constraints. For example you can write: (define-fun is_sqrt ((x Real) (y Real)) Bool (= y (* x x))) Then 'x' is a square root of 'y'; and if you just want the non-negative square roots, then: