3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-22 02:57:50 +00:00

viable revisit v1

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2023-12-26 14:10:43 -08:00
parent 9cd838f705
commit 6466345755
6 changed files with 638 additions and 43 deletions

View file

@ -0,0 +1,46 @@
/*++
Copyright (c) 2021 Microsoft Corporation
Module Name:
helpers for refining intervals
Author:
Nikolaj Bjorner (nbjorner) 2021-03-19
Jakob Rath 2021-04-06
--*/
#pragma once
#include "sat/smt/polysat/types.h"
namespace polysat {
namespace refine_equal {
/**
* Given a*y0 mod M \in [lo;hi], try to find the largest y_max >= y0 such that for all y \in [y0;y_max] . a*y mod M \in [lo;hi].
* Result may not be optimal.
* NOTE: upper bound is inclusive.
*/
rational compute_y_max(rational const& y0, rational const& a, rational const& lo0, rational const& hi, rational const& M);
/**
* Given a*y0 mod M \in [lo;hi], try to find the smallest y_min <= y0 such that for all y \in [y_min;y0] . a*y mod M \in [lo;hi].
* Result may not be optimal.
* NOTE: upper bound is inclusive.
*/
rational compute_y_min(rational const& y0, rational const& a, rational const& lo, rational const& hi, rational const& M);
/**
* Given a*y0 mod M \in [lo;hi],
* find the largest interval [y_min;y_max] around y0 such that for all y \in [y_min;y_max] . a*y mod M \in [lo;hi].
* Result may not be optimal.
* NOTE: upper bounds are inclusive.
*/
std::pair<rational, rational> compute_y_bounds(rational const& y0, rational const& a, rational const& lo, rational const& hi, rational const& M);
}
}