mirror of
https://github.com/Z3Prover/z3
synced 2026-03-04 04:30:23 +00:00
Convert der tactic to simplifier: add der_simplifier.h and update der_tactic.h
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
30784ecaa9
commit
c78b3d872d
2 changed files with 54 additions and 0 deletions
42
src/ast/simplifiers/der_simplifier.h
Normal file
42
src/ast/simplifiers/der_simplifier.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/*++
|
||||
Copyright (c) 2022 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
der_simplifier.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Dependent expression simplifier for destructive equality resolution (DER).
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2022-11-24
|
||||
|
||||
--*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ast/simplifiers/dependent_expr_state.h"
|
||||
#include "ast/rewriter/der.h"
|
||||
|
||||
class der_simplifier : public dependent_expr_simplifier {
|
||||
der_rewriter m_r;
|
||||
public:
|
||||
der_simplifier(ast_manager& m, params_ref const& p, dependent_expr_state& fmls)
|
||||
: dependent_expr_simplifier(m, fmls), m_r(m) {}
|
||||
|
||||
char const* name() const override { return "der"; }
|
||||
|
||||
void reduce() override {
|
||||
expr_ref new_curr(m);
|
||||
proof_ref new_pr(m);
|
||||
for (unsigned idx : indices()) {
|
||||
auto d = m_fmls[idx];
|
||||
m_r(d.fml(), new_curr, new_pr);
|
||||
m_fmls.update(idx, dependent_expr(m, new_curr, mp(d.pr(), new_pr), d.dep()));
|
||||
}
|
||||
}
|
||||
|
||||
bool supports_proofs() const override { return true; }
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue