Sets are internally represented by arrays, which in turn have functions as models. getConstInterp fails, because rID
is of set-type (internally array-type) and it throws an according exception. From the example it's not clear what e
is, but here is an example of how to get at the FuncInterp for rID:
Context ctx = new Context(cfg);
EnumSort rSort = ctx.mkEnumSort(ctx.mkSymbol("res"), ctx.mkSymbol("res1"));
SetSort rSet = ctx.mkSetSort(rSort);
Expr rID = ctx.mkConst("rID", rSet);
BoolExpr c1 = (BoolExpr)ctx.mkSetMembership(rSort.getConsts()[0], rID);
Solver s = ctx.mkSolver();
s.add(c1);
Status status = s.check();
Model m = s.getModel();
System.out.println(status);
System.out.println("Model = " + m);
FuncInterp fi = m.getFuncInterp(rID.getFuncDecl());
System.out.println("fi="+ fi);
Note that the call to getFuncInterp
gets the FuncDecl of the constant rID, which may be the source of the confusion.