Sunday, 15 September 2013

z3 - Z3Py: randomized results (phase-selection) not random? -



z3 - Z3Py: randomized results (phase-selection) not random? -

i tried utilize bit vectors randomized results in model values suggested de moura here z3py instead of smtlib. translated illustration to:

from z3 import * s = solver() x = bitvec('x', 16) set_option('auto_config', false) set_option('smt.phase_selection',5) s.add(ult(x,100)) s.check() s.model() s.check() s.model()

however, result seems same, i.e. - repetitive checking s.check() not alter result. - after restart of python interactive shell result of execution same

adding alter of random seed did not alter results: set_option('smt.random_seed', 123)

does have thought why not working desired?

thanks in advance!

carsten

this case simple. it's solved preprocessor , never gets point needs select phase, random phase selection has no effect. leo's reply cited post little bit out of date , z3 has changed, doesn't replicate using latest unstable version because z3 chooses utilize different solver. can still random behavior if forcefulness utilize incremental solver adding (push) command though; here's updated illustration seed dependent:

(set-option :auto_config false) (set-option :smt.phase_selection 5) (set-option :smt.random_seed 456) (declare-const x (_ bitvec 16)) (assert (bvult x (_ bv100 16))) (push) (check-sat) (get-model) ;; seek 1 time again different model (check-sat) (get-model) ;; seek 1 time again different model (check-sat) (get-model)

z3 z3py

No comments:

Post a Comment