3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

wip - adding context equation solver

the solve_eqs_tactic is to be replaced by a re-implementation that uses solve_eqs in the simplifiers directory.
The re-implementation should address efficiency issues with the previous code.
At this point it punts on low level proofs. The plan is to use coarser
dependency tracking instead of low level proofs for pre-processing. Dependencies can be converted into a proof hint representation that can be checked using a stronger checker.
This commit is contained in:
Nikolaj Bjorner 2022-11-05 10:34:57 -07:00
parent ae2672f132
commit 4d8860c0bc
15 changed files with 416 additions and 117 deletions

View file

@ -34,8 +34,8 @@ int mpn_manager::compare(mpn_digit const * a, unsigned lnga,
trace(a, lnga);
unsigned j = max(lnga, lngb) - 1;
for (; j != -1u && res == 0; j--) {
unsigned j = max(lnga, lngb);
for (; j-- > 0 && res == 0;) {
mpn_digit const & u_j = (j < lnga) ? a[j] : zero;
mpn_digit const & v_j = (j < lngb) ? b[j] : zero;
if (u_j > v_j)
@ -310,7 +310,7 @@ bool mpn_manager::div_n(mpn_sbuffer & numer, mpn_sbuffer const & denom,
mpn_double_digit q_hat, temp, r_hat;
mpn_digit borrow;
for (unsigned j = m-1; j != -1u; j--) {
for (unsigned j = m; j-- > 0; ) {
temp = (((mpn_double_digit)numer[j+n]) << DIGIT_BITS) | ((mpn_double_digit)numer[j+n-1]);
q_hat = temp / (mpn_double_digit) denom[n-1];
r_hat = temp % (mpn_double_digit) denom[n-1];
@ -388,7 +388,7 @@ char * mpn_manager::to_string(mpn_digit const * a, unsigned lng, char * buf, uns
void mpn_manager::display_raw(std::ostream & out, mpn_digit const * a, unsigned lng) const {
out << "[";
for (unsigned i = lng-1; i != -1u; i-- ) { out << a[i]; if (i != 0) out << "|"; }
for (unsigned i = lng; i-- > 0; ) { out << a[i]; if (i != 0) out << "|"; }
out << "]";
}

View file

@ -368,6 +368,14 @@ bool any_of(S& set, T const& p) {
return false;
}
template<typename S, typename T>
bool all_of(S& set, T const& p) {
for (auto const& s : set)
if (!p(s))
return false;
return true;
}
/**
\brief Iterator for the [0..sz[0]) X [0..sz[1]) X ... X [0..sz[n-1]).
it contains the current value.