You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Crash: @Ghost on a nested class gives "Sort mismatch ... supplied sort is Outer$Bag" #467
Error: Sort mismatch at argument #1 for function (declare-fun Outer$Bag.size (Outer.Bag) Int) supplied sort is Outer$Bag
9 | public Bag() {}
10 |
11 | @StateRefinement(to = "size(this) == size(old(this)) + 1")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 | public void add() {}
13 |
Error: Sort mismatch at argument #1 for function (declare-fun Outer$Bag.size (Outer.Bag) Int) supplied sort is Outer$Bag
12 | public void add() {}
13 |
14 | @StateRefinement(from = "size(this) > 0")
| ^^^^^^^^^^^^^^
15 | public void remove() {}
16 | }
Cause. The two sides name the class's Z3 sort differently. TranslatorContextToZ3.addGhostFunction builds the ghost's domain from CtTypeReference.toString() (Outer.Bag), while TranslatorContextToZ3.getExpr builds the sort of this from getQualifiedName() (Outer$Bag). For a top-level class both are the same string. Using one naming for both (e.g. getQualifiedName() in addGhostFunction and getSort) should fix it.
Activity