mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
have parser produce ast-vector instead of single ast
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
538411c67f
commit
0ac80fc042
9 changed files with 75 additions and 52 deletions
|
@ -470,7 +470,7 @@ void unsat_core_example2() {
|
|||
// The solver s already contains p1 => F
|
||||
// To disable F, we add (not p1) as an additional assumption
|
||||
qs.push_back(!p1);
|
||||
std::cout << s.check(qs.size(), &qs[0]) << "\n";
|
||||
std::cout << s.check(static_cast<unsigned>(qs.size()), &qs[0]) << "\n";
|
||||
expr_vector core2 = s.unsat_core();
|
||||
std::cout << core2 << "\n";
|
||||
std::cout << "size: " << core2.size() << "\n";
|
||||
|
@ -1136,7 +1136,7 @@ static void parse_example() {
|
|||
func_decl_vector decls(c);
|
||||
sort B = c.bool_sort();
|
||||
decls.push_back(c.function("a", 0, 0, B));
|
||||
expr a = c.parse_string("(assert a)", sorts, decls);
|
||||
expr_vector a = c.parse_string("(assert a)", sorts, decls);
|
||||
std::cout << a << "\n";
|
||||
}
|
||||
|
||||
|
|
|
@ -2632,13 +2632,16 @@ void reference_counter_example() {
|
|||
*/
|
||||
void smt2parser_example() {
|
||||
Z3_context ctx;
|
||||
Z3_ast fs;
|
||||
Z3_ast_vector fs;
|
||||
printf("\nsmt2parser_example\n");
|
||||
LOG_MSG("smt2parser_example");
|
||||
|
||||
ctx = mk_context();
|
||||
fs = Z3_parse_smtlib2_string(ctx, "(declare-fun a () (_ BitVec 8)) (assert (bvuge a #x10)) (assert (bvule a #xf0))", 0, 0, 0, 0, 0, 0);
|
||||
printf("formulas: %s\n", Z3_ast_to_string(ctx, fs));
|
||||
Z3_ast_vector_inc_ref(ctx, fs);
|
||||
printf("formulas: %s\n", Z3_ast_vector_to_string(ctx, fs));
|
||||
Z3_ast_vector_dec_ref(ctx, fs);
|
||||
|
||||
Z3_del_context(ctx);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue