smt - Get-assignment in Z3 -


the (get-assignment) command should return list of symbols , true/false value if of sort bool. understanding, can done if :produce-assignments set true, , when (check-sat) returns sat. however, when run small script test on z3, (get-assignment) returns () - blank. here script:

(set-option :produce-assignments true) (set-logic qf_uf) (declare-fun () bool) (declare-fun b () bool) (assert (= b ))  (check-sat) (get-assignment) 

the semantics of get-assignment not intuitive. displays value of named subformulas. smt 2.0 reference (page 62):

get-assignment light-weight , restricted version of get-value asks truth assignment selected set of entered formulas.(29) several other commands discussed (e.g., get-proof), command can issued if produce-assignments option, false default, set true (see section 5.1.7 below). solvers not required support option. get-value, can issued following check- sat command reports sat or, optionally, 1 reports unknown, without intervening assertion-set commands. command returns sequence of pairs (f b) b either true or false , f label of (sub)term of form (t named f) in set of assertions, t of sort bool. get-value, when response of recent check-sat command sat, , then, set of assertions guaranteed have model (in logic) agrees returned truth assignment.

here same example using 2 named subformulas (also available online here):

(set-option :produce-assignments true) (set-logic qf_uf) (declare-fun () bool) (declare-fun b () bool) (assert (! (= (! :named a_val) b ) :named eq_val))  (check-sat) (get-assignment) 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -