Closed chauhansantosh17 closed 3 weeks ago
pre-processing converts string literals into a concatenation of characters. The output of consequence finding has been pre-processed. It is semantically equal to a string literal, but the get_string() API only works for string literals.
Recently, we have started consuming consequence API from z3 solver class. We are getting some unexpected behaviour from get_string API when it is invoked on z3 expr returned by the consequence API. Let's consider the c++ code snippet that demonstrate the problem
void testConsequenceAPI() { context c; // declare z3 context //declare bool constants expr a = c.bool_const("a"); expr b = c.bool_const("b"); expr d = c.bool_const("d"); expr x = c.int_const("x"); // declare integer constant expr y = c.string_const("y"); // declare string constant
}
The get_string API in the above highlighted line throw exception terminating the program. My expectation is: the get_string API should return a string containing "ABC", considering the assumption expr(inputConstraints) for the consequence API?
Am I missing something? Could you please help to understand why the above get_string API throw expection? What corrective action we can take to fix the exception and to get "ABC" as the return string?