In the following code, I put a clearly unsatisfiable Z3 declaration and then try to use the C++/C Z3 APIs to see it programmatically solved.
The problem is that this code always triggers the check that outputs: "SAT?!". i.e. the clearly unsatisfiable expression is determined to be satisfiable in the current usage of the API calls.
How can I get this kind of operation to work as expected?
#include "z3++.h"
int main(){
z3::context c;
std::string testing = "(declare-const p0 Bool)(assert(= p0 true))(assert(= p0 false))(check-sat)";
Z3_ast parsed = Z3_parse_smtlib2_string(c,testing.c_str(),0,0,0,0,0,0);
z3::expr e(c, parsed);
z3::solver s(c);
if(s.check() == z3::sat)
std::cout << "SAT?!\n";
return 0;
}