File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
liquidjava-verifier/src/main/java/liquidjava/smt Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1212import com .microsoft .z3 .RealExpr ;
1313import com .microsoft .z3 .Solver ;
1414import com .microsoft .z3 .Sort ;
15+ import com .microsoft .z3 .Symbol ;
1516import com .microsoft .z3 .Model ;
1617
1718import java .util .ArrayList ;
2728import liquidjava .processor .context .AliasWrapper ;
2829import liquidjava .utils .Utils ;
2930import liquidjava .utils .constants .Keys ;
31+ import com .microsoft .z3 .enumerations .Z3_sort_kind ;
3032
3133import org .apache .commons .lang3 .NotImplementedException ;
3234
@@ -63,10 +65,10 @@ public Counterexample getCounterexample(Model model) {
6365 // Extract constant variable assignments
6466 for (FuncDecl <?> decl : model .getDecls ()) {
6567 if (decl .getArity () == 0 ) {
66- String name = decl .getName (). toString ();
67- String value = model .getConstInterp (decl ). toString ( );
68- // Skip opaque Z3 object values
69- if (! value .contains ( "!val!" ) )
68+ Symbol name = decl .getName ();
69+ Expr <?> value = model .getConstInterp (decl );
70+ // Skip values of uninterpreted sorts
71+ if (value .getSort (). getSortKind () != Z3_sort_kind . Z3_UNINTERPRETED_SORT )
7072 assignments .add (name + " == " + value );
7173 }
7274 }
You can’t perform that action at this time.
0 commit comments