diff --git a/package.json b/package.json index 0ab1f39..f126606 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "no-name", + "name": "typicalc", "license": "UNLICENSED", "dependencies": { "@polymer/iron-icon": "3.0.1", @@ -7,17 +7,12 @@ "@polymer/polymer": "3.2.0", "@vaadin/flow-frontend": "./target/flow-frontend", "@vaadin/router": "1.7.2", - "@vaadin/vaadin-accordion": "1.2.0", "@vaadin/vaadin-app-layout": "2.2.0", - "@vaadin/vaadin-board": "2.2.0", "@vaadin/vaadin-button": "2.4.0", "@vaadin/vaadin-charts": "7.0.0", - "@vaadin/vaadin-checkbox": "2.5.0", "@vaadin/vaadin-combo-box": "5.4.7", "@vaadin/vaadin-confirm-dialog": "1.3.0", - "@vaadin/vaadin-context-menu": "4.5.0", "@vaadin/vaadin-core-shrinkwrap": "18.0.5", - "@vaadin/vaadin-crud": "1.3.0", "@vaadin/vaadin-custom-field": "1.3.0", "@vaadin/vaadin-date-picker": "4.4.1", "@vaadin/vaadin-details": "1.2.0", @@ -28,17 +23,15 @@ "@vaadin/vaadin-icons": "4.3.2", "@vaadin/vaadin-item": "2.3.0", "@vaadin/vaadin-list-box": "1.4.0", - "@vaadin/vaadin-lumo-styles": "1.6.0", + "@vaadin/vaadin-lumo-styles": "1.6.1", "@vaadin/vaadin-material-styles": "1.3.2", "@vaadin/vaadin-menu-bar": "1.2.1", "@vaadin/vaadin-notification": "1.6.0", "@vaadin/vaadin-ordered-layout": "1.4.0", "@vaadin/vaadin-progress-bar": "1.3.0", - "@vaadin/vaadin-radio-button": "1.5.1", "@vaadin/vaadin-select": "2.4.0", "@vaadin/vaadin-shrinkwrap": "18.0.5", "@vaadin/vaadin-split-layout": "4.3.0", - "@vaadin/vaadin-tabs": "3.2.0", "@vaadin/vaadin-text-field": "2.8.2", "lit-element": "2.3.1", "@vaadin/form": "./target/flow-frontend/form", @@ -74,7 +67,6 @@ "@vaadin/router": "1.7.2", "@polymer/polymer": "3.2.0", "@webcomponents/webcomponentsjs": "^2.2.10", - "@vaadin/vaadin-crud": "1.3.0", "@vaadin/vaadin-grid": "5.7.7", "@vaadin/vaadin-icons": "4.3.2", "@vaadin/vaadin-split-layout": "4.3.0", @@ -84,7 +76,6 @@ "@vaadin/vaadin-select": "2.4.0", "@vaadin/vaadin-app-layout": "2.2.0", "@vaadin/vaadin-item": "2.3.0", - "@vaadin/vaadin-board": "2.2.0", "@vaadin/vaadin-notification": "1.6.0", "@vaadin/vaadin-grid-pro": "2.2.2", "@vaadin/vaadin-progress-bar": "1.3.0", @@ -97,12 +88,9 @@ "@polymer/iron-list": "3.1.0", "@vaadin/vaadin-confirm-dialog": "1.3.0", "@vaadin/vaadin-list-box": "1.4.0", - "@vaadin/vaadin-checkbox": "2.5.0", "@vaadin/vaadin-details": "1.2.0", "@polymer/iron-icon": "3.0.1", "@vaadin/vaadin-context-menu": "4.5.0", - "@vaadin/vaadin-tabs": "3.2.0", - "@vaadin/vaadin-radio-button": "1.5.1", "@vaadin/vaadin-lumo-styles": "1.6.0", "@vaadin/vaadin-material-styles": "1.3.2", "@vaadin/vaadin-custom-field": "1.3.0", diff --git a/src/main/java/edu/kit/typicalc/model/Conclusion.java b/src/main/java/edu/kit/typicalc/model/Conclusion.java index 763667d..d2c1d62 100644 --- a/src/main/java/edu/kit/typicalc/model/Conclusion.java +++ b/src/main/java/edu/kit/typicalc/model/Conclusion.java @@ -13,6 +13,10 @@ import java.util.Map; */ public class Conclusion { + private final Map typeAssumptions; + private final LambdaTerm lambdaTerm; + private final Type type; + /** * Initializes a new Conclusion with the given type assumptions, lambda term and type. * @@ -21,30 +25,30 @@ public class Conclusion { * @param type the type assigned to the lambda term in the conclusion */ protected Conclusion(Map typeAssumptions, LambdaTerm lambdaTerm, Type type) { - // TODO + // TODO: null checks? + this.typeAssumptions = typeAssumptions; + this.lambdaTerm = lambdaTerm; + this.type = type; } /** * @return the type assumptions used in the conclusion */ public Map getTypeAssumptions() { - return null; - // TODO + return typeAssumptions; } /** * @return the lambda term in the conclusion */ public LambdaTerm getLambdaTerm() { - return null; - // TODO + return lambdaTerm; } /** * @return the type assigned to the lambda term in the conclusion */ public Type getType() { - return null; - // TODO + return type; } } diff --git a/src/main/java/edu/kit/typicalc/model/Constraint.java b/src/main/java/edu/kit/typicalc/model/Constraint.java index 34c9a49..29b9bdc 100644 --- a/src/main/java/edu/kit/typicalc/model/Constraint.java +++ b/src/main/java/edu/kit/typicalc/model/Constraint.java @@ -6,6 +6,10 @@ import edu.kit.typicalc.model.type.Type; * Constrains two types to be equal. */ public class Constraint { + + private final Type a; + private final Type b; + /** * Creates a new constraint using the two types. * @@ -13,23 +17,23 @@ public class Constraint { * @param b second type */ public Constraint(Type a, Type b) { - // TODO + // TODO: null checks? + this.a = a; + this.b = b; } /** * @return the first type */ public Type getFirstType() { - return null; - // TODO + return a; } /** * @return the second type */ public Type getSecondType() { - return null; - // TODO + return b; } } diff --git a/src/main/java/edu/kit/typicalc/model/Substitution.java b/src/main/java/edu/kit/typicalc/model/Substitution.java index 65f6713..d597871 100644 --- a/src/main/java/edu/kit/typicalc/model/Substitution.java +++ b/src/main/java/edu/kit/typicalc/model/Substitution.java @@ -7,6 +7,10 @@ import edu.kit.typicalc.model.type.TypeVariable; * A substitution specifies that some type should be replaced by a different type. */ public class Substitution { + + private final TypeVariable a; + private final Type b; + /** * Creates a new substitution using a type variable a and a type b. When the substitution is applied to a type, * all occurring instances of a should be substituted with b. @@ -15,22 +19,22 @@ public class Substitution { * @param b type to insert */ public Substitution(TypeVariable a, Type b) { - // TODO + // TODO: null checks? + this.a = a; + this.b = b; } /** * @return the type variable */ public TypeVariable getVariable() { - return null; - // TODO + return a; } /** * @return the replacement type */ Type getType() { - return null; - // TODO + return b; } } diff --git a/src/main/java/edu/kit/typicalc/model/step/AbsStepDefault.java b/src/main/java/edu/kit/typicalc/model/step/AbsStepDefault.java new file mode 100644 index 0000000..a260062 --- /dev/null +++ b/src/main/java/edu/kit/typicalc/model/step/AbsStepDefault.java @@ -0,0 +1,4 @@ +package edu.kit.typicalc.model.step; + +public class AbsStepDefault { +} diff --git a/src/main/java/edu/kit/typicalc/model/step/AbsStepWithLet.java b/src/main/java/edu/kit/typicalc/model/step/AbsStepWithLet.java new file mode 100644 index 0000000..55ce5ea --- /dev/null +++ b/src/main/java/edu/kit/typicalc/model/step/AbsStepWithLet.java @@ -0,0 +1,4 @@ +package edu.kit.typicalc.model.step; + +public class AbsStepWithLet { +} diff --git a/src/main/java/edu/kit/typicalc/model/step/AppStepDefault.java b/src/main/java/edu/kit/typicalc/model/step/AppStepDefault.java new file mode 100644 index 0000000..036d94b --- /dev/null +++ b/src/main/java/edu/kit/typicalc/model/step/AppStepDefault.java @@ -0,0 +1,4 @@ +package edu.kit.typicalc.model.step; + +public class AppStepDefault { +} diff --git a/src/main/java/edu/kit/typicalc/model/step/ConstStepDefault.java b/src/main/java/edu/kit/typicalc/model/step/ConstStepDefault.java new file mode 100644 index 0000000..5768d76 --- /dev/null +++ b/src/main/java/edu/kit/typicalc/model/step/ConstStepDefault.java @@ -0,0 +1,4 @@ +package edu.kit.typicalc.model.step; + +public class ConstStepDefault { +} diff --git a/src/main/java/edu/kit/typicalc/model/step/LetStepDefault.java b/src/main/java/edu/kit/typicalc/model/step/LetStepDefault.java new file mode 100644 index 0000000..c07affe --- /dev/null +++ b/src/main/java/edu/kit/typicalc/model/step/LetStepDefault.java @@ -0,0 +1,4 @@ +package edu.kit.typicalc.model.step; + +public class LetStepDefault { +} diff --git a/src/main/java/edu/kit/typicalc/model/step/StepVisitor.java b/src/main/java/edu/kit/typicalc/model/step/StepVisitor.java index 3400362..d3702be 100644 --- a/src/main/java/edu/kit/typicalc/model/step/StepVisitor.java +++ b/src/main/java/edu/kit/typicalc/model/step/StepVisitor.java @@ -37,7 +37,7 @@ public interface StepVisitor { /** * Visits a VarStepWithLet. - * @param varD the VarStepWithLet to visit + * @param varL the VarStepWithLet to visit */ void visitVarStepWithLet(VarStepWithLet varL); diff --git a/src/main/java/edu/kit/typicalc/model/step/VarStepDefault.java b/src/main/java/edu/kit/typicalc/model/step/VarStepDefault.java new file mode 100644 index 0000000..a171b9a --- /dev/null +++ b/src/main/java/edu/kit/typicalc/model/step/VarStepDefault.java @@ -0,0 +1,4 @@ +package edu.kit.typicalc.model.step; + +public class VarStepDefault { +} diff --git a/src/main/java/edu/kit/typicalc/model/step/VarStepWithLet.java b/src/main/java/edu/kit/typicalc/model/step/VarStepWithLet.java new file mode 100644 index 0000000..db53b05 --- /dev/null +++ b/src/main/java/edu/kit/typicalc/model/step/VarStepWithLet.java @@ -0,0 +1,4 @@ +package edu.kit.typicalc.model.step; + +public class VarStepWithLet { +} diff --git a/src/main/java/edu/kit/typicalc/model/type/TypeVisitor.java b/src/main/java/edu/kit/typicalc/model/type/TypeVisitor.java new file mode 100644 index 0000000..74e7eb1 --- /dev/null +++ b/src/main/java/edu/kit/typicalc/model/type/TypeVisitor.java @@ -0,0 +1,4 @@ +package edu.kit.typicalc.model.type; + +public interface TypeVisitor { +} diff --git a/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/LatexCreator.java b/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/LatexCreator.java index 4fb1aed..7de2190 100644 --- a/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/LatexCreator.java +++ b/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/LatexCreator.java @@ -3,9 +3,9 @@ package edu.kit.typicalc.view.content.typeinferencecontent; import edu.kit.typicalc.model.Conclusion; import edu.kit.typicalc.model.TypeInfererInterface; -import edu.kit.typicalc.model.step.InferenceStep; -import edu.kit.typicalc.model.step.StepVisitor; +import edu.kit.typicalc.model.step.*; import edu.kit.typicalc.model.term.TermVisitor; +import edu.kit.typicalc.model.type.TypeVisitor; /** * Generates LaTeX-code from a TypeInfererInterface object. Two mostly independent pie- @@ -122,13 +122,13 @@ public class LatexCreator implements StepVisitor, TermVisitor, TypeVisitor { @Override public void visitVarStepWithLet(VarStepWithLet varL) { - generateConclusion(varL, LABEL_ABS, UIC); + generateConclusion(varL, LABEL_VAR, UIC); } @Override public void visitLetStepDefault(LetStepDefault letD) { - generateConclusion(letD, LABEL_ABS, UIC); + generateConclusion(letD, LABEL_LET, UIC); } } diff --git a/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/ShareDialog.java b/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/ShareDialog.java index b1a05f7..7b12349 100644 --- a/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/ShareDialog.java +++ b/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/ShareDialog.java @@ -14,7 +14,7 @@ public class ShareDialog extends Dialog implements LocaleChangeObserver { * to the String that is passed as corresponding parameter. * @param url a permalink to share with other users * @param latexPackages the needed LaTeX-packages to use the displayed mathmatics - * in other LaTeX documents. Should be in the form „\usepackage“ + * in other LaTeX documents. Should be in the form „\\usepackage“ * @param latexCode LaTeX code for users to copy into their own LaTeX document(s) */ protected ShareDialog(String url, String latexPackages, String latexCode) {