diff --git a/src/sat/smt/polysat_egraph.cpp b/src/sat/smt/polysat_egraph.cpp index 56246c97b..f55d25088 100644 --- a/src/sat/smt/polysat_egraph.cpp +++ b/src/sat/smt/polysat_egraph.cpp @@ -23,6 +23,15 @@ Author: namespace polysat { + unsigned solver::merge_level(euf::enode* a, euf::enode* b) { + sat::literal_vector r; + ctx.get_eq_antecedents(a, b, r); + unsigned level = 0; + for (sat::literal lit : r) + level = std::max(level, s().lvl(lit)); + return level; + } + // walk the egraph starting with pvar for suffix overlaps. void solver::get_bitvector_suffixes(pvar pv, offset_slices& out) { uint_set seen; diff --git a/src/sat/smt/polysat_solver.h b/src/sat/smt/polysat_solver.h index c70a89989..321b807fd 100644 --- a/src/sat/smt/polysat_solver.h +++ b/src/sat/smt/polysat_solver.h @@ -111,6 +111,7 @@ namespace polysat { sat::check_result intblast(); + unsigned merge_level(euf::enode* a, euf::enode* b); void explain_slice(pvar v, pvar w, unsigned offset, std::function const& consume); void explain_fixed(pvar v, fixed_slice const& s, std::function const& consume_eq);