mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-09 10:50:42 +00:00
remove superfluous unification step
This commit is contained in:
parent
6cea905dc4
commit
3acdc46bef
@ -91,8 +91,11 @@ public class LatexCreatorConstraints implements StepVisitor {
|
||||
numberGenerator.push();
|
||||
});
|
||||
typeInferer.getMGU().ifPresent(mgu -> {
|
||||
result.add(generateMGU(constraintSets));
|
||||
numberGenerator.push();
|
||||
// avoid superfluous step if unification only has one step (that equals the mgu)
|
||||
if (typeInferer.getUnificationSteps().get().size() > 2) {
|
||||
result.add(generateMGU(constraintSets));
|
||||
numberGenerator.push();
|
||||
}
|
||||
result.add(generateMGU(constraintSets) + LATEX_NEW_LINE + generateFinalType());
|
||||
numberGenerator.push();
|
||||
});
|
||||
|
@ -39,7 +39,6 @@ class LatexCreatorConstraintsTest {
|
||||
+ TREE_VARIABLE + "_{1}" + EQUALS + GENERATED_ASSUMPTION_VARIABLE + "_{1}" + LATEX_CURLY_RIGHT
|
||||
+ PAREN_RIGHT + SPLIT_END + ALIGN_END,
|
||||
ALIGN_BEGIN + constraintSet + MGU_START + mgu + ALIGN_END,
|
||||
ALIGN_BEGIN + constraintSet + MGU_START + mgu + ALIGN_END,
|
||||
ALIGN_BEGIN + constraintSet + MGU_START + mgu + LATEX_NEW_LINE + AMPERSAND + SIGMA + PAREN_LEFT
|
||||
+ TREE_VARIABLE + "_{1}" + PAREN_RIGHT + EQUALS + GENERATED_ASSUMPTION_VARIABLE
|
||||
+ "_{1}" + ALIGN_END);
|
||||
|
Loading…
Reference in New Issue
Block a user