3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-04-27 06:13:35 +00:00

fixes and more porting seq_eq_solver to self-contained module

This commit is contained in:
Nikolaj Bjorner 2021-03-04 16:23:22 -08:00
parent 847724fb21
commit 38737db802
21 changed files with 354 additions and 230 deletions

View file

@ -16,6 +16,7 @@ Author:
--*/
#pragma once
#include "ast/arith_decl_plugin.h"
#include "ast/rewriter/seq_axioms.h"
namespace seq {
@ -48,6 +49,7 @@ namespace seq {
ast_manager& m;
eq_solver_context& ctx;
axioms& m_ax;
arith_util a;
seq_util seq;
expr_ref_vector m_clause;
@ -59,9 +61,16 @@ namespace seq {
bool match_itos2(eqr const& e, expr*& s);
bool reduce_itos2(eqr const& e, eq_ptr& r);
bool reduce_itos3(eqr const& e, eq_ptr& r);
bool match_itos3(eqr const& e, expr*& n, expr_ref_vector const* & es);
bool match_binary_eq(eqr const& e, expr_ref& x, ptr_vector<expr>& xs, ptr_vector<expr>& ys, expr_ref& y);
bool reduce_binary_eq(eqr const& e, eq_ptr& r);
bool reduce_nth_solved(eqr const& e, eq_ptr& r);
bool match_nth_solved(eqr const& e, expr_ref& x, expr_ref& y);
bool match_nth_solved_aux(expr_ref_vector const& ls, expr_ref_vector const& rs, expr_ref& x, expr_ref& y);
bool match_ternary_eq_r(expr_ref_vector const& ls, expr_ref_vector const& rs,
expr_ref& x, expr_ref_vector& xs, expr_ref& y1, expr_ref_vector& ys, expr_ref& y2);
@ -69,6 +78,10 @@ namespace seq {
expr_ref_vector& xs, expr_ref& x, expr_ref& y1, expr_ref_vector& ys, expr_ref& y2);
bool branch_unit_variable(eqr const& e);
bool branch_unit_variable(expr* X, expr_ref_vector const& units);
/**
* count unit or non-unit entries left-to-right or right-to-left starting at, and including offset.
*/
@ -115,6 +128,7 @@ namespace seq {
m(m),
ctx(ctx),
m_ax(ax),
a(m),
seq(m),
m_clause(m)
{}
@ -123,6 +137,8 @@ namespace seq {
bool reduce(expr* s, expr* t, eq_ptr& r);
bool branch(unsigned priority, eqr const& e);
bool is_var(expr* a) const;
bool match_binary_eq(expr_ref_vector const& ls, expr_ref_vector const& rs,
@ -137,6 +153,9 @@ namespace seq {
bool match_quat_eq(expr_ref_vector const& ls, expr_ref_vector const& rs,
expr_ref& x1, expr_ref_vector& xs, expr_ref& x2,
expr_ref& y1, expr_ref_vector& ys, expr_ref& y2);
bool can_align_from_lhs_aux(expr_ref_vector const& ls, expr_ref_vector const& rs);
bool can_align_from_rhs_aux(expr_ref_vector const& ls, expr_ref_vector const& rs);
};