3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-11-24 14:41:28 +00:00

Merge shared parts from polysat branch (#7063)

* sat_literal: make constants constexpr

* dlist: rename elem -> list

* tbv: use get_bit

* additional pdd and rational tests

* egraph: callback setters take functions by value

This allows to set callbacks without defining a separate variable for
the callback lambda.

(previous usage does one copy of the function, exactly as before)

* cmake: enable compiler error when non-void function does not return value
This commit is contained in:
Jakob Rath 2023-12-28 20:11:53 +01:00 committed by GitHub
parent 53c95e3627
commit ec2b8eb4ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 101 additions and 43 deletions

View file

@ -466,6 +466,28 @@ static void tst12() {
std::cout << i << ": " << r.get_bit(i) << "\n";
}
static void tst13() {
std::cout << "test13\n";
rational const step = rational(1) / rational(3);
for (rational r; r < 5000; r += step) {
{
unsigned k = r.prev_power_of_two();
if (r >= 1) {
VERIFY(rational::power_of_two(k) <= r);
VERIFY(r < rational::power_of_two(k + 1));
}
else {
VERIFY_EQ(k, 0);
}
}
{
unsigned k = r.next_power_of_two();
VERIFY(r <= rational::power_of_two(k));
VERIFY(k == 0 || rational::power_of_two(k - 1) < r);
}
}
}
void tst_rational() {
TRACE("rational", tout << "starting rational test...\n";);
@ -492,4 +514,5 @@ void tst_rational() {
tst10(true);
tst10(false);
tst12();
tst13();
}