different solution for z3 shell and java api -


i tried same assumption in both z3 shell , java api. follows:

(declare-const x (_ bitvec 32))  (assert (not (bvsle (bvadd x #xfffffff8) #x00000000))) (check-sat) (get-model) 

in z3 shell, solution is: x = 9 in z3 api, solution is: x = 0x80000000 in application, prefer shell result. wanna if missed option in api usage.

btw. there option can use control solution value, want more reasonable values. z3 give me big value looking random value.

afaik, model of satisfiable formula can be said chosen @ random in z3.

if reasonable value mean small, in principle optimise on x z3 ensure returned model sets x equal #x00000009. e.g.

(declare-const x (_ bitvec 32))  (assert (not (bvsle (bvadd x #xfffffff8) #x00000000))) (minimize x) (check-sat) (get-model) 

of course might have significant impact on time taken search on harder problems.

this 1 of situations in setting timeout on optimisation search, , still being able retrieve model associated best approximation (if any) of optimal solution, ideal. don't know whether z3 has feature, though.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -