mirror of
https://github.com/Z3Prover/z3
synced 2025-08-02 17:30:23 +00:00
add EUF plugin framework.
plugin setting allows adding equality saturation within the E-graph propagation without involving externalizing theory solver dispatch. It makes equality saturation independent of SAT integration. Add a special relation operator to support ad-hoc AC symbols.
This commit is contained in:
parent
5784c2da79
commit
b52fd8d954
28 changed files with 3063 additions and 68 deletions
47
src/ast/euf/euf_plugin.cpp
Normal file
47
src/ast/euf/euf_plugin.cpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*++
|
||||
Copyright (c) 2023 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
euf_plugin.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
plugin structure for euf
|
||||
|
||||
Plugins allow adding equality saturation for theories.
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2023-11-08
|
||||
|
||||
--*/
|
||||
|
||||
#include "ast/euf/euf_egraph.h"
|
||||
|
||||
namespace euf {
|
||||
|
||||
void plugin::push_plugin_undo(unsigned th_id) {
|
||||
g.push_plugin_undo(th_id);
|
||||
}
|
||||
|
||||
void plugin::push_merge(enode* a, enode* b, justification j) {
|
||||
g.push_merge(a, b, j);
|
||||
}
|
||||
|
||||
void plugin::push_merge(enode* a, enode* b) {
|
||||
TRACE("plugin", tout << g.bpp(a) << " == " << g.bpp(b) << "\n");
|
||||
g.push_merge(a, b, justification::axiom());
|
||||
}
|
||||
|
||||
enode* plugin::mk(expr* e, unsigned n, enode* const* args) {
|
||||
enode* r = g.find(e);
|
||||
if (!r)
|
||||
r = g.mk(e, 0, n, args);
|
||||
return r;
|
||||
}
|
||||
|
||||
region& plugin::get_region() {
|
||||
return g.m_region;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue