Problems Using Z3 for MAX-SAT

I am interested in MAX-SAT and was hoping the Z3 would have this as a built-in function. Are there any plans to do this in the near future?

In the absence of the above, I tried using the maxsat sample application from the command line. Unfortunately, whenever I execute exec.sh "filename.z3", I always get the following answer: "checking if hard constraints are enforceable ... result: 0". What am I doing wrong? I assure you that this answer seems completely independent of the actual contents of the file.

Finally, the comments in the maxsat example do not clearly indicate how to mark restrictions as hard or soft. The hard limit is assumed to be the formula that precedes: the formula and the soft limit is the formula that precedes: the assumption. So, to mark "(assert (> x 0))" as soft, where exactly do we put the "guess"? (I read the request for hard and soft constraints, but the question / answer seemed to be more in the context of finding unsatisfactory kernels, as opposed to "maximally satisfied kernels" of unsatisfactory formulas.)

+3
source share
1 answer

MaxSAT Z3 , MaxSAT Z3 API. - () API , , API- . SMT 1.0. MaxSAT , API C. script , :assumption , :formula . , (> x 0), (> y 0), (< x y) (> x (- y 1)) , (> (+ x y) 0) (< (- x y) 100) . 3. , .

(benchmark ex
  :extrafuns ((x Int))
  :extrafuns ((y Int))
  ;; Soft Constraints
  :assumption (> x 0)
  :assumption (> y 0)
  :assumption (< x y)
  :assumption (> x (- y 1))
  :formula 
  (and 
  ;; Hard Constraints
  (> (+ x y) 0)
  (< (- x y) 100)
))

, MaxSAT Z3 API. MaxSAT API (.NET, Python ++).

+2

All Articles