3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-03 01:40:22 +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:
Nikolaj Bjorner 2023-11-30 13:58:24 -08:00
parent 5784c2da79
commit b52fd8d954
28 changed files with 3063 additions and 68 deletions

58
src/ast/euf/euf_plugin.h Normal file
View file

@ -0,0 +1,58 @@
/*++
Copyright (c) 2023 Microsoft Corporation
Module Name:
euf_plugin.h
Abstract:
plugin structure for euf
Plugins allow adding equality saturation for theories.
Author:
Nikolaj Bjorner (nbjorner) 2023-11-08
--*/
#pragma once
#include "ast/euf/euf_enode.h"
#include "ast/euf/euf_justification.h"
namespace euf {
class plugin {
protected:
egraph& g;
void push_plugin_undo(unsigned th_id);
void push_merge(enode* a, enode* b, justification j);
void push_merge(enode* a, enode* b);
enode* mk(expr* e, unsigned n, enode* const* args);
region& get_region();
public:
plugin(egraph& g):
g(g)
{}
virtual ~plugin() {}
virtual unsigned get_id() const = 0;
virtual void register_node(enode* n) = 0;
virtual void merge_eh(enode* n1, enode* n2) = 0;
virtual void diseq_eh(enode* eq) {};
virtual void propagate() = 0;
virtual void undo() = 0;
virtual std::ostream& display(std::ostream& out) const = 0;
};
}