python - Z3: why this array theory usage returns Unsat? -
i trying model memory access array theory. have simple code below (z3 python)
mem = array('mem', bitvecsort(32), bitvecsort(32)) f = true tmp = bitvec('tmp', 32) tmp3 = bitvec('tmp3', 32) f = and(f, tmp3 == select(mem, tmp)) tmp4 = bitvec('tmp4', 32) f = and(f, tmp4 == (tmp3 - 1)) f = and(f, mem == store(mem, tmp, tmp4)) s = solver() s.add(f) print s.check() i want 'sat' result, script returns 'unsat'.
i think because read out mem, write different value it. reason 'unsat'?
if so, how can model memory access using array theory? how fix above script, returns 'sat'?
thanks much.
why expect query return sat?
your query comes down asking z3 find values mem , t such mem[t] = mem[t] - 1, not true of value of mem , t can think of; z3 responds unsat.
if can tell property you're trying satisfy, can formulate correctly.
Comments
Post a Comment