Alexander Tchitchigin
Innosoft LLC
(declare-const x Int)
(declare-const y Int)
(assert (= (+ x y) 10))
(assert (= (+ x (* 2 y)) 20))
(check-sat)
(get-model)Language
Interpretation
Proof
| A | B | (A \/ B) => B |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
(set-logic QF_LIA)
(declare-const x Int)
(declare-const y Int)
(assert (= (- x y) (+ x (- y) 1)))
(check-sat)
; unsat
(exit)(set-logic QF_LIA)
(declare-const x Int)
(declare-const y Int)
(assert (= (+ x (* 2 y)) 20))
(assert (= (- x y) 2))
(check-sat)
; sat
(get-model)
; ((define-fun x () Int 8)
; (define-fun y () Int 6)
; )
(exit); Modeling sequential code in SSA form
;; Buggy swap
; int x, y;
; int t = x;
; y = t;
; x = y;
(set-logic QF_UFLIA)
(declare-fun x (Int) Int)
(declare-fun y (Int) Int)
(declare-fun t (Int) Int)
(assert (= (t 0) (x 0)))
(assert (= (y 1) (t 0)))
(assert (= (x 1) (y 1)))
(assert (not
(and (= (x 1) (y 0))
(= (y 1) (x 0)))))
(check-sat)
(get-model)
; possible returned model:
; (
; (define-fun x ((_ufmt_1 Int)) Int (- 1))
; (define-fun y ((_ufmt_1 Int)) Int (ite (= _ufmt_1 1) (- 1) 2))
; (define-fun t ((_ufmt_1 Int)) Int (- 1))
; )
(exit) CHOO
+ CHOO
-----
TRAINTYPES
• INT_STACK
FUNCTIONS
• put: INT_STACK x INT -> INT_STACK
• remove: INT_STACK -/> INT_STACK
• item: INT_STACK -/> INT
• empty: INT_STACK -> BOOLEAN
• new: INT_STACK
AXIOMS
For any x:INT, s:INT_STACK
• A1 - item(put(s,x)) = x
• A2 - remove(put(s,x)) = s
• A3 - empty(new)
• A4 - not empty(put(s,x))
PRECONDITIONS
• remove(s:INT_STACK) require not empty(s)
• item(s:INT_STACK) require not empty(s)