mirror of
https://github.com/Z3Prover/z3
synced 2025-05-02 21:37:02 +00:00
adding simplifiers layer
simplifiers layer is a common substrate for global non-incremental and incremental processing. The first two layers are new, but others are to be ported form tactics. - bv::slice - rewrites equations to cut-dice-slice bit-vector extractions until they align. It creates opportunities for rewriting portions of bit-vectors to common sub-expressions, including values. - euf::completion - generalizes the KB simplifcation from asserted formulas to use the E-graph to establish a global and order-independent canonization. The interface dependent_expr_simplifier is amenable to forming tactics. Plugins for asserted-formulas is also possible but not yet realized.
This commit is contained in:
parent
1646a41b2f
commit
e57674490f
16 changed files with 1024 additions and 2 deletions
|
@ -10,6 +10,7 @@ z3_add_component(core_tactics
|
|||
dom_simplify_tactic.cpp
|
||||
elim_term_ite_tactic.cpp
|
||||
elim_uncnstr_tactic.cpp
|
||||
euf_completion_tactic.cpp
|
||||
injectivity_tactic.cpp
|
||||
nnf_tactic.cpp
|
||||
occf_tactic.cpp
|
||||
|
@ -38,6 +39,7 @@ z3_add_component(core_tactics
|
|||
dom_simplify_tactic.h
|
||||
elim_term_ite_tactic.h
|
||||
elim_uncnstr_tactic.h
|
||||
euf_completion_tactic.h
|
||||
injectivity_tactic.h
|
||||
nnf_tactic.h
|
||||
occf_tactic.h
|
||||
|
|
32
src/tactic/core/euf_completion_tactic.cpp
Normal file
32
src/tactic/core/euf_completion_tactic.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*++
|
||||
Copyright (c) 2022 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
euf_completion_tactic.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for simplifying with equations.
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2022-10-30
|
||||
|
||||
--*/
|
||||
|
||||
#include "tactic/tactic.h"
|
||||
#include "tactic/dependent_expr_state_tactic.h"
|
||||
#include "ast/simplifiers/euf_completion.h"
|
||||
#include "tactic/core/euf_completion_tactic.h"
|
||||
|
||||
class euf_completion_tactic_factory : public dependent_expr_simplifier_factory {
|
||||
public:
|
||||
dependent_expr_simplifier* mk(ast_manager& m, params_ref const& p, dependent_expr_state& s) override {
|
||||
return alloc(euf::completion, m, s);
|
||||
}
|
||||
};
|
||||
|
||||
tactic * mk_euf_completion_tactic(ast_manager& m, params_ref const& p) {
|
||||
return alloc(dependent_expr_state_tactic, m, p, alloc(euf_completion_tactic_factory), "euf-completion");
|
||||
}
|
29
src/tactic/core/euf_completion_tactic.h
Normal file
29
src/tactic/core/euf_completion_tactic.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*++
|
||||
Copyright (c) 2022 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
euf_completion_tactic.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for simplifying with equations.
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2022-10-30
|
||||
|
||||
--*/
|
||||
#pragma once
|
||||
|
||||
#include "util/params.h"
|
||||
class ast_manager;
|
||||
class tactic;
|
||||
|
||||
tactic * mk_euf_completion_tactic(ast_manager & m, params_ref const & p = params_ref());
|
||||
|
||||
/*
|
||||
ADD_TACTIC("euf-completion", "simplify using equalities.", "mk_euf_completion_tactic(m, p)")
|
||||
*/
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue