mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
Merge branch 'master' of https://github.com/Z3Prover/z3
This commit is contained in:
commit
596652ed36
42 changed files with 336 additions and 941 deletions
|
@ -44,8 +44,11 @@ void ast_pp_util::display_decls(std::ostream& out) {
|
|||
}
|
||||
n = coll.get_num_decls();
|
||||
for (unsigned i = 0; i < n; ++i) {
|
||||
ast_smt2_pp(out, coll.get_func_decls()[i], env);
|
||||
out << "\n";
|
||||
func_decl* f = coll.get_func_decls()[i];
|
||||
if (f->get_family_id() == null_family_id) {
|
||||
ast_smt2_pp(out, f, env);
|
||||
out << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ func_decl * pb_decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters, p
|
|||
}
|
||||
|
||||
void pb_decl_plugin::get_op_names(svector<builtin_name> & op_names, symbol const & logic) {
|
||||
if (logic == symbol::null || logic == "QF_FD") {
|
||||
if (logic == symbol::null || logic == "QF_FD" || logic == "ALL") {
|
||||
op_names.push_back(builtin_name(m_at_most_sym.bare_str(), OP_AT_MOST_K));
|
||||
op_names.push_back(builtin_name(m_at_least_sym.bare_str(), OP_AT_LEAST_K));
|
||||
op_names.push_back(builtin_name(m_pble_sym.bare_str(), OP_PB_LE));
|
||||
|
|
|
@ -20,12 +20,12 @@ Revision History:
|
|||
--*/
|
||||
#include"var_subst.h"
|
||||
#include"ast_ll_pp.h"
|
||||
|
||||
#include"ast_util.h"
|
||||
#include"distribute_forall.h"
|
||||
#include"bool_rewriter.h"
|
||||
|
||||
distribute_forall::distribute_forall(ast_manager & m, basic_simplifier_plugin & p) :
|
||||
distribute_forall::distribute_forall(ast_manager & m) :
|
||||
m_manager(m),
|
||||
m_bsimp(p),
|
||||
m_cache(m) {
|
||||
}
|
||||
|
||||
|
@ -109,6 +109,8 @@ void distribute_forall::reduce1_quantifier(quantifier * q) {
|
|||
|
||||
expr * e = get_cached(q->get_expr());
|
||||
if (m_manager.is_not(e) && m_manager.is_or(to_app(e)->get_arg(0))) {
|
||||
bool_rewriter br(m_manager);
|
||||
|
||||
// found target for simplification
|
||||
// (forall X (not (or F1 ... Fn)))
|
||||
// -->
|
||||
|
@ -121,8 +123,7 @@ void distribute_forall::reduce1_quantifier(quantifier * q) {
|
|||
for (unsigned i = 0; i < num_args; i++) {
|
||||
expr * arg = or_e->get_arg(i);
|
||||
expr_ref not_arg(m_manager);
|
||||
// m_bsimp.mk_not applies basic simplifications. For example, if arg is of the form (not a), then it will return a.
|
||||
m_bsimp.mk_not(arg, not_arg);
|
||||
br.mk_not(arg, not_arg);
|
||||
quantifier_ref tmp_q(m_manager);
|
||||
tmp_q = m_manager.update_quantifier(q, not_arg);
|
||||
expr_ref new_q(m_manager);
|
||||
|
@ -132,7 +133,7 @@ void distribute_forall::reduce1_quantifier(quantifier * q) {
|
|||
expr_ref result(m_manager);
|
||||
// m_bsimp.mk_and actually constructs a (not (or ...)) formula,
|
||||
// it will also apply basic simplifications.
|
||||
m_bsimp.mk_and(new_args.size(), new_args.c_ptr(), result);
|
||||
br.mk_and(new_args.size(), new_args.c_ptr(), result);
|
||||
cache_result(q, result);
|
||||
}
|
||||
else {
|
|
@ -22,7 +22,6 @@ Revision History:
|
|||
#define DISTRIBUTE_FORALL_H_
|
||||
|
||||
#include"ast.h"
|
||||
#include"basic_simplifier_plugin.h"
|
||||
#include"act_cache.h"
|
||||
|
||||
/**
|
||||
|
@ -47,7 +46,6 @@ Revision History:
|
|||
class distribute_forall {
|
||||
typedef act_cache expr_map;
|
||||
ast_manager & m_manager;
|
||||
basic_simplifier_plugin & m_bsimp; // useful for constructing formulas and/or/not in simplified form.
|
||||
ptr_vector<expr> m_todo;
|
||||
expr_map m_cache;
|
||||
ptr_vector<expr> m_new_args;
|
||||
|
@ -57,7 +55,7 @@ class distribute_forall {
|
|||
|
||||
|
||||
public:
|
||||
distribute_forall(ast_manager & m, basic_simplifier_plugin & p);
|
||||
distribute_forall(ast_manager & m);
|
||||
|
||||
/**
|
||||
\brief Apply the distribute_forall transformation (when possible) to all universal quantifiers in \c f.
|
Loading…
Add table
Add a link
Reference in a new issue