3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-30 15:00:08 +00:00

make card2bv a simplifier

This commit is contained in:
Nikolaj Bjorner 2022-11-25 11:07:31 +07:00
parent cb789f6ca8
commit db74e23de1
9 changed files with 120 additions and 191 deletions

View file

@ -0,0 +1,42 @@
/*++
Copyright (c) 2022 Microsoft Corporation
Module Name:
card2bv.h
Abstract:
convert cardinality constraints to bit-vectors
Author:
Nikolaj Bjorner (nbjorner) 2022-11-24
--*/
#pragma once
#include "ast/simplifiers/dependent_expr_state.h"
#include "ast/rewriter/th_rewriter.h"
class card2bv : public dependent_expr_simplifier {
struct stats {
unsigned m_num_rewrites = 0;
void reset() { memset(this, 0, sizeof(*this)); }
};
stats m_stats;
params_ref m_params;
public:
card2bv(ast_manager& m, params_ref const& p, dependent_expr_state& fmls);
void reduce() override;
void collect_statistics(statistics& st) const override;
void reset_statistics() override { m_stats.reset(); }
void updt_params(params_ref const& p) override { m_params.append(p); }
void collect_param_descrs(param_descrs& r) override;
};