mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 00:55:31 +00:00
make it easier to iterate over arguments of an application
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e9a4a9a390
commit
55285b2193
2 changed files with 35 additions and 0 deletions
|
@ -1286,6 +1286,20 @@ static void string_issue_2298() {
|
|||
s.pop();
|
||||
}
|
||||
|
||||
void iterate_args() {
|
||||
std::cout << "iterate arguments\n";
|
||||
context c;
|
||||
expr x = c.int_const("x");
|
||||
expr y = c.int_const("y");
|
||||
sort I = c.int_sort();
|
||||
func_decl g = function("g", I, I, I);
|
||||
expr e = g(x, y);
|
||||
std::cout << "expression " << e << "\n";
|
||||
for (expr arg : e)
|
||||
std::cout << "arg " << arg << "\n";
|
||||
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
try {
|
||||
|
@ -1339,6 +1353,7 @@ int main() {
|
|||
recfun_example(); std::cout << "\n";
|
||||
string_values(); std::cout << "\n";
|
||||
string_issue_2298(); std::cout << "\n";
|
||||
iterate_args(); std::cout << "\n";
|
||||
std::cout << "done\n";
|
||||
}
|
||||
catch (exception & ex) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue