mirror of
https://github.com/Z3Prover/z3
synced 2025-08-20 18:20:22 +00:00
using a consistent naming convention for naming tactic subfolders
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
67f5ed46c1
commit
0990a2e045
140 changed files with 14 additions and 12 deletions
47
src/tactic/smtlogics/nra_tactic.cpp
Normal file
47
src/tactic/smtlogics/nra_tactic.cpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
nra_tactic.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for NRA
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-03-13
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#include"tactical.h"
|
||||
#include"simplify_tactic.h"
|
||||
#include"propagate_values_tactic.h"
|
||||
#include"smt_tactic.h"
|
||||
#include"nnf_tactic.h"
|
||||
#include"qe_tactic.h"
|
||||
#include"qfnra_nlsat_tactic.h"
|
||||
#include"probe_arith.h"
|
||||
|
||||
tactic * mk_nra_tactic(ast_manager & m, params_ref const& p) {
|
||||
params_ref p1 = p;
|
||||
p1.set_uint(":seed", 11);
|
||||
p1.set_bool(":factor", false);
|
||||
params_ref p2 = p;
|
||||
p2.set_uint(":seed", 13);
|
||||
p2.set_bool(":factor", false);
|
||||
|
||||
return and_then(mk_simplify_tactic(m, p),
|
||||
mk_nnf_tactic(m, p),
|
||||
mk_propagate_values_tactic(m, p),
|
||||
mk_qe_tactic(m, p),
|
||||
cond(mk_is_qfnra_probe(),
|
||||
or_else(try_for(mk_qfnra_nlsat_tactic(m, p), 5000),
|
||||
try_for(mk_qfnra_nlsat_tactic(m, p1), 10000),
|
||||
mk_qfnra_nlsat_tactic(m, p2)),
|
||||
mk_smt_tactic(p)));
|
||||
}
|
||||
|
||||
|
24
src/tactic/smtlogics/nra_tactic.h
Normal file
24
src/tactic/smtlogics/nra_tactic.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
nra_tactic.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for NRA
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-03-13
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef _NRA_TACTIC_H_
|
||||
#define _NRA_TACTIC_H_
|
||||
|
||||
tactic * mk_nra_tactic(ast_manager & m, params_ref const & p = params_ref());
|
||||
|
||||
#endif
|
65
src/tactic/smtlogics/qfaufbv_tactic.cpp
Normal file
65
src/tactic/smtlogics/qfaufbv_tactic.cpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfaufbv_tactic.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_AUFBV benchmarks.
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-23
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#include"solve_eqs_tactic.h"
|
||||
#include"simplify_tactic.h"
|
||||
#include"propagate_values_tactic.h"
|
||||
#include"bit_blaster_tactic.h"
|
||||
#include"elim_uncnstr_tactic.h"
|
||||
#include"max_bv_sharing_tactic.h"
|
||||
#include"bv_size_reduction_tactic.h"
|
||||
#include"ctx_simplify_tactic.h"
|
||||
#include"sat_tactic.h"
|
||||
#include"smt_tactic.h"
|
||||
|
||||
tactic * mk_qfaufbv_tactic(ast_manager & m, params_ref const & p) {
|
||||
params_ref main_p;
|
||||
main_p.set_bool(":elim-and", true);
|
||||
main_p.set_bool(":sort-store", true);
|
||||
|
||||
params_ref simp2_p = p;
|
||||
simp2_p.set_bool(":som", true);
|
||||
simp2_p.set_bool(":pull-cheap-ite", true);
|
||||
simp2_p.set_bool(":push-ite-bv", false);
|
||||
simp2_p.set_bool(":local-ctx", true);
|
||||
simp2_p.set_uint(":local-ctx-limit", 10000000);
|
||||
|
||||
params_ref ctx_simp_p;
|
||||
ctx_simp_p.set_uint(":max-depth", 32);
|
||||
ctx_simp_p.set_uint(":max-steps", 5000000);
|
||||
|
||||
params_ref solver_p;
|
||||
solver_p.set_bool(":array-old-simplifier", false);
|
||||
|
||||
tactic * preamble_st = and_then(mk_simplify_tactic(m),
|
||||
mk_propagate_values_tactic(m),
|
||||
// using_params(mk_ctx_simplify_tactic(m), ctx_simp_p),
|
||||
mk_solve_eqs_tactic(m),
|
||||
mk_elim_uncnstr_tactic(m),
|
||||
if_no_proofs(if_no_unsat_cores(mk_bv_size_reduction_tactic(m))),
|
||||
using_params(mk_simplify_tactic(m), simp2_p),
|
||||
mk_max_bv_sharing_tactic(m)
|
||||
);
|
||||
|
||||
tactic * st = using_params(and_then(preamble_st,
|
||||
using_params(mk_smt_tactic(), solver_p)),
|
||||
main_p);
|
||||
|
||||
st->updt_params(p);
|
||||
return st;
|
||||
}
|
28
src/tactic/smtlogics/qfaufbv_tactic.h
Normal file
28
src/tactic/smtlogics/qfaufbv_tactic.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfaufbv_tactic.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_AUFBV
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-23
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef _QFAUFBV_TACTIC_H_
|
||||
#define _QFAUFBV_TACTIC_H_
|
||||
|
||||
#include"params.h"
|
||||
class ast_manager;
|
||||
class tactic;
|
||||
|
||||
tactic * mk_qfaufbv_tactic(ast_manager & m, params_ref const & p = params_ref());
|
||||
|
||||
#endif
|
52
src/tactic/smtlogics/qfauflia_tactic.cpp
Normal file
52
src/tactic/smtlogics/qfauflia_tactic.cpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfauflia_tactic.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_AUFLIA
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-21
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#include"tactical.h"
|
||||
#include"simplify_tactic.h"
|
||||
#include"propagate_values_tactic.h"
|
||||
#include"propagate_ineqs_tactic.h"
|
||||
#include"solve_eqs_tactic.h"
|
||||
#include"elim_uncnstr_tactic.h"
|
||||
#include"smt_tactic.h"
|
||||
|
||||
tactic * mk_qfauflia_tactic(ast_manager & m, params_ref const & p) {
|
||||
params_ref main_p;
|
||||
main_p.set_bool(":elim-and", true);
|
||||
main_p.set_bool(":som", true);
|
||||
main_p.set_bool(":sort-store", true);
|
||||
|
||||
params_ref ctx_simp_p;
|
||||
ctx_simp_p.set_uint(":max-depth", 30);
|
||||
ctx_simp_p.set_uint(":max-steps", 5000000);
|
||||
|
||||
params_ref solver_p;
|
||||
solver_p.set_bool(":array-old-simplifier", false);
|
||||
|
||||
tactic * preamble_st = and_then(mk_simplify_tactic(m),
|
||||
mk_propagate_values_tactic(m),
|
||||
mk_solve_eqs_tactic(m),
|
||||
mk_elim_uncnstr_tactic(m),
|
||||
mk_simplify_tactic(m)
|
||||
);
|
||||
|
||||
tactic * st = and_then(using_params(preamble_st, main_p),
|
||||
using_params(mk_smt_tactic(), solver_p));
|
||||
|
||||
st->updt_params(p);
|
||||
return st;
|
||||
}
|
28
src/tactic/smtlogics/qfauflia_tactic.h
Normal file
28
src/tactic/smtlogics/qfauflia_tactic.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfauflia_tactic.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_AUFLIA
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-21
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef _QFAUFLIA_TACTIC_H_
|
||||
#define _QFAUFLIA_TACTIC_H_
|
||||
|
||||
#include"params.h"
|
||||
class ast_manager;
|
||||
class tactic;
|
||||
|
||||
tactic * mk_qfauflia_tactic(ast_manager & m, params_ref const & p = params_ref());
|
||||
|
||||
#endif
|
118
src/tactic/smtlogics/qfbv_tactic.cpp
Normal file
118
src/tactic/smtlogics/qfbv_tactic.cpp
Normal file
|
@ -0,0 +1,118 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfbv_tactic.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_BV based on bit-blasting
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-22
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#include"tactical.h"
|
||||
#include"simplify_tactic.h"
|
||||
#include"propagate_values_tactic.h"
|
||||
#include"solve_eqs_tactic.h"
|
||||
#include"elim_uncnstr_tactic.h"
|
||||
#include"smt_tactic.h"
|
||||
#include"bit_blaster_tactic.h"
|
||||
#include"bv1_blaster_tactic.h"
|
||||
#include"max_bv_sharing_tactic.h"
|
||||
#include"bv_size_reduction_tactic.h"
|
||||
#include"aig_tactic.h"
|
||||
#include"sat_tactic.h"
|
||||
|
||||
#define MEMLIMIT 300
|
||||
|
||||
tactic * mk_qfbv_tactic(ast_manager & m, params_ref const & p) {
|
||||
params_ref main_p;
|
||||
main_p.set_bool(":elim-and", true);
|
||||
main_p.set_bool(":push-ite-bv", true);
|
||||
main_p.set_bool(":blast-distinct", true);
|
||||
|
||||
params_ref simp2_p = p;
|
||||
simp2_p.set_bool(":som", true);
|
||||
simp2_p.set_bool(":pull-cheap-ite", true);
|
||||
simp2_p.set_bool(":push-ite-bv", false);
|
||||
simp2_p.set_bool(":local-ctx", true);
|
||||
simp2_p.set_uint(":local-ctx-limit", 10000000);
|
||||
|
||||
params_ref local_ctx_p = p;
|
||||
local_ctx_p.set_bool(":local-ctx", true);
|
||||
|
||||
params_ref solver_p;
|
||||
solver_p.set_bool(":preprocess", false); // preprocessor of smt::context is not needed.
|
||||
|
||||
params_ref no_flat_p;
|
||||
no_flat_p.set_bool(":flat", false);
|
||||
|
||||
params_ref ctx_simp_p;
|
||||
ctx_simp_p.set_uint(":max-depth", 32);
|
||||
ctx_simp_p.set_uint(":max-steps", 50000000);
|
||||
|
||||
params_ref hoist_p;
|
||||
hoist_p.set_bool(":hoist-mul", true);
|
||||
hoist_p.set_bool(":som", false);
|
||||
|
||||
params_ref solve_eq_p;
|
||||
// conservative guassian elimination.
|
||||
solve_eq_p.set_uint(":solve-eqs-max-occs", 2);
|
||||
|
||||
params_ref big_aig_p;
|
||||
big_aig_p.set_bool(":aig-per-assertion", false);
|
||||
|
||||
tactic * preamble_st = and_then(and_then(mk_simplify_tactic(m),
|
||||
mk_propagate_values_tactic(m),
|
||||
using_params(mk_solve_eqs_tactic(m), solve_eq_p),
|
||||
mk_elim_uncnstr_tactic(m),
|
||||
if_no_proofs(if_no_unsat_cores(mk_bv_size_reduction_tactic(m))),
|
||||
using_params(mk_simplify_tactic(m), simp2_p)),
|
||||
// Z3 can solve a couple of extra benchmarks by using :hoist-mul
|
||||
// but the timeout in SMT-COMP is too small.
|
||||
// Moreover, it impacted negatively some easy benchmarks.
|
||||
// We should decide later, if we keep it or not.
|
||||
using_params(mk_simplify_tactic(m), hoist_p),
|
||||
mk_max_bv_sharing_tactic(m));
|
||||
|
||||
#ifdef USE_OLD_SAT_SOLVER
|
||||
tactic * new_sat = and_then(mk_simplify_tactic(m),
|
||||
mk_smt_tactic());
|
||||
#else
|
||||
tactic * new_sat = cond(mk_or(mk_produce_proofs_probe(), mk_produce_unsat_cores_probe()),
|
||||
and_then(mk_simplify_tactic(m),
|
||||
mk_smt_tactic()),
|
||||
mk_sat_tactic(m));
|
||||
#endif
|
||||
|
||||
tactic * st = using_params(and_then(preamble_st,
|
||||
// If the user sets HI_DIV0=false, then the formula may contain uninterpreted function
|
||||
// symbols. In this case, we should not use
|
||||
cond(mk_is_qfbv_probe(),
|
||||
cond(mk_is_qfbv_eq_probe(),
|
||||
and_then(mk_bv1_blaster_tactic(m),
|
||||
using_params(mk_smt_tactic(), solver_p)),
|
||||
and_then(mk_bit_blaster_tactic(m),
|
||||
when(mk_lt(mk_memory_probe(), mk_const_probe(MEMLIMIT)),
|
||||
and_then(using_params(and_then(mk_simplify_tactic(m),
|
||||
mk_solve_eqs_tactic(m)),
|
||||
local_ctx_p),
|
||||
if_no_proofs(cond(mk_produce_unsat_cores_probe(),
|
||||
mk_aig_tactic(),
|
||||
using_params(mk_aig_tactic(),
|
||||
big_aig_p))))),
|
||||
new_sat)),
|
||||
mk_smt_tactic())),
|
||||
main_p);
|
||||
|
||||
st->updt_params(p);
|
||||
return st;
|
||||
}
|
||||
|
||||
|
28
src/tactic/smtlogics/qfbv_tactic.h
Normal file
28
src/tactic/smtlogics/qfbv_tactic.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfbv_tactic.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_BV based on bit-blasting
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-22
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef _QFBV_TACTIC_
|
||||
#define _QFBV_TACTIC_
|
||||
|
||||
#include"params.h"
|
||||
class ast_manager;
|
||||
class tactic;
|
||||
|
||||
tactic * mk_qfbv_tactic(ast_manager & m, params_ref const & p = params_ref());
|
||||
|
||||
#endif
|
111
src/tactic/smtlogics/qfidl_tactic.cpp
Normal file
111
src/tactic/smtlogics/qfidl_tactic.cpp
Normal file
|
@ -0,0 +1,111 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfidl_tactic.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_IDL
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-21
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#include"tactical.h"
|
||||
#include"simplify_tactic.h"
|
||||
#include"propagate_values_tactic.h"
|
||||
#include"propagate_ineqs_tactic.h"
|
||||
#include"solve_eqs_tactic.h"
|
||||
#include"elim_uncnstr_tactic.h"
|
||||
#include"normalize_bounds_tactic.h"
|
||||
#include"fix_dl_var_tactic.h"
|
||||
#include"smt_tactic.h"
|
||||
#include"lia2pb_tactic.h"
|
||||
#include"pb2bv_tactic.h"
|
||||
#include"diff_neq_tactic.h"
|
||||
#include"bit_blaster_tactic.h"
|
||||
#include"max_bv_sharing_tactic.h"
|
||||
#include"aig_tactic.h"
|
||||
#include"sat_tactic.h"
|
||||
|
||||
#define BIG_PROBLEM 5000
|
||||
|
||||
tactic * mk_qfidl_tactic(ast_manager & m, params_ref const & p) {
|
||||
params_ref main_p;
|
||||
main_p.set_bool(":elim-and", true);
|
||||
main_p.set_bool(":blast-distinct", true);
|
||||
main_p.set_bool(":som", true);
|
||||
|
||||
params_ref lhs_p;
|
||||
lhs_p.set_bool(":arith-lhs", true);
|
||||
|
||||
params_ref lia2pb_p;
|
||||
lia2pb_p.set_uint(":lia2pb-max-bits", 4);
|
||||
|
||||
params_ref pb2bv_p;
|
||||
pb2bv_p.set_uint(":pb2bv-all-clauses-limit", 8);
|
||||
|
||||
params_ref pull_ite_p;
|
||||
pull_ite_p.set_bool(":pull-cheap-ite", true);
|
||||
pull_ite_p.set_bool(":local-ctx", true);
|
||||
pull_ite_p.set_uint(":local-ctx-limit", 10000000);
|
||||
|
||||
tactic * preamble_st = and_then(and_then(mk_simplify_tactic(m),
|
||||
mk_fix_dl_var_tactic(m),
|
||||
mk_propagate_values_tactic(m),
|
||||
mk_elim_uncnstr_tactic(m)
|
||||
),
|
||||
and_then(mk_solve_eqs_tactic(m),
|
||||
using_params(mk_simplify_tactic(m), lhs_p),
|
||||
mk_propagate_values_tactic(m),
|
||||
mk_normalize_bounds_tactic(m),
|
||||
mk_solve_eqs_tactic(m)));
|
||||
|
||||
|
||||
|
||||
params_ref bv_solver_p;
|
||||
// The cardinality constraint encoding generates a lot of shared if-then-else's that can be flattened.
|
||||
// Several of them are simplified to and/or. If we flat them, we increase a lot the memory consumption.
|
||||
bv_solver_p.set_bool(":flat", false);
|
||||
bv_solver_p.set_bool(":som", false);
|
||||
// dynamic psm seems to work well.
|
||||
bv_solver_p.set_sym(":gc-strategy", symbol("dyn-psm"));
|
||||
|
||||
tactic * bv_solver = using_params(and_then(mk_simplify_tactic(m),
|
||||
mk_propagate_values_tactic(m),
|
||||
mk_solve_eqs_tactic(m),
|
||||
mk_max_bv_sharing_tactic(m),
|
||||
mk_bit_blaster_tactic(m),
|
||||
mk_aig_tactic(),
|
||||
mk_sat_tactic(m)),
|
||||
bv_solver_p);
|
||||
|
||||
tactic * try2bv =
|
||||
and_then(using_params(mk_lia2pb_tactic(m), lia2pb_p),
|
||||
mk_propagate_ineqs_tactic(m),
|
||||
using_params(mk_pb2bv_tactic(m), pb2bv_p),
|
||||
fail_if(mk_not(mk_is_qfbv_probe())),
|
||||
bv_solver);
|
||||
|
||||
params_ref diff_neq_p;
|
||||
diff_neq_p.set_uint(":diff-neq-max-k", 25);
|
||||
|
||||
tactic * st = cond(mk_and(mk_lt(mk_num_consts_probe(), mk_const_probe(static_cast<double>(BIG_PROBLEM))),
|
||||
mk_and(mk_not(mk_produce_proofs_probe()),
|
||||
mk_not(mk_produce_unsat_cores_probe()))),
|
||||
using_params(and_then(preamble_st,
|
||||
or_else(using_params(mk_diff_neq_tactic(m), diff_neq_p),
|
||||
try2bv,
|
||||
mk_smt_tactic())),
|
||||
main_p),
|
||||
mk_smt_tactic());
|
||||
|
||||
st->updt_params(p);
|
||||
|
||||
return st;
|
||||
}
|
28
src/tactic/smtlogics/qfidl_tactic.h
Normal file
28
src/tactic/smtlogics/qfidl_tactic.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfidl_tactic.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_IDL
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-21
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef _QFIDL_TACTIC_H_
|
||||
#define _QFIDL_TACTIC_H_
|
||||
|
||||
#include"params.h"
|
||||
class ast_manager;
|
||||
class tactic;
|
||||
|
||||
tactic * mk_qfidl_tactic(ast_manager & m, params_ref const & p = params_ref());
|
||||
|
||||
#endif
|
219
src/tactic/smtlogics/qflia_tactic.cpp
Normal file
219
src/tactic/smtlogics/qflia_tactic.cpp
Normal file
|
@ -0,0 +1,219 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qflia_tactic.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_LIA
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-26
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#include"tactical.h"
|
||||
#include"simplify_tactic.h"
|
||||
#include"propagate_values_tactic.h"
|
||||
#include"propagate_ineqs_tactic.h"
|
||||
#include"normalize_bounds_tactic.h"
|
||||
#include"solve_eqs_tactic.h"
|
||||
#include"elim_uncnstr_tactic.h"
|
||||
#include"smt_tactic.h"
|
||||
// include"mip_tactic.h"
|
||||
#include"add_bounds_tactic.h"
|
||||
#include"pb2bv_tactic.h"
|
||||
#include"lia2pb_tactic.h"
|
||||
#include"ctx_simplify_tactic.h"
|
||||
#include"bit_blaster_tactic.h"
|
||||
#include"max_bv_sharing_tactic.h"
|
||||
#include"aig_tactic.h"
|
||||
#include"sat_tactic.h"
|
||||
#include"bound_manager.h"
|
||||
#include"probe_arith.h"
|
||||
|
||||
struct quasi_pb_probe : public probe {
|
||||
virtual result operator()(goal const & g) {
|
||||
bool found_non_01 = false;
|
||||
bound_manager bm(g.m());
|
||||
bm(g);
|
||||
rational l, u; bool st;
|
||||
bound_manager::iterator it = bm.begin();
|
||||
bound_manager::iterator end = bm.end();
|
||||
for (; it != end; ++it) {
|
||||
expr * t = *it;
|
||||
if (bm.has_lower(t, l, st) && bm.has_upper(t, u, st) && (l.is_zero() || l.is_one()) && (u.is_zero() || u.is_one()))
|
||||
continue;
|
||||
if (found_non_01)
|
||||
return false;
|
||||
found_non_01 = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
probe * mk_quasi_pb_probe() {
|
||||
return mk_and(mk_not(mk_is_unbounded_probe()),
|
||||
alloc(quasi_pb_probe));
|
||||
}
|
||||
|
||||
// Create SMT solver that does not use cuts
|
||||
static tactic * mk_no_cut_smt_tactic(unsigned rs) {
|
||||
params_ref solver_p;
|
||||
solver_p.set_uint(":arith-branch-cut-ratio", 10000000);
|
||||
solver_p.set_uint(":random-seed", rs);
|
||||
return using_params(mk_smt_tactic_using(false), solver_p);
|
||||
}
|
||||
|
||||
// Create SMT solver that does not use cuts
|
||||
static tactic * mk_no_cut_no_relevancy_smt_tactic(unsigned rs) {
|
||||
params_ref solver_p;
|
||||
solver_p.set_uint(":arith-branch-cut-ratio", 10000000);
|
||||
solver_p.set_uint(":random-seed", rs);
|
||||
solver_p.set_uint(":relevancy", 0);
|
||||
return using_params(mk_smt_tactic_using(false), solver_p);
|
||||
}
|
||||
|
||||
static tactic * mk_bv2sat_tactic(ast_manager & m) {
|
||||
params_ref solver_p;
|
||||
// The cardinality constraint encoding generates a lot of shared if-then-else's that can be flattened.
|
||||
// Several of them are simplified to and/or. If we flat them, we increase a lot the memory consumption.
|
||||
solver_p.set_bool(":flat", false);
|
||||
solver_p.set_bool(":som", false);
|
||||
// dynamic psm seems to work well.
|
||||
solver_p.set_sym(":gc-strategy", symbol("dyn-psm"));
|
||||
|
||||
return using_params(and_then(mk_simplify_tactic(m),
|
||||
mk_propagate_values_tactic(m),
|
||||
mk_solve_eqs_tactic(m),
|
||||
mk_max_bv_sharing_tactic(m),
|
||||
mk_bit_blaster_tactic(m),
|
||||
mk_aig_tactic(),
|
||||
mk_sat_tactic(m)),
|
||||
solver_p);
|
||||
}
|
||||
|
||||
#define SMALL_SIZE 80000
|
||||
|
||||
static tactic * mk_pb_tactic(ast_manager & m) {
|
||||
params_ref pb2bv_p;
|
||||
pb2bv_p.set_bool(":ite-extra", true);
|
||||
pb2bv_p.set_uint(":pb2bv-all-clauses-limit", 8);
|
||||
|
||||
return and_then(fail_if_not(mk_is_pb_probe()),
|
||||
fail_if(mk_produce_proofs_probe()),
|
||||
fail_if(mk_produce_unsat_cores_probe()),
|
||||
or_else(and_then(fail_if(mk_ge(mk_num_exprs_probe(), mk_const_probe(SMALL_SIZE))),
|
||||
fail_if_not(mk_is_ilp_probe()),
|
||||
// try_for(mk_mip_tactic(m), 8000),
|
||||
mk_fail_if_undecided_tactic()),
|
||||
and_then(using_params(mk_pb2bv_tactic(m), pb2bv_p),
|
||||
fail_if_not(mk_is_qfbv_probe()),
|
||||
mk_bv2sat_tactic(m))));
|
||||
}
|
||||
|
||||
|
||||
static tactic * mk_lia2sat_tactic(ast_manager & m) {
|
||||
params_ref pb2bv_p;
|
||||
pb2bv_p.set_bool(":ite-extra", true);
|
||||
pb2bv_p.set_uint(":pb2bv-all-clauses-limit", 8);
|
||||
|
||||
return and_then(fail_if(mk_is_unbounded_probe()),
|
||||
fail_if(mk_produce_proofs_probe()),
|
||||
fail_if(mk_produce_unsat_cores_probe()),
|
||||
mk_propagate_ineqs_tactic(m),
|
||||
mk_normalize_bounds_tactic(m),
|
||||
mk_lia2pb_tactic(m),
|
||||
using_params(mk_pb2bv_tactic(m), pb2bv_p),
|
||||
fail_if_not(mk_is_qfbv_probe()),
|
||||
mk_bv2sat_tactic(m));
|
||||
}
|
||||
|
||||
// Try to find a model for an unbounded ILP problem.
|
||||
// Fails if the problem is no ILP.
|
||||
static tactic * mk_ilp_model_finder_tactic(ast_manager & m) {
|
||||
params_ref add_bounds_p1;
|
||||
add_bounds_p1.set_rat(":add-bound-lower", rational(-16));
|
||||
add_bounds_p1.set_rat(":add-bound-upper", rational(15));
|
||||
params_ref add_bounds_p2;
|
||||
add_bounds_p2.set_rat(":add-bound-lower", rational(-32));
|
||||
add_bounds_p2.set_rat(":add-bound-upper", rational(31));
|
||||
|
||||
return and_then(fail_if_not(mk_and(mk_is_ilp_probe(), mk_is_unbounded_probe())),
|
||||
fail_if(mk_produce_proofs_probe()),
|
||||
fail_if(mk_produce_unsat_cores_probe()),
|
||||
mk_propagate_ineqs_tactic(m),
|
||||
or_else(// try_for(mk_mip_tactic(m), 5000),
|
||||
try_for(mk_no_cut_smt_tactic(100), 2000),
|
||||
and_then(using_params(mk_add_bounds_tactic(m), add_bounds_p1),
|
||||
try_for(mk_lia2sat_tactic(m), 5000)),
|
||||
try_for(mk_no_cut_smt_tactic(200), 5000),
|
||||
and_then(using_params(mk_add_bounds_tactic(m), add_bounds_p2),
|
||||
try_for(mk_lia2sat_tactic(m), 10000))
|
||||
// , mk_mip_tactic(m)
|
||||
),
|
||||
mk_fail_if_undecided_tactic());
|
||||
}
|
||||
|
||||
static tactic * mk_bounded_tactic(ast_manager & m) {
|
||||
return and_then(fail_if(mk_is_unbounded_probe()),
|
||||
or_else(try_for(mk_no_cut_smt_tactic(100), 5000),
|
||||
try_for(mk_no_cut_no_relevancy_smt_tactic(200), 5000),
|
||||
try_for(mk_no_cut_smt_tactic(300), 15000)
|
||||
),
|
||||
mk_fail_if_undecided_tactic());
|
||||
}
|
||||
|
||||
tactic * mk_qflia_tactic(ast_manager & m, params_ref const & p) {
|
||||
params_ref main_p;
|
||||
main_p.set_bool(":elim-and", true);
|
||||
main_p.set_bool(":som", true);
|
||||
// main_p.set_bool(":push-ite-arith", true);
|
||||
|
||||
params_ref pull_ite_p;
|
||||
pull_ite_p.set_bool(":pull-cheap-ite", true);
|
||||
pull_ite_p.set_bool(":push-ite-arith", false);
|
||||
pull_ite_p.set_bool(":local-ctx", true);
|
||||
pull_ite_p.set_uint(":local-ctx-limit", 10000000);
|
||||
|
||||
params_ref ctx_simp_p;
|
||||
ctx_simp_p.set_uint(":max-depth", 30);
|
||||
ctx_simp_p.set_uint(":max-steps", 5000000);
|
||||
|
||||
params_ref lhs_p;
|
||||
lhs_p.set_bool(":arith-lhs", true);
|
||||
|
||||
tactic * preamble_st = and_then(and_then(mk_simplify_tactic(m),
|
||||
mk_propagate_values_tactic(m),
|
||||
using_params(mk_ctx_simplify_tactic(m), ctx_simp_p),
|
||||
using_params(mk_simplify_tactic(m), pull_ite_p)),
|
||||
mk_solve_eqs_tactic(m),
|
||||
mk_elim_uncnstr_tactic(m),
|
||||
using_params(mk_simplify_tactic(m), lhs_p)
|
||||
);
|
||||
|
||||
params_ref quasi_pb_p;
|
||||
quasi_pb_p.set_uint(":lia2pb-max-bits", 64);
|
||||
|
||||
params_ref no_cut_p;
|
||||
no_cut_p.set_uint(":arith-branch-cut-ratio", 10000000);
|
||||
|
||||
|
||||
tactic * st = using_params(and_then(preamble_st,
|
||||
or_else(mk_ilp_model_finder_tactic(m),
|
||||
mk_pb_tactic(m),
|
||||
and_then(fail_if_not(mk_quasi_pb_probe()),
|
||||
using_params(mk_lia2sat_tactic(m), quasi_pb_p),
|
||||
mk_fail_if_undecided_tactic()),
|
||||
mk_bounded_tactic(m),
|
||||
mk_smt_tactic())),
|
||||
main_p);
|
||||
|
||||
st->updt_params(p);
|
||||
return st;
|
||||
}
|
||||
|
28
src/tactic/smtlogics/qflia_tactic.h
Normal file
28
src/tactic/smtlogics/qflia_tactic.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qflia_tactic.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_LRA
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-26
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef _QFLIA_TACTIC_
|
||||
#define _QFLIA_TACTIC_
|
||||
|
||||
#include"params.h"
|
||||
class ast_manager;
|
||||
class tactic;
|
||||
|
||||
tactic * mk_qflia_tactic(ast_manager & m, params_ref const & p = params_ref());
|
||||
|
||||
#endif
|
76
src/tactic/smtlogics/qflra_tactic.cpp
Normal file
76
src/tactic/smtlogics/qflra_tactic.cpp
Normal file
|
@ -0,0 +1,76 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qflra_tactic.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_LRA
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-26
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#include"tactical.h"
|
||||
#include"simplify_tactic.h"
|
||||
#include"propagate_values_tactic.h"
|
||||
#include"solve_eqs_tactic.h"
|
||||
#include"elim_uncnstr_tactic.h"
|
||||
#include"smt_tactic.h"
|
||||
// include"mip_tactic.h"
|
||||
#include"recover_01_tactic.h"
|
||||
#include"ctx_simplify_tactic.h"
|
||||
#include"probe_arith.h"
|
||||
|
||||
tactic * mk_qflra_tactic(ast_manager & m, params_ref const & p) {
|
||||
params_ref pivot_p;
|
||||
pivot_p.set_bool(":arith-greatest-error-pivot", true);
|
||||
|
||||
params_ref main_p = p;
|
||||
main_p.set_bool(":elim-and", true);
|
||||
main_p.set_bool(":som", true);
|
||||
main_p.set_bool(":blast-distinct", true);
|
||||
|
||||
params_ref ctx_simp_p;
|
||||
ctx_simp_p.set_uint(":max-depth", 30);
|
||||
ctx_simp_p.set_uint(":max-steps", 5000000);
|
||||
|
||||
params_ref lhs_p;
|
||||
lhs_p.set_bool(":arith-lhs", true);
|
||||
lhs_p.set_bool(":eq2ineq", true);
|
||||
|
||||
params_ref elim_to_real_p;
|
||||
elim_to_real_p.set_bool(":elim-to-real", true);
|
||||
|
||||
|
||||
#if 0
|
||||
tactic * mip =
|
||||
and_then(fail_if(mk_produce_proofs_probe()),
|
||||
fail_if(mk_produce_unsat_cores_probe()),
|
||||
using_params(and_then(and_then(mk_simplify_tactic(m),
|
||||
mk_recover_01_tactic(m),
|
||||
using_params(mk_simplify_tactic(m), elim_to_real_p),
|
||||
mk_propagate_values_tactic(m)),
|
||||
using_params(mk_ctx_simplify_tactic(m), ctx_simp_p),
|
||||
mk_elim_uncnstr_tactic(m),
|
||||
mk_solve_eqs_tactic(m),
|
||||
using_params(mk_simplify_tactic(m), lhs_p),
|
||||
using_params(mk_simplify_tactic(m), elim_to_real_p)
|
||||
),
|
||||
main_p),
|
||||
fail_if(mk_not(mk_is_mip_probe())),
|
||||
try_for(mk_mip_tactic(m), 30000),
|
||||
mk_fail_if_undecided_tactic());
|
||||
#endif
|
||||
|
||||
// return using_params(or_else(mip,
|
||||
// using_params(mk_smt_tactic(), pivot_p)),
|
||||
// p);
|
||||
|
||||
return using_params(using_params(mk_smt_tactic(), pivot_p), p);
|
||||
}
|
28
src/tactic/smtlogics/qflra_tactic.h
Normal file
28
src/tactic/smtlogics/qflra_tactic.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qflra_tactic.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_LRA
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-26
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef _QFLRA_TACTIC_
|
||||
#define _QFLRA_TACTIC_
|
||||
|
||||
#include"params.h"
|
||||
class ast_manager;
|
||||
class tactic;
|
||||
|
||||
tactic * mk_qflra_tactic(ast_manager & m, params_ref const & p = params_ref());
|
||||
|
||||
#endif
|
93
src/tactic/smtlogics/qfnia_tactic.cpp
Normal file
93
src/tactic/smtlogics/qfnia_tactic.cpp
Normal file
|
@ -0,0 +1,93 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qflia_tactic.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_NIA
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-28
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#include"tactical.h"
|
||||
#include"simplify_tactic.h"
|
||||
#include"propagate_values_tactic.h"
|
||||
#include"solve_eqs_tactic.h"
|
||||
#include"elim_uncnstr_tactic.h"
|
||||
#include"smt_tactic.h"
|
||||
#include"bit_blaster_tactic.h"
|
||||
#include"max_bv_sharing_tactic.h"
|
||||
#include"sat_tactic.h"
|
||||
#include"nla2bv_tactic.h"
|
||||
#include"ctx_simplify_tactic.h"
|
||||
#include"cofactor_term_ite_tactic.h"
|
||||
|
||||
tactic * mk_qfnia_bv_solver(ast_manager & m, params_ref const & p_ref) {
|
||||
params_ref p = p_ref;
|
||||
p.set_bool(":flat", false);
|
||||
p.set_bool(":hi-div0", true);
|
||||
p.set_bool(":elim-and", true);
|
||||
p.set_bool(":blast-distinct", true);
|
||||
|
||||
params_ref simp2_p = p;
|
||||
simp2_p.set_bool(":local-ctx", true);
|
||||
simp2_p.set_uint(":local-ctx-limit", 10000000);
|
||||
|
||||
|
||||
tactic * r = using_params(and_then(mk_simplify_tactic(m),
|
||||
mk_propagate_values_tactic(m),
|
||||
using_params(mk_simplify_tactic(m), simp2_p),
|
||||
mk_max_bv_sharing_tactic(m),
|
||||
mk_bit_blaster_tactic(m),
|
||||
mk_sat_tactic(m)),
|
||||
p);
|
||||
return r;
|
||||
}
|
||||
|
||||
tactic * mk_qfnia_premable(ast_manager & m, params_ref const & p_ref) {
|
||||
params_ref pull_ite_p = p_ref;
|
||||
pull_ite_p.set_bool(":pull-cheap-ite", true);
|
||||
pull_ite_p.set_bool(":local-ctx", true);
|
||||
pull_ite_p.set_uint(":local-ctx-limit", 10000000);
|
||||
|
||||
params_ref ctx_simp_p = p_ref;
|
||||
ctx_simp_p.set_uint(":max-depth", 30);
|
||||
ctx_simp_p.set_uint(":max-steps", 5000000);
|
||||
|
||||
params_ref simp_p = p_ref;
|
||||
simp_p.set_bool(":hoist-mul", true);
|
||||
|
||||
params_ref elim_p = p_ref;
|
||||
elim_p.set_uint(":max-memory",20);
|
||||
|
||||
return
|
||||
and_then(mk_simplify_tactic(m),
|
||||
mk_propagate_values_tactic(m),
|
||||
using_params(mk_ctx_simplify_tactic(m), ctx_simp_p),
|
||||
using_params(mk_simplify_tactic(m), pull_ite_p),
|
||||
mk_elim_uncnstr_tactic(m),
|
||||
skip_if_failed(using_params(mk_cofactor_term_ite_tactic(m), elim_p)),
|
||||
using_params(mk_simplify_tactic(m), simp_p));
|
||||
}
|
||||
|
||||
tactic * mk_qfnia_sat_solver(ast_manager & m, params_ref const & p) {
|
||||
params_ref nia2sat_p = p;
|
||||
nia2sat_p.set_uint(":nla2bv-max-bv-size", 64);
|
||||
|
||||
return and_then(mk_nla2bv_tactic(m, nia2sat_p),
|
||||
mk_qfnia_bv_solver(m, p),
|
||||
mk_fail_if_undecided_tactic());
|
||||
}
|
||||
|
||||
tactic * mk_qfnia_tactic(ast_manager & m, params_ref const & p) {
|
||||
return and_then(mk_qfnia_premable(m, p),
|
||||
or_else(mk_qfnia_sat_solver(m, p),
|
||||
mk_smt_tactic()));
|
||||
}
|
28
src/tactic/smtlogics/qfnia_tactic.h
Normal file
28
src/tactic/smtlogics/qfnia_tactic.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfnia_tactic.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_NIA
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-28
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef _QFNIA_TACTIC_
|
||||
#define _QFNIA_TACTIC_
|
||||
|
||||
#include"params.h"
|
||||
class ast_manager;
|
||||
class tactic;
|
||||
|
||||
tactic * mk_qfnia_tactic(ast_manager & m, params_ref const & p = params_ref());
|
||||
|
||||
#endif
|
53
src/tactic/smtlogics/qfnra_tactic.cpp
Normal file
53
src/tactic/smtlogics/qfnra_tactic.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfnra_tactic.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_NRA
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-28
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#include"tactical.h"
|
||||
#include"simplify_tactic.h"
|
||||
#include"propagate_values_tactic.h"
|
||||
#include"nla2bv_tactic.h"
|
||||
#include"smt_tactic.h"
|
||||
#include"qfnra_nlsat_tactic.h"
|
||||
|
||||
static tactic * mk_qfnra_sat_solver(ast_manager& m, params_ref const& p, unsigned bv_size) {
|
||||
params_ref nra2sat_p = p;
|
||||
nra2sat_p.set_uint(":nla2bv-max-bv-size", p.get_uint(":nla2bv-max-bv-size", bv_size));
|
||||
|
||||
return and_then(mk_nla2bv_tactic(m, nra2sat_p),
|
||||
mk_smt_tactic(),
|
||||
mk_fail_if_undecided_tactic());
|
||||
}
|
||||
|
||||
tactic * mk_qfnra_tactic(ast_manager & m, params_ref const& p) {
|
||||
params_ref p1 = p;
|
||||
p1.set_uint(":seed", 11);
|
||||
p1.set_bool(":factor", false);
|
||||
params_ref p2 = p;
|
||||
p2.set_uint(":seed", 13);
|
||||
p2.set_bool(":factor", false);
|
||||
|
||||
return and_then(mk_simplify_tactic(m, p),
|
||||
mk_propagate_values_tactic(m, p),
|
||||
or_else(try_for(mk_qfnra_nlsat_tactic(m, p), 5000),
|
||||
try_for(mk_qfnra_nlsat_tactic(m, p1), 10000),
|
||||
mk_qfnra_sat_solver(m, p, 4),
|
||||
and_then(try_for(mk_smt_tactic(), 5000), mk_fail_if_undecided_tactic()),
|
||||
mk_qfnra_sat_solver(m, p, 6),
|
||||
mk_qfnra_nlsat_tactic(m, p2)));
|
||||
}
|
||||
|
||||
|
28
src/tactic/smtlogics/qfnra_tactic.h
Normal file
28
src/tactic/smtlogics/qfnra_tactic.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfnra_tactic.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_NRA
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-28
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef _QFNRA_TACTIC_
|
||||
#define _QFNRA_TACTIC_
|
||||
|
||||
#include"params.h"
|
||||
class ast_manager;
|
||||
class tactic;
|
||||
|
||||
tactic * mk_qfnra_tactic(ast_manager & m, params_ref const & p = params_ref());
|
||||
|
||||
#endif
|
40
src/tactic/smtlogics/qfuf_tactic.cpp
Normal file
40
src/tactic/smtlogics/qfuf_tactic.cpp
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfuf_tactic.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_QFUF benchmarks.
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2012-02-21
|
||||
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#include"tactical.h"
|
||||
#include"simplify_tactic.h"
|
||||
#include"symmetry_reduce_tactic.h"
|
||||
#include"solve_eqs_tactic.h"
|
||||
#include"propagate_values_tactic.h"
|
||||
#include"smt_tactic.h"
|
||||
|
||||
tactic * mk_qfuf_tactic(ast_manager & m, params_ref const & p) {
|
||||
params_ref s2_p;
|
||||
s2_p.set_bool(":pull-cheap-ite", true);
|
||||
s2_p.set_bool(":local-ctx", true);
|
||||
s2_p.set_uint(":local-ctx-limit", 10000000);
|
||||
return and_then(mk_simplify_tactic(m, p),
|
||||
mk_propagate_values_tactic(m, p),
|
||||
mk_solve_eqs_tactic(m, p),
|
||||
using_params(mk_simplify_tactic(m, p), s2_p),
|
||||
mk_symmetry_reduce_tactic(m, p),
|
||||
mk_smt_tactic(p));
|
||||
}
|
||||
|
||||
|
29
src/tactic/smtlogics/qfuf_tactic.h
Normal file
29
src/tactic/smtlogics/qfuf_tactic.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfuf_tactic.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_QFUF benchmarks.
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2012-02-21
|
||||
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef _QFUF_TACTIC_
|
||||
#define _QFUF_TACTIC_
|
||||
|
||||
#include"params.h"
|
||||
class ast_manager;
|
||||
class tactic;
|
||||
|
||||
tactic * mk_qfuf_tactic(ast_manager & m, params_ref const & p);
|
||||
|
||||
#endif
|
53
src/tactic/smtlogics/qfufbv_tactic.cpp
Normal file
53
src/tactic/smtlogics/qfufbv_tactic.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfufbv_tactic.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_UFBV
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-27
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#include"tactical.h"
|
||||
#include"simplify_tactic.h"
|
||||
#include"propagate_values_tactic.h"
|
||||
#include"solve_eqs_tactic.h"
|
||||
#include"elim_uncnstr_tactic.h"
|
||||
#include"smt_tactic.h"
|
||||
#include"max_bv_sharing_tactic.h"
|
||||
#include"bv_size_reduction_tactic.h"
|
||||
#include"reduce_args_tactic.h"
|
||||
|
||||
tactic * mk_qfufbv_tactic(ast_manager & m, params_ref const & p) {
|
||||
params_ref main_p;
|
||||
main_p.set_bool(":elim-and", true);
|
||||
main_p.set_bool(":blast-distinct", true);
|
||||
|
||||
tactic * preamble_st = and_then(mk_simplify_tactic(m),
|
||||
mk_propagate_values_tactic(m),
|
||||
mk_solve_eqs_tactic(m),
|
||||
mk_elim_uncnstr_tactic(m),
|
||||
if_no_proofs(if_no_unsat_cores(mk_reduce_args_tactic(m))),
|
||||
if_no_proofs(if_no_unsat_cores(mk_bv_size_reduction_tactic(m))),
|
||||
mk_max_bv_sharing_tactic(m)
|
||||
);
|
||||
|
||||
tactic * st = using_params(and_then(preamble_st,
|
||||
mk_smt_tactic()),
|
||||
main_p);
|
||||
|
||||
//cond(is_qfbv(),
|
||||
// and_then(mk_bit_blaster(m),
|
||||
// mk_sat_solver(m)),
|
||||
// mk_smt_solver())
|
||||
st->updt_params(p);
|
||||
return st;
|
||||
}
|
28
src/tactic/smtlogics/qfufbv_tactic.h
Normal file
28
src/tactic/smtlogics/qfufbv_tactic.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qfufbv_tactic.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_UFBV
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-02-27
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef _QFUFBV_TACTIC_
|
||||
#define _QFUFBV_TACTIC_
|
||||
|
||||
#include"params.h"
|
||||
class ast_manager;
|
||||
class tactic;
|
||||
|
||||
tactic * mk_qfufbv_tactic(ast_manager & m, params_ref const & p = params_ref());
|
||||
|
||||
#endif
|
106
src/tactic/smtlogics/quant_tactics.cpp
Normal file
106
src/tactic/smtlogics/quant_tactics.cpp
Normal file
|
@ -0,0 +1,106 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
quant_tactics.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactics for benchmarks containing quantifiers.
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2012-02-21.
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"tactical.h"
|
||||
#include"simplify_tactic.h"
|
||||
#include"propagate_values_tactic.h"
|
||||
#include"solve_eqs_tactic.h"
|
||||
#include"elim_uncnstr_tactic.h"
|
||||
#include"qe_tactic.h"
|
||||
#include"ctx_simplify_tactic.h"
|
||||
#include"smt_tactic.h"
|
||||
|
||||
static tactic * mk_quant_preprocessor(ast_manager & m, bool disable_gaussian = false) {
|
||||
params_ref pull_ite_p;
|
||||
pull_ite_p.set_bool(":pull-cheap-ite", true);
|
||||
pull_ite_p.set_bool(":local-ctx", true);
|
||||
pull_ite_p.set_uint(":local-ctx-limit", 10000000);
|
||||
|
||||
params_ref ctx_simp_p;
|
||||
ctx_simp_p.set_uint(":max-depth", 30);
|
||||
ctx_simp_p.set_uint(":max-steps", 5000000);
|
||||
|
||||
tactic * solve_eqs;
|
||||
if (disable_gaussian)
|
||||
solve_eqs = mk_skip_tactic();
|
||||
else
|
||||
solve_eqs = when(mk_not(mk_has_pattern_probe()), mk_solve_eqs_tactic(m));
|
||||
|
||||
// remark: investigate if gaussian elimination is useful when patterns are not provided.
|
||||
return and_then(mk_simplify_tactic(m),
|
||||
mk_propagate_values_tactic(m),
|
||||
using_params(mk_ctx_simplify_tactic(m), ctx_simp_p),
|
||||
using_params(mk_simplify_tactic(m), pull_ite_p),
|
||||
solve_eqs,
|
||||
mk_elim_uncnstr_tactic(m),
|
||||
mk_simplify_tactic(m));
|
||||
}
|
||||
|
||||
static tactic * mk_no_solve_eq_preprocessor(ast_manager & m) {
|
||||
return mk_quant_preprocessor(m, true);
|
||||
}
|
||||
|
||||
tactic * mk_ufnia_tactic(ast_manager & m, params_ref const & p) {
|
||||
tactic * st = and_then(mk_no_solve_eq_preprocessor(m),
|
||||
mk_smt_tactic());
|
||||
st->updt_params(p);
|
||||
return st;
|
||||
}
|
||||
|
||||
tactic * mk_uflra_tactic(ast_manager & m, params_ref const & p) {
|
||||
tactic * st = and_then(mk_quant_preprocessor(m),
|
||||
mk_smt_tactic());
|
||||
st->updt_params(p);
|
||||
return st;
|
||||
}
|
||||
|
||||
tactic * mk_auflia_tactic(ast_manager & m, params_ref const & p) {
|
||||
params_ref qi_p;
|
||||
qi_p.set_str(":qi-cost", "0");
|
||||
TRACE("qi_cost", qi_p.display(tout); tout << "\n" << qi_p.get_str(":qi-cost", "<null>") << "\n";);
|
||||
tactic * st = and_then(mk_no_solve_eq_preprocessor(m),
|
||||
or_else(and_then(fail_if(mk_gt(mk_num_exprs_probe(), mk_const_probe(static_cast<double>(128)))),
|
||||
using_params(mk_smt_tactic(), qi_p),
|
||||
mk_fail_if_undecided_tactic()),
|
||||
mk_smt_tactic()));
|
||||
st->updt_params(p);
|
||||
return st;
|
||||
}
|
||||
|
||||
tactic * mk_auflira_tactic(ast_manager & m, params_ref const & p) {
|
||||
tactic * st = and_then(mk_quant_preprocessor(m),
|
||||
mk_smt_tactic());
|
||||
st->updt_params(p);
|
||||
return st;
|
||||
}
|
||||
|
||||
tactic * mk_aufnira_tactic(ast_manager & m, params_ref const & p) {
|
||||
tactic * st = and_then(mk_quant_preprocessor(m),
|
||||
mk_smt_tactic());
|
||||
st->updt_params(p);
|
||||
return st;
|
||||
}
|
||||
|
||||
tactic * mk_lra_tactic(ast_manager & m, params_ref const & p) {
|
||||
tactic * st = and_then(mk_quant_preprocessor(m),
|
||||
mk_qe_tactic(m),
|
||||
mk_smt_tactic());
|
||||
st->updt_params(p);
|
||||
return st;
|
||||
}
|
||||
|
33
src/tactic/smtlogics/quant_tactics.h
Normal file
33
src/tactic/smtlogics/quant_tactics.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
quant_tactics.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactics for benchmarks containing quantifiers.
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2012-02-21.
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#ifndef _QUANT_TACTICS_H_
|
||||
#define _QUANT_TACTICS_H_
|
||||
|
||||
#include"params.h"
|
||||
class ast_manager;
|
||||
class tactic;
|
||||
|
||||
tactic * mk_ufnia_tactic(ast_manager & m, params_ref const & p);
|
||||
tactic * mk_uflra_tactic(ast_manager & m, params_ref const & p);
|
||||
tactic * mk_auflia_tactic(ast_manager & m, params_ref const & p);
|
||||
tactic * mk_auflira_tactic(ast_manager & m, params_ref const & p);
|
||||
tactic * mk_aufnira_tactic(ast_manager & m, params_ref const & p);
|
||||
tactic * mk_lra_tactic(ast_manager & m, params_ref const & p);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue