3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-17 00:32:16 +00:00

Adding some options in support of F* (#6774)

* patterns: add option for pattern decomposition (pi.decompose_patterns)

True by default, retaining current behavior.

* rewriter: add option for sorting of disjunctions (rewriter.sort_disjunctions)

True by default, retaining current behavior.
This commit is contained in:
Guido Martínez 2023-06-20 16:10:37 -07:00 committed by GitHub
parent eb1caee18a
commit 3517361a73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 2 deletions

View file

@ -26,6 +26,7 @@ Notes:
void bool_rewriter::updt_params(params_ref const & _p) {
bool_rewriter_params p(_p);
m_flat_and_or = p.flat_and_or();
m_sort_disjunctions = p.sort_disjunctions();
m_elim_and = p.elim_and();
m_elim_ite = p.elim_ite();
m_local_ctx = p.local_ctx();
@ -291,7 +292,7 @@ br_status bool_rewriter::mk_nflat_or_core(unsigned num_args, expr * const * args
if (st != BR_FAILED)
return st;
#endif
if (s) {
if (m_sort_disjunctions && s) {
ast_lt lt;
std::sort(buffer.begin(), buffer.end(), lt);
result = m().mk_or(sz, buffer.data());
@ -329,7 +330,7 @@ br_status bool_rewriter::mk_flat_or_core(unsigned num_args, expr * const * args,
}
}
if (mk_nflat_or_core(flat_args.size(), flat_args.data(), result) == BR_FAILED) {
if (!ordered) {
if (m_sort_disjunctions && !ordered) {
ast_lt lt;
std::sort(flat_args.begin(), flat_args.end(), lt);
}

View file

@ -53,6 +53,7 @@ class bool_rewriter {
ast_manager & m_manager;
hoist_rewriter m_hoist;
bool m_flat_and_or = false;
bool m_sort_disjunctions = true;
bool m_local_ctx = false;
bool m_elim_and = false;
bool m_blast_distinct = false;