Display inference tree in view

This commit is contained in:
Arne Keller 2021-01-31 11:09:13 +01:00
parent 7bf691a693
commit 0d3d806e9c
3 changed files with 9 additions and 11 deletions

View File

@ -57,7 +57,7 @@ public class LatexCreator implements StepVisitor, TermVisitor, TypeVisitor {
private final TypeInfererInterface typeInferer;
private final StringBuilder tree;
private final boolean stepLabels;
@ -81,18 +81,18 @@ public class LatexCreator implements StepVisitor, TermVisitor, TypeVisitor {
}
protected LatexCreator(TypeInfererInterface typeInferer, boolean stepLabels) {
this.typeInferer = typeInferer;
this.tree = new StringBuilder();
this.stepLabels = stepLabels;
// typeInferer.getFirstInferenceStep().accept(this);
}
/**
* @return the LaTeX-code for the proof tree
*/
protected String getTree() {
return "the $\\LaTeX$ inference tree should be here ";
} // todo implement
typeInferer.getFirstInferenceStep().accept(this);
return TREE_BEGIN + tree.toString() + TREE_END;
}
/**
* @return the LaTeX-code for constraints nad unification

View File

@ -21,9 +21,9 @@ public class TypeInferenceView extends VerticalLayout
private MathjaxUnification unification;
private MathjaxProofTree tree;
private TypeInfererInterface typeInferer;
private Div content;
private ControlPanel controlPanel;
private final transient TypeInfererInterface typeInferer;
private final Div content;
private final ControlPanel controlPanel;
public TypeInferenceView() {
typeInferer = ComponentUtil.getData(UI.getCurrent(), TypeInfererInterface.class);

View File

@ -1,9 +1,7 @@
/**
* This package contains the needed classes for displaying the type inference algorithm step-by-step.
*/
@NonNullFields
@NonNullApi
package edu.kit.typicalc.view.content.typeinferencecontent;
import org.springframework.lang.NonNullApi;
import org.springframework.lang.NonNullFields;
import org.springframework.lang.NonNullApi;