From 427da2bcd8c64df9a65f45f64e74802610649570 Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Wed, 27 Jan 2021 10:36:04 +0100 Subject: [PATCH 1/4] Mehr Platzhalter-Klassen --- .../java/edu/kit/typicalc/model/step/AbsStepDefault.java | 4 ++++ .../java/edu/kit/typicalc/model/step/AbsStepWithLet.java | 4 ++++ .../java/edu/kit/typicalc/model/step/AppStepDefault.java | 4 ++++ .../edu/kit/typicalc/model/step/ConstStepDefault.java | 4 ++++ .../java/edu/kit/typicalc/model/step/LetStepDefault.java | 4 ++++ .../java/edu/kit/typicalc/model/step/VarStepDefault.java | 4 ++++ .../java/edu/kit/typicalc/model/type/TypeVisitor.java | 4 ++++ .../view/content/typeinferencecontent/LatexCreator.java | 8 ++++++++ .../view/content/typeinferencecontent/ShareDialog.java | 2 +- 9 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/main/java/edu/kit/typicalc/model/step/AbsStepDefault.java create mode 100644 src/main/java/edu/kit/typicalc/model/step/AbsStepWithLet.java create mode 100644 src/main/java/edu/kit/typicalc/model/step/AppStepDefault.java create mode 100644 src/main/java/edu/kit/typicalc/model/step/ConstStepDefault.java create mode 100644 src/main/java/edu/kit/typicalc/model/step/LetStepDefault.java create mode 100644 src/main/java/edu/kit/typicalc/model/step/VarStepDefault.java create mode 100644 src/main/java/edu/kit/typicalc/model/type/TypeVisitor.java 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/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/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 a5eeca6..dd974e0 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 @@ -2,7 +2,15 @@ package edu.kit.typicalc.view.content.typeinferencecontent; import edu.kit.typicalc.model.TypeInfererInterface; +import edu.kit.typicalc.model.step.AbsStepDefault; +import edu.kit.typicalc.model.step.AbsStepWithLet; +import edu.kit.typicalc.model.step.AppStepDefault; +import edu.kit.typicalc.model.step.ConstStepDefault; +import edu.kit.typicalc.model.step.LetStepDefault; import edu.kit.typicalc.model.step.StepVisitor; +import edu.kit.typicalc.model.step.VarStepDefault; +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- 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) { From 06492723eb5ddd63cbc4cbde3ad3b9e69dd528c2 Mon Sep 17 00:00:00 2001 From: Johanna Stuber Date: Wed, 27 Jan 2021 10:55:17 +0100 Subject: [PATCH 2/4] Conclusio implementieren --- .../edu/kit/typicalc/model/Conclusion.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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; } } From 6d3314a5192c720fee8be50892e20657b30c38e8 Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Wed, 27 Jan 2021 10:58:08 +0100 Subject: [PATCH 3/4] Projektname in package.json --- package.json | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) 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", From a642279be148f9a2c2d52670446e454c83758fc5 Mon Sep 17 00:00:00 2001 From: Johanna Stuber Date: Wed, 27 Jan 2021 11:10:09 +0100 Subject: [PATCH 4/4] implement Constraint, Substitution --- .../java/edu/kit/typicalc/model/Constraint.java | 14 +++++++++----- .../java/edu/kit/typicalc/model/Substitution.java | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) 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; } }