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

Add ite operator to the C++ API

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-01-04 08:29:25 -08:00
parent f8f23382dc
commit c430fe26aa
2 changed files with 23 additions and 0 deletions

View file

@ -337,6 +337,15 @@ void ite_example() {
std::cout << "term: " << ite << "\n";
}
void ite_example2() {
std::cout << "if-then-else example2\n";
context c;
expr b = c.bool_const("b");
expr x = c.int_const("x");
expr y = c.int_const("y");
std::cout << (ite(b, x, y) > 0) << "\n";
}
/**
\brief Small example using quantifiers.
*/
@ -889,6 +898,7 @@ int main() {
error_example(); std::cout << "\n";
numeral_example(); std::cout << "\n";
ite_example(); std::cout << "\n";
ite_example2(); std::cout << "\n";
quantifier_example(); std::cout << "\n";
unsat_core_example1(); std::cout << "\n";
unsat_core_example2(); std::cout << "\n";