diff --git a/kernel/src/main/java/org/kframework/parser/inner/disambiguation/SortInferencer.java b/kernel/src/main/java/org/kframework/parser/inner/disambiguation/SortInferencer.java index be11fac1e91..3437967d7f1 100644 --- a/kernel/src/main/java/org/kframework/parser/inner/disambiguation/SortInferencer.java +++ b/kernel/src/main/java/org/kframework/parser/inner/disambiguation/SortInferencer.java @@ -1,6 +1,5 @@ package org.kframework.parser.inner.disambiguation; -import com.google.gson.GsonBuilder; import org.kframework.attributes.Att; import org.kframework.attributes.Location; import org.kframework.builtin.KLabels; @@ -11,7 +10,6 @@ import org.kframework.definition.NonTerminal; import org.kframework.definition.Production; import org.kframework.kore.KLabel; -import org.kframework.kore.KORE; import org.kframework.kore.Sort; import org.kframework.kore.SortHead; import org.kframework.parser.Ambiguity; @@ -30,6 +28,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -45,16 +44,16 @@ import static org.kframework.kore.KORE.*; import static org.kframework.Collections.*; -/* +/** * Disambiguation transformer which performs type checking and infers the sorts of variables. * - * The overall design is based on the algorithm described in - * "The Simple Essence of Algebraic Subtyping: Principal Type Inference with Subtyping Made Easy" by Lionel Parreaux. + *

The overall design is based on the algorithm described in "The Simple Essence of Algebraic + * Subtyping: Principal Type Inference with Subtyping Made Easy" by Lionel Parreaux. * - * Specifically, we can straightforwardly treat any (non-ambiguous) term in our language as a function in the SimpleSub + *

Specifically, we can straightforwardly treat any (non-ambiguous) term in our language as a + * function in the SimpleSub * - * - Constants are treated as built-ins - * - TermCons are treated as primitive functions + *

- Constants are treated as built-ins - TermCons are treated as primitive functions */ public class SortInferencer { private final Module mod; @@ -66,13 +65,13 @@ public class SortInferencer { private final PrintWriter debug; /** - * Modes controlling how type inference inserts semantic casts x:Sort or strict casts x::Sort on + * Modes controlling how type inference inserts semantic (x:Sort) or strict (x::Sort) casts on * variables in order to record their inferred types. */ public enum CastInsertionMode { /** - * Don't insert any casts. Type inference is still run and will report an error if the - * term is ill-typed, but it never modifies the term. + * Don't insert any casts. Type inference is still run and will report an error if the term is + * ill-typed, but it never modifies the term. * *