3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-09 08:45:47 +00:00

update distribute forall

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2022-12-06 17:59:33 -08:00
parent 80033e8744
commit c33e58ee1a
5 changed files with 39 additions and 162 deletions

View file

@ -5,6 +5,7 @@ z3_add_component(simplifiers
card2bv.cpp
demodulator_simplifier.cpp
dependent_expr_state.cpp
distribute_forall.cpp
elim_unconstrained.cpp
eliminate_predicates.cpp
euf_completion.cpp

View file

@ -15,31 +15,23 @@ Author:
#pragma once
#include "ast/simplifiers/dependent_expr_state.h"
#include "ast/rewriter/distribute_forall.h"
class distribute_forall_simplifier : public dependent_expr_simplifier {
distribute_forall m_dist;
struct rw_cfg;
struct rw;
public:
distribute_forall_simplifier(ast_manager& m, params_ref const& p, dependent_expr_state& fmls):
dependent_expr_simplifier(m, fmls),
m_dist(m) {
dependent_expr_simplifier(m, fmls) {
}
char const* name() const override { return "distribute-forall"; }
void reduce() override {
if (!m_fmls.has_quantifiers())
return;
expr_ref r(m);
for (unsigned idx : indices()) {
auto const& d = m_fmls[idx];
if (!has_quantifiers(d.fml()))
continue;
m_dist(d.fml(), r);
m_fmls.update(idx, dependent_expr(m, r, nullptr, d.dep()));
}
}
bool supports_proofs() const override { return true; }
void reduce() override;
};