mirror of
https://github.com/Z3Prover/z3
synced 2025-07-18 02:16:40 +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
43
test/expr_context_simplifier.cpp
Normal file
43
test/expr_context_simplifier.cpp
Normal file
|
@ -0,0 +1,43 @@
|
|||
#include "expr_context_simplifier.h"
|
||||
#include "smtparser.h"
|
||||
#include "ast_pp.h"
|
||||
|
||||
static void simplify_formula(ast_manager& m, expr* e) {
|
||||
expr_ref result(m);
|
||||
expr_context_simplifier simp(m);
|
||||
|
||||
simp(e, result);
|
||||
|
||||
TRACE("expr_context_simplifier",
|
||||
tout
|
||||
<< mk_pp(e, m) << " |-> "
|
||||
<< mk_pp(result.get(), m) << "\n";);
|
||||
|
||||
}
|
||||
|
||||
void tst_expr_context_simplifier() {
|
||||
ast_manager m;
|
||||
|
||||
smtlib::parser* parser = smtlib::parser::create(m);
|
||||
m.register_decl_plugins();
|
||||
|
||||
parser->initialize_smtlib();
|
||||
|
||||
parser->parse_string(
|
||||
"(benchmark samples :logic QF_LIA \n"
|
||||
" :extrafuns ((x Int) (y Int) (z Int) (u Int)) \n"
|
||||
" :formula (and (<= 1 x) (or (<= 1 x) (<= x y))) \n"
|
||||
" :formula (and (<= 2 (ite (<= z 1) (ite (<= z 1) x y) (* 2 x))) (<= x y)) \n"
|
||||
")"
|
||||
);
|
||||
|
||||
smtlib::benchmark* b = parser->get_benchmark();
|
||||
|
||||
smtlib::symtable const * table = b->get_symtable();
|
||||
|
||||
for (unsigned j = 0; j < b->get_num_formulas(); ++j) {
|
||||
simplify_formula(m, b->begin_formulas()[j]);
|
||||
}
|
||||
|
||||
dealloc(parser);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue