def eval_str(expr, env, solv, m): expr = solver.to_smt_expr(expr, env, solv) v = search.eval_model_expr(m, solv, expr) if v.typ == syntax.boolT: assert v in [syntax.true_term, syntax.false_term] return v.name elif v.typ.kind == "Word": return solver.smt_num(v.val, v.typ.num) else: assert not "type printable", v
def model_sx_word(m, sx): v = search.eval_model(m, sx) assert v.typ.kind == "Word" x = v.val & ((1 << v.typ.num) - 1) return solver.smt_num(x, v.typ.num)