mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
stash
This commit is contained in:
parent
75ad174567
commit
6a36116b5c
7 changed files with 34 additions and 18 deletions
|
@ -48,6 +48,7 @@ void dl_query_test(ast_manager & m, smt_params & fparams, params_ref& params,
|
|||
bool use_magic_sets) {
|
||||
|
||||
dl_decl_util decl_util(m);
|
||||
random_gen ran(0);
|
||||
|
||||
context ctx_q(m, fparams);
|
||||
params.set_bool("magic_sets_for_queries", use_magic_sets);
|
||||
|
@ -86,7 +87,7 @@ void dl_query_test(ast_manager & m, smt_params & fparams, params_ref& params,
|
|||
warning_msg("cannot get sort size");
|
||||
return;
|
||||
}
|
||||
uint64 num = rand()%sort_sz;
|
||||
uint64 num = ran()%sort_sz;
|
||||
app * el_b = decl_util.mk_numeral(num, sig_b[col]);
|
||||
f_b.push_back(el_b);
|
||||
app * el_q = decl_util.mk_numeral(num, sig_q[col]);
|
||||
|
@ -112,7 +113,7 @@ void dl_query_test(ast_manager & m, smt_params & fparams, params_ref& params,
|
|||
table_base::iterator fit = table_b.begin();
|
||||
table_base::iterator fend = table_b.end();
|
||||
for(; fit!=fend; ++fit) {
|
||||
if(rand()%std::max(1u,table_sz/test_count)!=0) {
|
||||
if(ran()%std::max(1u,table_sz/test_count)!=0) {
|
||||
continue;
|
||||
}
|
||||
fit->get_fact(tf);
|
||||
|
@ -127,6 +128,7 @@ void dl_query_test(ast_manager & m, smt_params & fparams, params_ref& params,
|
|||
void dl_query_test_wpa(smt_params & fparams, params_ref& params) {
|
||||
params.set_bool("magic_sets_for_queries", true);
|
||||
ast_manager m;
|
||||
random_gen ran(0);
|
||||
reg_decl_plugins(m);
|
||||
arith_util arith(m);
|
||||
const char * problem_dir = "C:\\tvm\\src\\z3_2\\debug\\test\\w0.datalog";
|
||||
|
@ -151,8 +153,8 @@ void dl_query_test_wpa(smt_params & fparams, params_ref& params) {
|
|||
TRUSTME( ctx.try_get_sort_constant_count(var_sort, var_sz) );
|
||||
|
||||
for(unsigned attempt=0; attempt<attempts; attempt++) {
|
||||
unsigned el1 = rand()%var_sz;
|
||||
unsigned el2 = rand()%var_sz;
|
||||
unsigned el1 = ran()%var_sz;
|
||||
unsigned el2 = ran()%var_sz;
|
||||
|
||||
expr_ref_vector q_args(m);
|
||||
q_args.push_back(dl_util.mk_numeral(el1, var_sort));
|
||||
|
@ -218,6 +220,9 @@ void tst_dl_query() {
|
|||
|
||||
for(unsigned use_magic_sets=0; use_magic_sets<=1; use_magic_sets++) {
|
||||
stopwatch watch;
|
||||
if (!(use_restarts == 1 && use_similar == 0 && use_magic_sets == 1)) {
|
||||
continue;
|
||||
}
|
||||
watch.start();
|
||||
std::cerr << "------- " << (use_restarts ? "With" : "Without") << " restarts -------\n";
|
||||
std::cerr << "------- " << (use_similar ? "With" : "Without") << " similar compressor -------\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue