I have a similar question to the one here : How to print a Z3 Set object? from which I couldn't figure how to print the values of a set in a model. I have one enumeration sort (code in Java):
- EnumSort rSort = ctx.mkEnumSort(ctx.mkSymbol("res"), ctx.mkSymbol("res1"));
from which I create a set sort:
- SetSort rSet = ctx.mkSetSort(rSort)
By using this set sort, I create a Z3 constant rID and define a simple membership expression:
- BoolExpr c1 = (BoolExpr)ctx.mkSetMembership(rSort.getConsts()[0], rID);
When c1 is satisfiable, I would like to see one possible value for rID in the model. If I try with a const interpretation (i.e. m.getConstInterp(e) where e is a FuncDecl from the model), I get : "Non-zero arity functions and arrays have FunctionInterpretations as a model. Use FuncInterp.".
When I try with func interpretation (i.e. m.getFuncInterp(e)), I get "Argument was not an array constant". Am I doing something wrong here? Isn't it possible to print the values of set object? Alternatively, is there a better way of representing a variable that may contain multiple values from a sort?