mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 19:05:51 +00:00
fix string constant representation in parser
spec1 loopback OK
This commit is contained in:
parent
e48ac4a97a
commit
02345ee5f1
6 changed files with 38 additions and 7 deletions
|
@ -7,8 +7,9 @@
|
|||
void test_print(Z3_context ctx, Z3_ast a) {
|
||||
Z3_set_ast_print_mode(ctx, Z3_PRINT_SMTLIB2_COMPLIANT);
|
||||
char const* spec1 = Z3_benchmark_to_smtlib_string(ctx, "test", 0, 0, 0, 0, 0, a);
|
||||
std::cout << spec1 << "\n";
|
||||
std::cout << "spec1: benchmark->string\n" << spec1 << "\n";
|
||||
|
||||
std::cout << "attempting to parse spec1...\n";
|
||||
Z3_ast b =
|
||||
Z3_parse_smtlib2_string(ctx,
|
||||
spec1,
|
||||
|
@ -18,14 +19,14 @@ void test_print(Z3_context ctx, Z3_ast a) {
|
|||
0,
|
||||
0,
|
||||
0);
|
||||
|
||||
std::cout << "parse successful, converting ast->string\n";
|
||||
char const* spec2 = Z3_ast_to_string(ctx, b);
|
||||
std::cout << spec2 << "\n";
|
||||
std::cout << "spec2: string->ast->string\n" << spec2 << "\n";
|
||||
}
|
||||
|
||||
void test_parseprint(char const* spec) {
|
||||
Z3_context ctx = Z3_mk_context(0);
|
||||
std::cout << spec << "\n";
|
||||
std::cout << "spec:\n" << spec << "\n";
|
||||
|
||||
Z3_ast a =
|
||||
Z3_parse_smtlib2_string(ctx,
|
||||
|
@ -37,8 +38,12 @@ void test_parseprint(char const* spec) {
|
|||
0,
|
||||
0);
|
||||
|
||||
std::cout << "done parsing\n";
|
||||
|
||||
test_print(ctx, a);
|
||||
|
||||
std::cout << "done printing\n";
|
||||
|
||||
Z3_del_context(ctx);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue