mirror of
https://github.com/Z3Prover/z3
synced 2025-05-08 00:05:46 +00:00
fix tests
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
0592e76574
commit
fd8fd40669
6 changed files with 285 additions and 601 deletions
|
@ -18,6 +18,8 @@ void tst_api_bug() {
|
|||
Z3_config cfg = Z3_mk_config();
|
||||
Z3_set_param_value(cfg, "MODEL", "true");
|
||||
Z3_context ctx = Z3_mk_context(cfg);
|
||||
Z3_solver s = Z3_mk_solver(ctx);
|
||||
Z3_solver_inc_ref(ctx, s);
|
||||
|
||||
Z3_sort is = Z3_mk_int_sort(ctx);
|
||||
Z3_sort ss = Z3_mk_set_sort(ctx, is);
|
||||
|
@ -32,17 +34,19 @@ void tst_api_bug() {
|
|||
Z3_ast u = Z3_mk_set_union(ctx, 2, uargs);
|
||||
|
||||
Z3_symbol sym = Z3_mk_string_symbol(ctx, "mySet");
|
||||
Z3_ast s = Z3_mk_const(ctx, sym, ss);
|
||||
Z3_ast c = Z3_mk_eq(ctx, s, u);
|
||||
Z3_ast sc = Z3_mk_const(ctx, sym, ss);
|
||||
Z3_ast c = Z3_mk_eq(ctx, sc, u);
|
||||
|
||||
Z3_push(ctx);
|
||||
Z3_assert_cnstr(ctx, c);
|
||||
|
||||
Z3_model m;
|
||||
printf("result %d\n", Z3_check_and_get_model(ctx, &m));
|
||||
Z3_solver_push(ctx, s);
|
||||
Z3_solver_assert(ctx, s, c);
|
||||
|
||||
printf("result %d\n", Z3_solver_check(ctx, s));
|
||||
Z3_model m = Z3_solver_get_model(ctx, s);
|
||||
Z3_string ms = Z3_model_to_string(ctx, m);
|
||||
printf("model : %s\n", ms);
|
||||
Z3_solver_dec_ref(ctx, s);
|
||||
Z3_del_config(cfg);
|
||||
Z3_del_context(ctx);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue