z3 - Keep getting "unknown" result with :pattern usage in SMTLIB v2 input -
i'm encountering problem when using smtlibv2 input format , patterns z3: keep getting result "unknown" following input:
(declare-datatypes () ((l l0 l1))) (declare-fun path () (list l)) (declare-fun checktransition ((list l)) bool) (define-fun iscons ((p (list l))) bool (not (= p nil)) ) ; configuration options :pattern, taken z3 tutorial (set-option :auto-config false) ; disable automatic self configuration (set-option :smt.mbqi false) ; disable model-based quantifier instantiation (assert (iscons path)) (assert (iscons (tail path))) (assert (= nil (tail (tail path)))) (assert (= l0 (head path))) ; initial state constraint (assert (forall ((p (list l))) (! (implies (and (iscons p) (iscons (tail p))) (and (= l0 (head p)) ; transition l0 (= l1 (head (tail p))))) ; l1 :pattern ((checktransition p)) ) ) ) (assert (checktransition path)) (check-sat) (get-model)
i use list represent possible paths through transition system. transition system in case consists of states l0 , l1 linked transition l0 l1. assert statements limit paths such start l0 , of length 2. expect model path (l0 (cons (l1 (cons nil)))).
i tried boil down minimal example still shows problem, resulting in code above. want use pattern implement recursive check on 'path', ensure each 2 consecutive nodes in list comply (transition) constraint. check consecutive cons used stopping condition recursive check. although in example above removed recursive check via checktransition, still not work. whole idea goes article milicevic , kugler in use z3 2.0 , .net api represent model checking problem in such way.
i'm aware pattern instantiation can lead result "unknown", wondering why happens such simple (?) example. using pattern in wrong way achieve quantifier support?
any ideas on problem more welcome!
regards carsten
p.s.: use z3 version 4.3.2 on macos x (10.8.3) mentioned article: milicevic, a. & kugler, h., 2011. model checking using smt , theory of lists. nasa formal methods, pp.282–297.
edit based on comments of mhs:
the problem of not getting model seems occur version 4.3.2 (unstable). did troubleshooting different versions:
- z3 4.3.0 32bit, winxp 32bit, installer
- result: unknown, gives model
- z3 version 4.3.1, git checkout 89c1785b73225a1b363c0e485f854613121b70a7, macos x, self compiled, newest version in master branch....
- result: unknown, gives model
- various other checkouts of master branch, <= 4.3.1 yield same result.
- z3 version 4.3.2, nightly built z3-4.3.2.197b2e8ddb91-x64-osx-10.8.2, macos x...
- result: unknown, gives no model
- z3 version 4.3.2, nightly built z3-4.3.2.96f4606a7f2d-x64-osx-10.8.2, macos x...
- result: unknown, gives no model
interesting?
i tried example on z3 4.3.0 on win 7 x64 , result
unknown (model (define-fun path () (list l) (insert l0 (insert l1 nil))) (define-fun checktransition ((x!1 (list l))) bool (ite (= x!1 (insert l0 (insert l1 nil))) true true)) )
isn't model path
expected?
i assume unknown
because problem under-specified, though cannot put finger on concrete problem. if give z3 refute, example appending
(assert (not (= l1 (head (tail path))))) (check-sat)
to code, you'll unsat
expected.
Comments
Post a Comment