z3 an efficient sat smt solver sat problem
play

Z3: an efficient SAT/SMT solver SAT Problem SAT problem is - PowerPoint PPT Presentation

Z3: an efficient SAT/SMT solver SAT Problem SAT problem is translate in propositional formula that is composed by boolean variables connected by boolean operators: Not, And, Or, ->, <->. If the formula is satisfiable , there is an


  1. Z3: an efficient SAT/SMT solver

  2. SAT Problem SAT problem is translate in propositional formula that is composed by boolean variables ● connected by boolean operators: Not, And, Or, ->, <->. If the formula is satisfiable , there is an assignment that make the results true , otherwise the ● formula in unsat. The solution of the formula are based on the Truth table. The solution on Truth table is exponential ● in the number of variables. SAT is NP-Complete Problem. SAT solvers are successful for a big formula and a lot of practical problems. ●

  3. SMT Theories SMT is Satisfiability Modulo Theories is about SAT extended with other theories ● SMT can add other abstract layers to handle more complicate expressions. ● SMT include the theory of integers, the theory of reals, the theory of arrays, the theory of data ● types, the theory of bit vectors and the theory of the pointers . SMT can be view a language of first order logic. ●

  4. Z3 SAT/SMT Solver (Microsoft Research)

  5. Z3 SMT/SAT Syntax set-logic and/or set-options (often redundant) ● declarations: declare-constant, declare-func ● ( assert…. ) containing the actual formula. ● ( check-sat ) to do the actual sat solving. ● ( get model ) to show the satisfying assignment. ●

  6. Z3 SMT/SAT Variable Example (declare-const a Int) (declare-const b Int) (declare-const c Int) (declare-const d Int) (assert (and (> (* 2 a) (+ b c)) (> (* 2 b) (+ c d)) (> (* 2 c) (* 3 d)) (> (* 3 d) (+ a c)))) (check-sat) (get-model)

  7. Z3 SMT/SAT Functions Example (declare-fun f (Int) Int) (assert (and (> (* 2 (f 1)) (+ (f 2) (f 3))) (> (* 2 (f 2)) (+ (f 3) (f 4))) (> (* 2 (f 3)) (* 3 (f 4))) (> (* 3 (f 4)) (+ (f 1) (f 3))))) (check-sat) (get-model)

  8. Z3 SMT/SAT Big Number Example (declare-const A Int) (declare-const B Int) (declare-const C Int) (assert (and (= A 98798798987987987987987923423) (= B 763429999988888888887364578645) (= (+ (* 87 A) (* 93 B)) (+ C C)))) (check-sat) (get-model)

  9. Z3 SMT/SAT If Statement Example (ite ( < a b ) 13 ( * 3 a )) If a < b return 13 Else return 3 * a

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend