mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 00:55:31 +00:00
Remove usages of Z3_TRUE / Z3_FALSE.
Now that this is all using stdbool.h, we can just use true/false. For now, we leave the aliases in place in z3_api.h.
This commit is contained in:
parent
8b2450aba7
commit
56bbed173e
23 changed files with 188 additions and 189 deletions
|
@ -899,7 +899,7 @@ void prove_example1()
|
|||
/* prove g(x) = g(y) */
|
||||
f = Z3_mk_eq(ctx, gx, gy);
|
||||
printf("prove: x = y implies g(x) = g(y)\n");
|
||||
prove(ctx, s, f, Z3_TRUE);
|
||||
prove(ctx, s, f, true);
|
||||
|
||||
/* create g(g(x)) */
|
||||
ggx = mk_unary_app(ctx, g, gx);
|
||||
|
@ -907,7 +907,7 @@ void prove_example1()
|
|||
/* disprove g(g(x)) = g(y) */
|
||||
f = Z3_mk_eq(ctx, ggx, gy);
|
||||
printf("disprove: x = y implies g(g(x)) = g(y)\n");
|
||||
prove(ctx, s, f, Z3_FALSE);
|
||||
prove(ctx, s, f, false);
|
||||
|
||||
del_solver(ctx, s);
|
||||
Z3_del_context(ctx);
|
||||
|
@ -979,13 +979,13 @@ void prove_example2()
|
|||
/* prove z < 0 */
|
||||
f = Z3_mk_lt(ctx, z, zero);
|
||||
printf("prove: not(g(g(x) - g(y)) = g(z)), x + z <= y <= x implies z < 0\n");
|
||||
prove(ctx, s, f, Z3_TRUE);
|
||||
prove(ctx, s, f, true);
|
||||
|
||||
/* disprove z < -1 */
|
||||
minus_one = mk_int(ctx, -1);
|
||||
f = Z3_mk_lt(ctx, z, minus_one);
|
||||
printf("disprove: not(g(g(x) - g(y)) = g(z)), x + z <= y <= x implies z < -1\n");
|
||||
prove(ctx, s, f, Z3_FALSE);
|
||||
prove(ctx, s, f, false);
|
||||
|
||||
del_solver(ctx, s);
|
||||
Z3_del_context(ctx);
|
||||
|
@ -1131,7 +1131,7 @@ void quantifier_example1()
|
|||
/* prove f(x, y) = f(w, v) implies y = v */
|
||||
p2 = Z3_mk_eq(ctx, y, v);
|
||||
printf("prove: f(x, y) = f(w, v) implies y = v\n");
|
||||
prove(ctx, s, p2, Z3_TRUE);
|
||||
prove(ctx, s, p2, true);
|
||||
|
||||
/* disprove f(x, y) = f(w, v) implies x = w */
|
||||
/* using check2 instead of prove */
|
||||
|
@ -1198,7 +1198,7 @@ void array_example1()
|
|||
thm = Z3_mk_implies(ctx, antecedent, consequent);
|
||||
printf("prove: store(a1, i1, v1) = store(a2, i2, v2) implies (i1 = i3 or i2 = i3 or select(a1, i3) = select(a2, i3))\n");
|
||||
printf("%s\n", Z3_ast_to_string(ctx, thm));
|
||||
prove(ctx, s, thm, Z3_TRUE);
|
||||
prove(ctx, s, thm, true);
|
||||
|
||||
del_solver(ctx, s);
|
||||
Z3_del_context(ctx);
|
||||
|
@ -1339,13 +1339,13 @@ void tuple_example1()
|
|||
eq2 = Z3_mk_eq(ctx, x, one);
|
||||
thm = Z3_mk_implies(ctx, eq1, eq2);
|
||||
printf("prove: get_x(mk_pair(x, y)) = 1 implies x = 1\n");
|
||||
prove(ctx, s, thm, Z3_TRUE);
|
||||
prove(ctx, s, thm, true);
|
||||
|
||||
/* disprove that get_x(mk_pair(x,y)) == 1 implies y = 1*/
|
||||
eq3 = Z3_mk_eq(ctx, y, one);
|
||||
thm = Z3_mk_implies(ctx, eq1, eq3);
|
||||
printf("disprove: get_x(mk_pair(x, y)) = 1 implies y = 1\n");
|
||||
prove(ctx, s, thm, Z3_FALSE);
|
||||
prove(ctx, s, thm, false);
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -1366,12 +1366,12 @@ void tuple_example1()
|
|||
consequent = Z3_mk_eq(ctx, p1, p2);
|
||||
thm = Z3_mk_implies(ctx, antecedent, consequent);
|
||||
printf("prove: get_x(p1) = get_x(p2) and get_y(p1) = get_y(p2) implies p1 = p2\n");
|
||||
prove(ctx, s, thm, Z3_TRUE);
|
||||
prove(ctx, s, thm, true);
|
||||
|
||||
/* disprove that get_x(p1) = get_x(p2) implies p1 = p2 */
|
||||
thm = Z3_mk_implies(ctx, antecedents[0], consequent);
|
||||
printf("disprove: get_x(p1) = get_x(p2) implies p1 = p2\n");
|
||||
prove(ctx, s, thm, Z3_FALSE);
|
||||
prove(ctx, s, thm, false);
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -1390,14 +1390,14 @@ void tuple_example1()
|
|||
consequent = Z3_mk_eq(ctx, x, ten);
|
||||
thm = Z3_mk_implies(ctx, antecedent, consequent);
|
||||
printf("prove: p2 = update(p1, 0, 10) implies get_x(p2) = 10\n");
|
||||
prove(ctx, s, thm, Z3_TRUE);
|
||||
prove(ctx, s, thm, true);
|
||||
|
||||
/* disprove that p2 = update(p1, 0, 10) implies get_y(p2) = 10 */
|
||||
y = mk_unary_app(ctx, get_y_decl, p2);
|
||||
consequent = Z3_mk_eq(ctx, y, ten);
|
||||
thm = Z3_mk_implies(ctx, antecedent, consequent);
|
||||
printf("disprove: p2 = update(p1, 0, 10) implies get_y(p2) = 10\n");
|
||||
prove(ctx, s, thm, Z3_FALSE);
|
||||
prove(ctx, s, thm, false);
|
||||
}
|
||||
|
||||
del_solver(ctx, s);
|
||||
|
@ -1429,7 +1429,7 @@ void bitvector_example1()
|
|||
c2 = Z3_mk_bvsle(ctx, x_minus_ten, zero);
|
||||
thm = Z3_mk_iff(ctx, c1, c2);
|
||||
printf("disprove: x - 10 <= 0 IFF x <= 10 for (32-bit) machine integers\n");
|
||||
prove(ctx, s, thm, Z3_FALSE);
|
||||
prove(ctx, s, thm, false);
|
||||
|
||||
del_solver(ctx, s);
|
||||
Z3_del_context(ctx);
|
||||
|
@ -1717,7 +1717,7 @@ void parser_example3()
|
|||
0, 0, 0,
|
||||
1, &g_name, &g);
|
||||
printf("formula: %s\n", Z3_ast_vector_to_string(ctx, thm));
|
||||
prove(ctx, s, Z3_ast_vector_get(ctx, thm, 0), Z3_TRUE);
|
||||
prove(ctx, s, Z3_ast_vector_get(ctx, thm, 0), true);
|
||||
|
||||
del_solver(ctx, s);
|
||||
Z3_del_context(ctx);
|
||||
|
@ -1781,13 +1781,13 @@ void numeral_example() {
|
|||
n2 = Z3_mk_numeral(ctx, "0.5", real_ty);
|
||||
printf("Numerals n1:%s", Z3_ast_to_string(ctx, n1));
|
||||
printf(" n2:%s\n", Z3_ast_to_string(ctx, n2));
|
||||
prove(ctx, s, Z3_mk_eq(ctx, n1, n2), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_eq(ctx, n1, n2), true);
|
||||
|
||||
n1 = Z3_mk_numeral(ctx, "-1/3", real_ty);
|
||||
n2 = Z3_mk_numeral(ctx, "-0.33333333333333333333333333333333333333333333333333", real_ty);
|
||||
printf("Numerals n1:%s", Z3_ast_to_string(ctx, n1));
|
||||
printf(" n2:%s\n", Z3_ast_to_string(ctx, n2));
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, n1, n2)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, n1, n2)), true);
|
||||
del_solver(ctx, s);
|
||||
Z3_del_context(ctx);
|
||||
}
|
||||
|
@ -1852,14 +1852,14 @@ void enum_example() {
|
|||
orange = Z3_mk_app(ctx, enum_consts[2], 0, 0);
|
||||
|
||||
/* Apples are different from oranges */
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, apple, orange)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, apple, orange)), true);
|
||||
|
||||
/* Apples pass the apple test */
|
||||
prove(ctx, s, Z3_mk_app(ctx, enum_testers[0], 1, &apple), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_app(ctx, enum_testers[0], 1, &apple), true);
|
||||
|
||||
/* Oranges fail the apple test */
|
||||
prove(ctx, s, Z3_mk_app(ctx, enum_testers[0], 1, &orange), Z3_FALSE);
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_app(ctx, enum_testers[0], 1, &orange)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_app(ctx, enum_testers[0], 1, &orange), false);
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_app(ctx, enum_testers[0], 1, &orange)), true);
|
||||
|
||||
fruity = mk_var(ctx, "fruity", fruit);
|
||||
|
||||
|
@ -1868,7 +1868,7 @@ void enum_example() {
|
|||
ors[1] = Z3_mk_eq(ctx, fruity, banana);
|
||||
ors[2] = Z3_mk_eq(ctx, fruity, orange);
|
||||
|
||||
prove(ctx, s, Z3_mk_or(ctx, 3, ors), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_or(ctx, 3, ors), true);
|
||||
|
||||
/* delete logical context */
|
||||
del_solver(ctx, s);
|
||||
|
@ -1900,41 +1900,41 @@ void list_example() {
|
|||
l2 = mk_binary_app(ctx, cons_decl, mk_int(ctx, 2), nil);
|
||||
|
||||
/* nil != cons(1, nil) */
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, nil, l1)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, nil, l1)), true);
|
||||
|
||||
/* cons(2,nil) != cons(1, nil) */
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, l1, l2)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, l1, l2)), true);
|
||||
|
||||
/* cons(x,nil) = cons(y, nil) => x = y */
|
||||
x = mk_var(ctx, "x", int_ty);
|
||||
y = mk_var(ctx, "y", int_ty);
|
||||
l1 = mk_binary_app(ctx, cons_decl, x, nil);
|
||||
l2 = mk_binary_app(ctx, cons_decl, y, nil);
|
||||
prove(ctx, s, Z3_mk_implies(ctx, Z3_mk_eq(ctx,l1,l2), Z3_mk_eq(ctx, x, y)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_implies(ctx, Z3_mk_eq(ctx,l1,l2), Z3_mk_eq(ctx, x, y)), true);
|
||||
|
||||
/* cons(x,u) = cons(x, v) => u = v */
|
||||
u = mk_var(ctx, "u", int_list);
|
||||
v = mk_var(ctx, "v", int_list);
|
||||
l1 = mk_binary_app(ctx, cons_decl, x, u);
|
||||
l2 = mk_binary_app(ctx, cons_decl, y, v);
|
||||
prove(ctx, s, Z3_mk_implies(ctx, Z3_mk_eq(ctx,l1,l2), Z3_mk_eq(ctx, u, v)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_implies(ctx, Z3_mk_eq(ctx,l1,l2), Z3_mk_eq(ctx, x, y)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_implies(ctx, Z3_mk_eq(ctx,l1,l2), Z3_mk_eq(ctx, u, v)), true);
|
||||
prove(ctx, s, Z3_mk_implies(ctx, Z3_mk_eq(ctx,l1,l2), Z3_mk_eq(ctx, x, y)), true);
|
||||
|
||||
/* is_nil(u) or is_cons(u) */
|
||||
ors[0] = Z3_mk_app(ctx, is_nil_decl, 1, &u);
|
||||
ors[1] = Z3_mk_app(ctx, is_cons_decl, 1, &u);
|
||||
prove(ctx, s, Z3_mk_or(ctx, 2, ors), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_or(ctx, 2, ors), true);
|
||||
|
||||
/* occurs check u != cons(x,u) */
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, u, l1)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, u, l1)), true);
|
||||
|
||||
/* destructors: is_cons(u) => u = cons(head(u),tail(u)) */
|
||||
fml1 = Z3_mk_eq(ctx, u, mk_binary_app(ctx, cons_decl, mk_unary_app(ctx, head_decl, u), mk_unary_app(ctx, tail_decl, u)));
|
||||
fml = Z3_mk_implies(ctx, Z3_mk_app(ctx, is_cons_decl, 1, &u), fml1);
|
||||
printf("Formula %s\n", Z3_ast_to_string(ctx, fml));
|
||||
prove(ctx, s, fml, Z3_TRUE);
|
||||
prove(ctx, s, fml, true);
|
||||
|
||||
prove(ctx, s, fml1, Z3_FALSE);
|
||||
prove(ctx, s, fml1, false);
|
||||
|
||||
/* delete logical context */
|
||||
del_solver(ctx, s);
|
||||
|
@ -1982,7 +1982,7 @@ void tree_example() {
|
|||
l2 = mk_binary_app(ctx, cons_decl, l1, nil);
|
||||
|
||||
/* nil != cons(nil, nil) */
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, nil, l1)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, nil, l1)), true);
|
||||
|
||||
/* cons(x,u) = cons(x, v) => u = v */
|
||||
u = mk_var(ctx, "u", cell);
|
||||
|
@ -1991,24 +1991,24 @@ void tree_example() {
|
|||
y = mk_var(ctx, "y", cell);
|
||||
l1 = mk_binary_app(ctx, cons_decl, x, u);
|
||||
l2 = mk_binary_app(ctx, cons_decl, y, v);
|
||||
prove(ctx, s, Z3_mk_implies(ctx, Z3_mk_eq(ctx,l1,l2), Z3_mk_eq(ctx, u, v)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_implies(ctx, Z3_mk_eq(ctx,l1,l2), Z3_mk_eq(ctx, x, y)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_implies(ctx, Z3_mk_eq(ctx,l1,l2), Z3_mk_eq(ctx, u, v)), true);
|
||||
prove(ctx, s, Z3_mk_implies(ctx, Z3_mk_eq(ctx,l1,l2), Z3_mk_eq(ctx, x, y)), true);
|
||||
|
||||
/* is_nil(u) or is_cons(u) */
|
||||
ors[0] = Z3_mk_app(ctx, is_nil_decl, 1, &u);
|
||||
ors[1] = Z3_mk_app(ctx, is_cons_decl, 1, &u);
|
||||
prove(ctx, s, Z3_mk_or(ctx, 2, ors), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_or(ctx, 2, ors), true);
|
||||
|
||||
/* occurs check u != cons(x,u) */
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, u, l1)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, u, l1)), true);
|
||||
|
||||
/* destructors: is_cons(u) => u = cons(car(u),cdr(u)) */
|
||||
fml1 = Z3_mk_eq(ctx, u, mk_binary_app(ctx, cons_decl, mk_unary_app(ctx, car_decl, u), mk_unary_app(ctx, cdr_decl, u)));
|
||||
fml = Z3_mk_implies(ctx, Z3_mk_app(ctx, is_cons_decl, 1, &u), fml1);
|
||||
printf("Formula %s\n", Z3_ast_to_string(ctx, fml));
|
||||
prove(ctx, s, fml, Z3_TRUE);
|
||||
prove(ctx, s, fml, true);
|
||||
|
||||
prove(ctx, s, fml1, Z3_FALSE);
|
||||
prove(ctx, s, fml1, false);
|
||||
|
||||
/* delete logical context */
|
||||
del_solver(ctx, s);
|
||||
|
@ -2100,8 +2100,8 @@ void forest_example() {
|
|||
|
||||
|
||||
/* nil != cons(nil,nil) */
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, nil1, f1)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, nil2, t1)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, nil1, f1)), true);
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, nil2, t1)), true);
|
||||
|
||||
|
||||
/* cons(x,u) = cons(x, v) => u = v */
|
||||
|
@ -2111,16 +2111,16 @@ void forest_example() {
|
|||
y = mk_var(ctx, "y", tree);
|
||||
l1 = mk_binary_app(ctx, cons1_decl, x, u);
|
||||
l2 = mk_binary_app(ctx, cons1_decl, y, v);
|
||||
prove(ctx, s, Z3_mk_implies(ctx, Z3_mk_eq(ctx,l1,l2), Z3_mk_eq(ctx, u, v)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_implies(ctx, Z3_mk_eq(ctx,l1,l2), Z3_mk_eq(ctx, x, y)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_implies(ctx, Z3_mk_eq(ctx,l1,l2), Z3_mk_eq(ctx, u, v)), true);
|
||||
prove(ctx, s, Z3_mk_implies(ctx, Z3_mk_eq(ctx,l1,l2), Z3_mk_eq(ctx, x, y)), true);
|
||||
|
||||
/* is_nil(u) or is_cons(u) */
|
||||
ors[0] = Z3_mk_app(ctx, is_nil1_decl, 1, &u);
|
||||
ors[1] = Z3_mk_app(ctx, is_cons1_decl, 1, &u);
|
||||
prove(ctx, s, Z3_mk_or(ctx, 2, ors), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_or(ctx, 2, ors), true);
|
||||
|
||||
/* occurs check u != cons(x,u) */
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, u, l1)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, u, l1)), true);
|
||||
|
||||
/* delete logical context */
|
||||
del_solver(ctx, s);
|
||||
|
@ -2193,19 +2193,19 @@ void binary_tree_example() {
|
|||
Z3_ast node3 = Z3_mk_app(ctx, node_decl, 3, args3);
|
||||
|
||||
/* prove that nil != node1 */
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, nil, node1)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_not(ctx, Z3_mk_eq(ctx, nil, node1)), true);
|
||||
|
||||
/* prove that nil = left(node1) */
|
||||
prove(ctx, s, Z3_mk_eq(ctx, nil, mk_unary_app(ctx, left_decl, node1)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_eq(ctx, nil, mk_unary_app(ctx, left_decl, node1)), true);
|
||||
|
||||
/* prove that node1 = right(node3) */
|
||||
prove(ctx, s, Z3_mk_eq(ctx, node1, mk_unary_app(ctx, right_decl, node3)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_eq(ctx, node1, mk_unary_app(ctx, right_decl, node3)), true);
|
||||
|
||||
/* prove that !is-nil(node2) */
|
||||
prove(ctx, s, Z3_mk_not(ctx, mk_unary_app(ctx, is_nil_decl, node2)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_not(ctx, mk_unary_app(ctx, is_nil_decl, node2)), true);
|
||||
|
||||
/* prove that value(node2) >= 0 */
|
||||
prove(ctx, s, Z3_mk_ge(ctx, mk_unary_app(ctx, value_decl, node2), mk_int(ctx, 0)), Z3_TRUE);
|
||||
prove(ctx, s, Z3_mk_ge(ctx, mk_unary_app(ctx, value_decl, node2), mk_int(ctx, 0)), true);
|
||||
}
|
||||
|
||||
/* delete logical context */
|
||||
|
@ -2347,7 +2347,7 @@ unsigned assert_retractable_cnstr(Z3_ext_context ctx, Z3_ast c) {
|
|||
ans_lit = Z3_mk_fresh_const(ctx->m_context, "k", ty);
|
||||
result = ctx->m_num_answer_literals;
|
||||
ctx->m_answer_literals[result] = ans_lit;
|
||||
ctx->m_retracted[result] = Z3_FALSE;
|
||||
ctx->m_retracted[result] = false;
|
||||
ctx->m_num_answer_literals++;
|
||||
// assert: c OR (not ans_lit)
|
||||
args[0] = c;
|
||||
|
@ -2363,7 +2363,7 @@ void retract_cnstr(Z3_ext_context ctx, unsigned id) {
|
|||
if (id >= ctx->m_num_answer_literals) {
|
||||
exitf("invalid constraint id.");
|
||||
}
|
||||
ctx->m_retracted[id] = Z3_TRUE;
|
||||
ctx->m_retracted[id] = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2373,7 +2373,7 @@ void reassert_cnstr(Z3_ext_context ctx, unsigned id) {
|
|||
if (id >= ctx->m_num_answer_literals) {
|
||||
exitf("invalid constraint id.");
|
||||
}
|
||||
ctx->m_retracted[id] = Z3_FALSE;
|
||||
ctx->m_retracted[id] = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2387,7 +2387,7 @@ Z3_lbool ext_check(Z3_ext_context ctx) {
|
|||
unsigned core_size;
|
||||
unsigned i;
|
||||
for (i = 0; i < ctx->m_num_answer_literals; i++) {
|
||||
if (ctx->m_retracted[i] == Z3_FALSE) {
|
||||
if (ctx->m_retracted[i] == false) {
|
||||
// Since the answer literal was not retracted, we added it as an assumption.
|
||||
// Recall that we assert (C \/ (not ans_lit)). Therefore, adding ans_lit as an assumption has the effect of "asserting" C.
|
||||
// If the constraint was "retracted" (ctx->m_retracted[i] == Z3_true), then we don't really need to add (not ans_lit) as an assumption.
|
||||
|
@ -2874,8 +2874,8 @@ void mk_model_example() {
|
|||
Z3_ast aPlusBEval = NULL;
|
||||
Z3_bool aPlusBEvalSuccess =
|
||||
Z3_model_eval(ctx, m, aPlusB,
|
||||
/*model_completion=*/Z3_FALSE, &aPlusBEval);
|
||||
if (aPlusBEvalSuccess != Z3_TRUE) {
|
||||
/*model_completion=*/false, &aPlusBEval);
|
||||
if (aPlusBEvalSuccess != true) {
|
||||
printf("Failed to evaluate model\n");
|
||||
exit(1);
|
||||
}
|
||||
|
@ -2884,7 +2884,7 @@ void mk_model_example() {
|
|||
int aPlusBValue = 0;
|
||||
Z3_bool getAPlusBValueSuccess =
|
||||
Z3_get_numeral_int(ctx, aPlusBEval, &aPlusBValue);
|
||||
if (getAPlusBValueSuccess != Z3_TRUE) {
|
||||
if (getAPlusBValueSuccess != true) {
|
||||
printf("Failed to get integer value for a+b\n");
|
||||
exit(1);
|
||||
}
|
||||
|
@ -2908,8 +2908,8 @@ void mk_model_example() {
|
|||
Z3_ast arrayAddEval = NULL;
|
||||
Z3_bool arrayAddEvalSuccess =
|
||||
Z3_model_eval(ctx, m, arrayAdd,
|
||||
/*model_completion=*/Z3_FALSE, &arrayAddEval);
|
||||
if (arrayAddEvalSuccess != Z3_TRUE) {
|
||||
/*model_completion=*/false, &arrayAddEval);
|
||||
if (arrayAddEvalSuccess != true) {
|
||||
printf("Failed to evaluate model\n");
|
||||
exit(1);
|
||||
}
|
||||
|
@ -2917,7 +2917,7 @@ void mk_model_example() {
|
|||
int arrayAddValue = 0;
|
||||
Z3_bool getArrayAddValueSuccess =
|
||||
Z3_get_numeral_int(ctx, arrayAddEval, &arrayAddValue);
|
||||
if (getArrayAddValueSuccess != Z3_TRUE) {
|
||||
if (getArrayAddValueSuccess != true) {
|
||||
printf("Failed to get integer value for c[0] + c[1] + c[2]\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -382,7 +382,7 @@ unsigned get_num_disabled_soft_constraints(Z3_context ctx, Z3_model m, unsigned
|
|||
Z3_ast t = Z3_mk_true(ctx);
|
||||
for (i = 0; i < num_soft_cnstrs; i++) {
|
||||
Z3_ast val;
|
||||
if (Z3_model_eval(ctx, m, aux_vars[i], 1, &val) == Z3_TRUE) {
|
||||
if (Z3_model_eval(ctx, m, aux_vars[i], 1, &val) == true) {
|
||||
// printf("%s", Z3_ast_to_string(ctx, aux_vars[i]));
|
||||
// printf(" -> %s\n", Z3_ast_to_string(ctx, val));
|
||||
if (Z3_is_eq_ast(ctx, val, t)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue