3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 17:44:08 +00:00
z3/src/ast/simplifiers/bit2int.h
Nikolaj Bjorner b084821a0c wip - dependent expr simpliifer
- simplify iterator over current indices
- add more simplifiers used by asserted_formulas
- improve diagnostics printing
2022-11-30 13:41:40 +07:00

45 lines
918 B
C++

/*++
Copyright (c) 2022 Microsoft Corporation
Module Name:
bit2int.h
Author:
Nikolaj Bjorner (nbjorner) 2022-11-24
--*/
#pragma once
#include "ast/simplifiers/dependent_expr_state.h"
#include "ast/rewriter/bit2int.h"
class bit2int_simplifier : public dependent_expr_simplifier {
bit2int m_rewriter;
public:
bit2int_simplifier(ast_manager& m, params_ref const& p, dependent_expr_state& fmls):
dependent_expr_simplifier(m, fmls),
m_rewriter(m) {
}
char const* name() const override { return "bit2int"; }
void reduce() override {
expr_ref r(m);
proof_ref pr(m);
for (unsigned idx : indices()) {
auto const& d = m_fmls[idx];
if (!has_quantifiers(d.fml()))
continue;
m_rewriter(d.fml(), r, pr);
m_fmls.update(idx, dependent_expr(m, r, d.dep()));
}
}
};