mirror of
https://github.com/Z3Prover/z3
synced 2025-08-22 11:07:51 +00:00
move mam to euf
This commit is contained in:
parent
0e4c033e30
commit
9a299eb9ff
6 changed files with 72 additions and 56 deletions
|
@ -36,7 +36,6 @@ z3_add_component(sat_smt
|
|||
q_clause.cpp
|
||||
q_ematch.cpp
|
||||
q_eval.cpp
|
||||
q_mam.cpp
|
||||
q_mbi.cpp
|
||||
q_model_fixer.cpp
|
||||
q_theory_checker.cpp
|
||||
|
|
|
@ -21,6 +21,7 @@ Author:
|
|||
#include "ast/ast_translation.h"
|
||||
#include "ast/ast_util.h"
|
||||
#include "ast/euf/euf_egraph.h"
|
||||
#include "ast/euf/euf_mam.h"
|
||||
#include "ast/rewriter/th_rewriter.h"
|
||||
#include "ast/converters/model_converter.h"
|
||||
#include "sat/sat_extension.h"
|
||||
|
@ -83,7 +84,7 @@ namespace euf {
|
|||
expr* get_hint(euf::solver& s) const override;
|
||||
};
|
||||
|
||||
class solver : public sat::extension, public th_internalizer, public th_decompile, public sat::clause_eh {
|
||||
class solver : public sat::extension, public th_internalizer, public th_decompile, public sat::clause_eh, public mam_solver {
|
||||
typedef top_sort<euf::enode> deps_t;
|
||||
friend class ackerman;
|
||||
friend class eq_proof_hint;
|
||||
|
@ -331,6 +332,7 @@ namespace euf {
|
|||
push(push_back_trail< V, false>(vec));
|
||||
}
|
||||
trail_stack& get_trail_stack() { return m_trail; }
|
||||
trail_stack& get_trail() override { return m_trail; }
|
||||
|
||||
void updt_params(params_ref const& p);
|
||||
void set_solver(sat::solver* s) override { m_solver = s; use_drat(); }
|
||||
|
@ -398,7 +400,7 @@ namespace euf {
|
|||
bool is_blocked(literal l, ext_constraint_idx) override;
|
||||
bool check_model(sat::model const& m) const override;
|
||||
void gc_vars(unsigned num_vars) override;
|
||||
bool resource_limits_exceeded() const { return false; } // TODO
|
||||
bool resource_limits_exceeded() const override { return false; } // TODO
|
||||
|
||||
|
||||
// proof
|
||||
|
|
|
@ -29,6 +29,7 @@ Done:
|
|||
--*/
|
||||
|
||||
#include "ast/ast_util.h"
|
||||
#include "ast/euf/euf_mam.h"
|
||||
#include "ast/rewriter/var_subst.h"
|
||||
#include "ast/rewriter/rewriter_def.h"
|
||||
#include "ast/normal_forms/pull_quant.h"
|
||||
|
@ -36,7 +37,7 @@ Done:
|
|||
#include "sat/smt/sat_th.h"
|
||||
#include "sat/smt/euf_solver.h"
|
||||
#include "sat/smt/q_solver.h"
|
||||
#include "sat/smt/q_mam.h"
|
||||
|
||||
#include "sat/smt/q_ematch.h"
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ Author:
|
|||
#include "ast/normal_forms/nnf.h"
|
||||
#include "solver/solver.h"
|
||||
#include "sat/smt/sat_th.h"
|
||||
#include "sat/smt/q_mam.h"
|
||||
#include "ast/euf/euf_mam.h"
|
||||
#include "sat/smt/q_clause.h"
|
||||
#include "sat/smt/q_queue.h"
|
||||
#include "sat/smt/q_eval.h"
|
||||
|
@ -35,7 +35,7 @@ namespace q {
|
|||
|
||||
class solver;
|
||||
|
||||
class ematch {
|
||||
class ematch : public euf::on_binding_callback {
|
||||
struct stats {
|
||||
unsigned m_num_instantiations;
|
||||
unsigned m_num_propagations;
|
||||
|
@ -149,7 +149,7 @@ namespace q {
|
|||
void get_antecedents(sat::literal l, sat::ext_justification_idx idx, sat::literal_vector& r, bool probing);
|
||||
|
||||
// callback from mam
|
||||
void on_binding(quantifier* q, app* pat, euf::enode* const* binding, unsigned max_generation, unsigned min_gen, unsigned max_gen);
|
||||
void on_binding(quantifier* q, app* pat, euf::enode* const* binding, unsigned max_generation, unsigned min_gen, unsigned max_gen) override;
|
||||
|
||||
// callbacks from queue
|
||||
lbool evaluate(euf::enode* const* binding, clause& c) { m_evidence.reset(); return m_eval(binding, c, m_evidence); }
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,74 +0,0 @@
|
|||
/*++
|
||||
Copyright (c) 2006 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
euf_mam.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Matching Abstract Machine
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2007-02-13.
|
||||
Nikolaj Bjorner (nbjorner) 2021-01-22.
|
||||
|
||||
--*/
|
||||
#pragma once
|
||||
|
||||
#include "ast/ast.h"
|
||||
#include "ast/euf/euf_egraph.h"
|
||||
#include <functional>
|
||||
|
||||
namespace euf {
|
||||
class solver;
|
||||
};
|
||||
|
||||
namespace q {
|
||||
|
||||
typedef euf::enode enode;
|
||||
typedef euf::egraph egraph;
|
||||
typedef euf::enode_vector enode_vector;
|
||||
|
||||
class ematch;
|
||||
|
||||
/**
|
||||
\brief Matching Abstract Machine (MAM)
|
||||
*/
|
||||
class mam {
|
||||
friend class mam_impl;
|
||||
|
||||
mam() = default;
|
||||
|
||||
public:
|
||||
|
||||
static mam * mk(euf::solver& ctx, ematch& em);
|
||||
|
||||
virtual ~mam() = default;
|
||||
|
||||
virtual void add_pattern(quantifier * q, app * mp) = 0;
|
||||
|
||||
virtual void add_node(enode * n, bool lazy) = 0;
|
||||
|
||||
virtual void propagate() = 0;
|
||||
|
||||
virtual bool can_propagate() const = 0;
|
||||
|
||||
virtual void rematch(bool use_irrelevant = false) = 0;
|
||||
|
||||
virtual void on_merge(enode * root, enode * other) = 0;
|
||||
|
||||
virtual void on_match(quantifier * qa, app * pat, unsigned num_bindings, enode * const * bindings, unsigned max_generation) = 0;
|
||||
|
||||
virtual void reset() = 0;
|
||||
|
||||
virtual std::ostream& display(std::ostream& out) = 0;
|
||||
|
||||
virtual bool check_missing_instances() = 0;
|
||||
|
||||
static void ground_subterms(expr* e, ptr_vector<app>& ground);
|
||||
|
||||
};
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue