mirror of
https://github.com/Z3Prover/z3
synced 2025-05-05 23:05:46 +00:00
other components
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
e9eab22e5c
commit
68269c43a6
250 changed files with 70871 additions and 0 deletions
59
test/ast_pp.cpp
Normal file
59
test/ast_pp.cpp
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*++
|
||||
Copyright (c) 2006 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
tst_ast_pp.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Test AST Pretty printing module
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2006-10-5
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#include "ast.h"
|
||||
#include "ast_pp.h"
|
||||
#include "ast_dag_pp.h"
|
||||
#include "smtparser.h"
|
||||
#include <iostream>
|
||||
|
||||
void tst_ast_pp()
|
||||
{
|
||||
ast_manager m;
|
||||
smtlib::parser* parser = smtlib::parser::create(m);
|
||||
|
||||
parser->initialize_smtlib();
|
||||
|
||||
|
||||
if (!parser->parse_string(
|
||||
"(benchmark test :extrasorts (A B) :extrafuns ((f A A) (g A A A) (x A) (p A bool)) \n"
|
||||
":formula (p (f x))\n"
|
||||
":extrafuns ((x1 Int) (y1 Int))\n"
|
||||
":formula (<= 1 (+ x1 y1))\n"
|
||||
":formula (let (x (g x x)) (let (x (g x x)) (let (x (g x x)) (let (x (g x x)) (p (g x x))))))\n"
|
||||
":formula (p x)\n"
|
||||
")")) {
|
||||
SASSERT(false);
|
||||
dealloc(parser);
|
||||
return;
|
||||
}
|
||||
|
||||
smtlib::benchmark* b = parser->get_benchmark();
|
||||
|
||||
for (unsigned j = 0; j < b->get_num_assumptions(); ++j) {
|
||||
expr* e = b->get_assumptions()[j];
|
||||
std::cout << mk_pp(e, m) << "\n";
|
||||
ast_dag_pp(std::cout, m, e);
|
||||
}
|
||||
for (unsigned j = 0; j < b->get_num_formulas(); ++j) {
|
||||
expr* e = b->begin_formulas()[j];
|
||||
std::cout << mk_pp(e, m) << "\n";
|
||||
ast_dag_pp(std::cout, m, e);
|
||||
}
|
||||
dealloc(parser);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue