Skip to content

Commit

Permalink
Make z3 use unified enum literal name transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
RipplB committed Oct 5, 2023
1 parent 6fd805f commit 0aa36d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ private Expr<?> transformFpLit(final com.microsoft.z3.Expr term) {

private Expr<EnumType> transformEnumLit(final com.microsoft.z3.Expr term, final EnumType enumType) {
String longName = term.getFuncDecl().getName().toString();
String literal = longName.contains(".") ? longName.substring(longName.indexOf(".") + 1) : longName;
String literal = EnumType.getShortName(longName);
return EnumLitExpr.of(enumType, literal);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void reset() {
}

private EnumSort createEnumSort(EnumType enumType) {
return context.mkEnumSort(enumType.getName(), enumType.getValues().stream().map(lit -> String.format("%s.%s", enumType.getName(), lit)).toArray(String[]::new));
return context.mkEnumSort(enumType.getName(), enumType.getValues().stream().map(lit -> EnumType.makeLongName(enumType, lit)).toArray(String[]::new));
}

}

0 comments on commit 0aa36d3

Please sign in to comment.