I wanted to make some transformation on a z3::expr object. How can I use Z3_substitute_vars
, Z3_translate
and Z3_substitute_
with the C++ API? They are implemented in C#, but I can't find them in C++. It's very strange that they are not implemented.
I tried to use the C api but without any result, here an example:
void substitute(){
z3::context c;
z3::expr a = c.int_const("a");
Z3_ast astA = a;
z3::expr plus = 2*a;
errs() << Z3_ast_to_string(c,plus);
z3::expr b = c.int_const("b");
Z3_ast astB = a;
z3::expr subs(c,Z3_substitute(c,plus,1,&astA,&astB));
errs() << Z3_ast_to_string(c,subs);
}
But a
doesn't get substituted. Am I doing something wrong?