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:
parent
cb789f6ca8
commit
db74e23de1
9 changed files with 120 additions and 191 deletions
42
src/ast/simplifiers/card2bv.h
Normal file
42
src/ast/simplifiers/card2bv.h
Normal 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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue