Reputation: 3462
I am migrating from Z3 version 3.2 to version 4.0. However, the code which was working earlier, no longer works directly and I am trying to find out the reasons for the same. I reduced the entire code to a very simple declaration and assertion, still it won't work. The code is -
long intSort = Z3_mk_int_sort (context);
long periodDeclStr = Z3_mk_string_symbol(context, "period");
long periodVar = Z3_mk_const(context, periodDeclStr, intSort);
long solver = z3_mk_solver();
long zero = Z3_mk_int (context, 0, intSort);
long eqSt = Z3_mk_eq(context, periodVar, zero);
Z3_solver_assert (context, solver, eqSt);
The problem is with the second last statement Z3_mk_eq()
I receive the error as -
WARNING: invalid function application, sort mismatch on argument at position 2
WARNING: (define = arith arith Bool) applied to:
period of sort arith
0::Int of sort Int
My Questions are as follows -
Sorry for the trouble. I was mixing up solver and context to pass them to the solver.
However, the problem still remains the unsolved.
I am having a crash in Z3_ast_to_String()
API.
I will try to resolve the problem and post the update.
Upvotes: 1
Views: 236
Reputation: 8359
There is an interaction log now with Z3 4.0 that records the API interaction precisely. It should be possible use this feature to debug the JNI layering and the bugs you find. The log is opened using Z3_open_log(). You should open the log before creating any contexts. You can close the log at any point as well (Z3_close_log()) if you only want to capture a subset of the interaction. You can replay the log by giving the the suffix ".log" and run Z3 on it. Alternatively, you can run Z3 with the option /log, that is, "Z3.exe /log " to replay the interaction.
Upvotes: 3
Reputation: 326
Don't you want Z3_mk_eq(context, id, zero)
instead of Z3_mk_eq(context, periodDecl, zero)
?
Upvotes: 0