3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-24 13:18:55 +00:00

add bit-vector extract shortcuts to C++ API

Signed-off-by: nikolajbjorner <nbjorner@microsoft.com>
This commit is contained in:
nikolajbjorner 2015-02-27 11:08:49 -08:00
parent f0967c0572
commit 3ca3c948cf
2 changed files with 13 additions and 0 deletions

View file

@ -975,6 +975,15 @@ void substitute_example() {
std::cout << new_f << std::endl;
}
void extract_example() {
std::cout << "extract example\n";
context c;
expr x(c);
x = c.constant("x", c.bv_sort(32));
expr y = x.extract(21, 10);
std::cout << y << " " << y.hi() << " " << y.lo() << "\n";
}
int main() {
try {
demorgan(); std::cout << "\n";
@ -1013,6 +1022,7 @@ int main() {
expr_vector_example(); std::cout << "\n";
exists_expr_vector_example(); std::cout << "\n";
substitute_example(); std::cout << "\n";
extract_example(); std::cout << "\n";
std::cout << "done\n";
}
catch (exception & ex) {