Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Ricardo Costa <rcosta.ms358@gmail.com>
  • Loading branch information
cheestree and rcosta358 authored Mar 30, 2026
commit c85ed97b9ae46ac5d265bbb2d134033f81f680d7
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ public static void storeVariablesSubtypes(Context z3, List<RefinedVariable> vari
}

/**
* Create EnumSorts and register enum literal constants, and create variable for enum if not present
* Creates constants for enum variables in the context and adds them to the translation map if not already present
*/
public static void createEnumVariables(Context z3, Map<String, CtTypeReference<?>> ctx,
public static void translateEnumVariables(Context z3, Map<String, CtTypeReference<?>> ctx,
Map<String, Expr<?>> varTranslation) {
Map<String, EnumSort<?>> enumSorts = new HashMap<>();

Expand All @@ -78,8 +78,7 @@ public static void createEnumVariables(Context z3, Map<String, CtTypeReference<?
CtTypeReference<?> type = entry.getValue();
if (type.isEnum() && type.getDeclaration()instanceof CtEnum<?> enumDecl) {
EnumSort<?> enumSort = translateEnum(z3, varTranslation, enumSorts, type, enumDecl);
// translateEnum may have already registered name as a literal constant
// (e.g. Mode.Photo), no need to overwrite
// may already be registered as enum literal
if (!varTranslation.containsKey(name)) {
varTranslation.put(name, z3.mkConst(name, enumSort));
}
Expand Down
Loading