mirror of
https://github.com/Z3Prover/z3
synced 2025-08-25 04:26:00 +00:00
viable revisit v1
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
9cd838f705
commit
6466345755
6 changed files with 638 additions and 43 deletions
30
src/sat/smt/polysat/number.h
Normal file
30
src/sat/smt/polysat/number.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*++
|
||||
Copyright (c) 2021 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
polysat numbers
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2021-03-19
|
||||
Jakob Rath 2021-04-06
|
||||
|
||||
--*/
|
||||
#pragma once
|
||||
#include "sat/smt/polysat/types.h"
|
||||
|
||||
namespace polysat {
|
||||
|
||||
inline unsigned get_parity(rational const& val, unsigned num_bits) {
|
||||
if (val.is_zero())
|
||||
return num_bits;
|
||||
return val.trailing_zeros();
|
||||
};
|
||||
|
||||
/** Return val with the lower k bits set to zero. */
|
||||
inline rational clear_lower_bits(rational const& val, unsigned k) {
|
||||
return val - mod(val, rational::power_of_two(k));
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue