mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-13 20:53:09 +00:00
use LinkedHashMap for typeAssumptions so they appear sorted in the tree
This commit is contained in:
parent
4697b38694
commit
7e2357f2f2
@ -1,19 +1,10 @@
|
|||||||
package edu.kit.typicalc.model;
|
package edu.kit.typicalc.model;
|
||||||
|
|
||||||
import edu.kit.typicalc.model.step.*;
|
import edu.kit.typicalc.model.step.*;
|
||||||
import edu.kit.typicalc.model.term.AbsTerm;
|
import edu.kit.typicalc.model.term.*;
|
||||||
import edu.kit.typicalc.model.term.AppTerm;
|
|
||||||
import edu.kit.typicalc.model.term.ConstTerm;
|
|
||||||
import edu.kit.typicalc.model.term.LambdaTerm;
|
|
||||||
import edu.kit.typicalc.model.term.LetTerm;
|
|
||||||
import edu.kit.typicalc.model.term.TermVisitorTree;
|
|
||||||
import edu.kit.typicalc.model.term.VarTerm;
|
|
||||||
import edu.kit.typicalc.model.type.*;
|
import edu.kit.typicalc.model.type.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Models the proof tree formed when the type of a lambda term is inferred.
|
* Models the proof tree formed when the type of a lambda term is inferred.
|
||||||
@ -126,7 +117,7 @@ public class Tree implements TermVisitorTree {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InferenceStep visit(AbsTerm absTerm, Map<VarTerm, TypeAbstraction> typeAssumptions, Type conclusionType) {
|
public InferenceStep visit(AbsTerm absTerm, Map<VarTerm, TypeAbstraction> typeAssumptions, Type conclusionType) {
|
||||||
Map<VarTerm, TypeAbstraction> extendedTypeAssumptions = new HashMap<>(typeAssumptions);
|
Map<VarTerm, TypeAbstraction> extendedTypeAssumptions = new LinkedHashMap<>(typeAssumptions);
|
||||||
Type assType = typeVarFactory.nextTypeVariable();
|
Type assType = typeVarFactory.nextTypeVariable();
|
||||||
TypeAbstraction assAbs = new TypeAbstraction(assType);
|
TypeAbstraction assAbs = new TypeAbstraction(assType);
|
||||||
extendedTypeAssumptions.put(absTerm.getVariable(), assAbs);
|
extendedTypeAssumptions.put(absTerm.getVariable(), assAbs);
|
||||||
@ -152,7 +143,7 @@ public class Tree implements TermVisitorTree {
|
|||||||
InferenceStep premise;
|
InferenceStep premise;
|
||||||
|
|
||||||
if (typeInfererLet.getType().isPresent()) {
|
if (typeInfererLet.getType().isPresent()) {
|
||||||
Map<VarTerm, TypeAbstraction> extendedTypeAssumptions = new HashMap<>(typeAssumptions);
|
Map<VarTerm, TypeAbstraction> extendedTypeAssumptions = new LinkedHashMap<>(typeAssumptions);
|
||||||
extendedTypeAssumptions.replaceAll((key, value) -> {
|
extendedTypeAssumptions.replaceAll((key, value) -> {
|
||||||
Type newType = value.getInnerType();
|
Type newType = value.getInnerType();
|
||||||
for (Substitution substitution : typeInfererLet.getMGU().orElseThrow(IllegalStateException::new)) {
|
for (Substitution substitution : typeInfererLet.getMGU().orElseThrow(IllegalStateException::new)) {
|
||||||
|
@ -7,12 +7,7 @@ import edu.kit.typicalc.model.type.Type;
|
|||||||
import edu.kit.typicalc.model.type.TypeAbstraction;
|
import edu.kit.typicalc.model.type.TypeAbstraction;
|
||||||
import edu.kit.typicalc.model.type.TypeVariableKind;
|
import edu.kit.typicalc.model.type.TypeVariableKind;
|
||||||
|
|
||||||
import java.util.ArrayDeque;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type inferer is responsible for the whole type inference of a given lambda term, taking
|
* The type inferer is responsible for the whole type inference of a given lambda term, taking
|
||||||
@ -64,7 +59,7 @@ public class TypeInferer implements TypeInfererInterface {
|
|||||||
TypeVariableFactory typeVarFactory = new TypeVariableFactory(TypeVariableKind.GENERATED_TYPE_ASSUMPTION);
|
TypeVariableFactory typeVarFactory = new TypeVariableFactory(TypeVariableKind.GENERATED_TYPE_ASSUMPTION);
|
||||||
Set<VarTerm> freeVariables = lambdaTerm.getFreeVariables();
|
Set<VarTerm> freeVariables = lambdaTerm.getFreeVariables();
|
||||||
|
|
||||||
Map<VarTerm, TypeAbstraction> generatedTypeAss = new HashMap<>();
|
Map<VarTerm, TypeAbstraction> generatedTypeAss = new LinkedHashMap<>();
|
||||||
for (VarTerm varTerm : freeVariables) {
|
for (VarTerm varTerm : freeVariables) {
|
||||||
generatedTypeAss.put(varTerm, new TypeAbstraction(typeVarFactory.nextTypeVariable()));
|
generatedTypeAss.put(varTerm, new TypeAbstraction(typeVarFactory.nextTypeVariable()));
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import edu.kit.typicalc.util.Result;
|
|||||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@ -20,7 +20,7 @@ public class TypeAssumptionParser { // TODO: document type syntax? or refer to o
|
|||||||
private static final Pattern TYPE_VARIABLE_PATTERN = Pattern.compile("t(\\d+)");
|
private static final Pattern TYPE_VARIABLE_PATTERN = Pattern.compile("t(\\d+)");
|
||||||
|
|
||||||
public Result<Map<VarTerm, TypeAbstraction>, ParseError> parse(Map<String, String> oldAssumptions) {
|
public Result<Map<VarTerm, TypeAbstraction>, ParseError> parse(Map<String, String> oldAssumptions) {
|
||||||
Map<VarTerm, TypeAbstraction> typeAssumptions = new HashMap<>();
|
Map<VarTerm, TypeAbstraction> typeAssumptions = new LinkedHashMap<>();
|
||||||
for (Map.Entry<String, String> entry : oldAssumptions.entrySet()) {
|
for (Map.Entry<String, String> entry : oldAssumptions.entrySet()) {
|
||||||
VarTerm var = new VarTerm(entry.getKey());
|
VarTerm var = new VarTerm(entry.getKey());
|
||||||
Result<TypeAbstraction, ParseError> typeAbs = parseType(entry.getValue());
|
Result<TypeAbstraction, ParseError> typeAbs = parseType(entry.getValue());
|
||||||
|
@ -9,14 +9,14 @@ import nl.jqno.equalsverifier.EqualsVerifier;
|
|||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
class ConclusionTest {
|
class ConclusionTest {
|
||||||
|
|
||||||
private static final Map<VarTerm, TypeAbstraction> TYPE_ASSUMPTIONS = new HashMap<>();
|
private static final Map<VarTerm, TypeAbstraction> TYPE_ASSUMPTIONS = new LinkedHashMap<>();
|
||||||
private static final LambdaTerm LAMBDA_TERM = new VarTerm("var");
|
private static final LambdaTerm LAMBDA_TERM = new VarTerm("var");
|
||||||
private static final Type TYPE = new NamedType("type");
|
private static final Type TYPE = new NamedType("type");
|
||||||
|
|
||||||
|
@ -2,19 +2,19 @@ package edu.kit.typicalc.model;
|
|||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
class ModelImplTest {
|
class ModelImplTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getTypeInferer() {
|
void getTypeInferer() {
|
||||||
ModelImpl model = new ModelImpl();
|
ModelImpl model = new ModelImpl();
|
||||||
Map<String, String> map = new HashMap<>();
|
Map<String, String> map = new LinkedHashMap<>();
|
||||||
map.put("x", "int");
|
map.put("x", "int");
|
||||||
Map<String, String> map2 = new HashMap<>();
|
Map<String, String> map2 = new LinkedHashMap<>();
|
||||||
map2.put("a.x", "3.int");
|
map2.put("a.x", "3.int");
|
||||||
assertTrue(model.getTypeInferer("test.x.x.test", map2).isError());
|
assertTrue(model.getTypeInferer("test.x.x.test", map2).isError());
|
||||||
assertTrue(model.getTypeInferer("x", map2).isError());
|
assertTrue(model.getTypeInferer("x", map2).isError());
|
||||||
|
@ -13,7 +13,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
|||||||
|
|
||||||
class TreeTest {
|
class TreeTest {
|
||||||
|
|
||||||
private static final Map<VarTerm, TypeAbstraction> TYPE_ASSUMPTIONS = new HashMap<>();
|
private static final Map<VarTerm, TypeAbstraction> TYPE_ASSUMPTIONS = new LinkedHashMap<>();
|
||||||
private static final ConstTerm CONST = new IntegerTerm(10);
|
private static final ConstTerm CONST = new IntegerTerm(10);
|
||||||
private static final VarTerm VAR = new VarTerm("var");
|
private static final VarTerm VAR = new VarTerm("var");
|
||||||
private static final AbsTerm ABS = new AbsTerm(VAR, VAR);
|
private static final AbsTerm ABS = new AbsTerm(VAR, VAR);
|
||||||
@ -46,7 +46,7 @@ class TreeTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void missingTypeAssumptionForVar() {
|
void missingTypeAssumptionForVar() {
|
||||||
Map<VarTerm, TypeAbstraction> ass = new HashMap<>();
|
Map<VarTerm, TypeAbstraction> ass = new LinkedHashMap<>();
|
||||||
assertThrows(IllegalStateException.class, () -> {
|
assertThrows(IllegalStateException.class, () -> {
|
||||||
new Tree(ass, VAR);
|
new Tree(ass, VAR);
|
||||||
});
|
});
|
||||||
@ -87,7 +87,7 @@ class TreeTest {
|
|||||||
|
|
||||||
Tree tree = new Tree(TYPE_ASSUMPTIONS, ABS);
|
Tree tree = new Tree(TYPE_ASSUMPTIONS, ABS);
|
||||||
|
|
||||||
Map<VarTerm, TypeAbstraction> varTypeAss = new HashMap<>(TYPE_ASSUMPTIONS);
|
Map<VarTerm, TypeAbstraction> varTypeAss = new LinkedHashMap<>(TYPE_ASSUMPTIONS);
|
||||||
varTypeAss.put(VAR, new TypeAbstraction(variable2));
|
varTypeAss.put(VAR, new TypeAbstraction(variable2));
|
||||||
Conclusion varConclusion = new Conclusion(varTypeAss, VAR, variable3);
|
Conclusion varConclusion = new Conclusion(varTypeAss, VAR, variable3);
|
||||||
Constraint varConstraint = new Constraint(variable2, variable3);
|
Constraint varConstraint = new Constraint(variable2, variable3);
|
||||||
|
@ -5,7 +5,7 @@ import edu.kit.typicalc.model.type.*;
|
|||||||
import edu.kit.typicalc.util.Result;
|
import edu.kit.typicalc.util.Result;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static edu.kit.typicalc.model.type.NamedType.BOOLEAN;
|
import static edu.kit.typicalc.model.type.NamedType.BOOLEAN;
|
||||||
@ -17,7 +17,7 @@ class TypeAssumptionParserTest {
|
|||||||
@Test
|
@Test
|
||||||
void simpleType() {
|
void simpleType() {
|
||||||
TypeAssumptionParser parser = new TypeAssumptionParser();
|
TypeAssumptionParser parser = new TypeAssumptionParser();
|
||||||
HashMap<String, String> assumptions = new HashMap<>();
|
Map<String, String> assumptions = new LinkedHashMap<>();
|
||||||
assumptions.put("a", "int");
|
assumptions.put("a", "int");
|
||||||
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
||||||
assertTrue(type.isOk());
|
assertTrue(type.isOk());
|
||||||
@ -31,7 +31,7 @@ class TypeAssumptionParserTest {
|
|||||||
@Test
|
@Test
|
||||||
void typeVariablesOneDigitIndex() {
|
void typeVariablesOneDigitIndex() {
|
||||||
TypeAssumptionParser parser = new TypeAssumptionParser();
|
TypeAssumptionParser parser = new TypeAssumptionParser();
|
||||||
HashMap<String, String> assumptions = new HashMap<>();
|
Map<String, String> assumptions = new LinkedHashMap<>();
|
||||||
assumptions.put("x", "t1");
|
assumptions.put("x", "t1");
|
||||||
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
||||||
assertTrue(type.isOk());
|
assertTrue(type.isOk());
|
||||||
@ -41,7 +41,7 @@ class TypeAssumptionParserTest {
|
|||||||
assertEquals(new VarTerm("x"), assumption.getKey());
|
assertEquals(new VarTerm("x"), assumption.getKey());
|
||||||
assertEquals(new TypeAbstraction(new TypeVariable(TypeVariableKind.USER_INPUT, 1)), assumption.getValue());
|
assertEquals(new TypeAbstraction(new TypeVariable(TypeVariableKind.USER_INPUT, 1)), assumption.getValue());
|
||||||
|
|
||||||
HashMap<String, String> assumptions2 = new HashMap<>();
|
Map<String, String> assumptions2 = new LinkedHashMap<>();
|
||||||
assumptions2.put("x", "t001");
|
assumptions2.put("x", "t001");
|
||||||
Result<Map<VarTerm, TypeAbstraction>, ParseError> type2 = parser.parse(assumptions2);
|
Result<Map<VarTerm, TypeAbstraction>, ParseError> type2 = parser.parse(assumptions2);
|
||||||
assertTrue(type.isOk());
|
assertTrue(type.isOk());
|
||||||
@ -55,7 +55,7 @@ class TypeAssumptionParserTest {
|
|||||||
@Test
|
@Test
|
||||||
void typeVariablesMultipleDigitIndex() {
|
void typeVariablesMultipleDigitIndex() {
|
||||||
TypeAssumptionParser parser = new TypeAssumptionParser();
|
TypeAssumptionParser parser = new TypeAssumptionParser();
|
||||||
HashMap<String, String> assumptions = new HashMap<>();
|
Map<String, String> assumptions = new LinkedHashMap<>();
|
||||||
assumptions.put("x", "t123456");
|
assumptions.put("x", "t123456");
|
||||||
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
||||||
assertTrue(type.isOk());
|
assertTrue(type.isOk());
|
||||||
@ -69,7 +69,7 @@ class TypeAssumptionParserTest {
|
|||||||
@Test
|
@Test
|
||||||
void namedTypeStartingWithT() {
|
void namedTypeStartingWithT() {
|
||||||
TypeAssumptionParser parser = new TypeAssumptionParser();
|
TypeAssumptionParser parser = new TypeAssumptionParser();
|
||||||
HashMap<String, String> assumptions = new HashMap<>();
|
Map<String, String> assumptions = new LinkedHashMap<>();
|
||||||
assumptions.put("x", "tau1");
|
assumptions.put("x", "tau1");
|
||||||
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
||||||
assertTrue(type.isOk());
|
assertTrue(type.isOk());
|
||||||
@ -83,7 +83,7 @@ class TypeAssumptionParserTest {
|
|||||||
@Test
|
@Test
|
||||||
void functionType() {
|
void functionType() {
|
||||||
TypeAssumptionParser parser = new TypeAssumptionParser();
|
TypeAssumptionParser parser = new TypeAssumptionParser();
|
||||||
HashMap<String, String> assumptions = new HashMap<>();
|
Map<String, String> assumptions = new LinkedHashMap<>();
|
||||||
assumptions.put("id", "int -> int");
|
assumptions.put("id", "int -> int");
|
||||||
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
||||||
assertTrue(type.isOk());
|
assertTrue(type.isOk());
|
||||||
@ -93,7 +93,7 @@ class TypeAssumptionParserTest {
|
|||||||
assertEquals(new VarTerm("id"), assumption.getKey());
|
assertEquals(new VarTerm("id"), assumption.getKey());
|
||||||
assertEquals(new TypeAbstraction(new FunctionType(INT, INT)), assumption.getValue());
|
assertEquals(new TypeAbstraction(new FunctionType(INT, INT)), assumption.getValue());
|
||||||
|
|
||||||
HashMap<String, String> assumptions2 = new HashMap<>();
|
Map<String, String> assumptions2 = new LinkedHashMap<>();
|
||||||
assumptions2.put("f", "int -> int -> int");
|
assumptions2.put("f", "int -> int -> int");
|
||||||
type = parser.parse(assumptions2);
|
type = parser.parse(assumptions2);
|
||||||
if (type.isError()) {
|
if (type.isError()) {
|
||||||
@ -115,7 +115,7 @@ class TypeAssumptionParserTest {
|
|||||||
@Test
|
@Test
|
||||||
void functionTypeWithVariables() {
|
void functionTypeWithVariables() {
|
||||||
TypeAssumptionParser parser = new TypeAssumptionParser();
|
TypeAssumptionParser parser = new TypeAssumptionParser();
|
||||||
HashMap<String, String> assumptions = new HashMap<>();
|
Map<String, String> assumptions = new LinkedHashMap<>();
|
||||||
assumptions.put("fun", "t0 -> t0");
|
assumptions.put("fun", "t0 -> t0");
|
||||||
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
||||||
assertTrue(type.isOk());
|
assertTrue(type.isOk());
|
||||||
@ -130,7 +130,7 @@ class TypeAssumptionParserTest {
|
|||||||
@Test
|
@Test
|
||||||
void complicatedTypes() {
|
void complicatedTypes() {
|
||||||
TypeAssumptionParser parser = new TypeAssumptionParser();
|
TypeAssumptionParser parser = new TypeAssumptionParser();
|
||||||
HashMap<String, String> assumptions = new HashMap<>();
|
Map<String, String> assumptions = new LinkedHashMap<>();
|
||||||
assumptions.put("id", "(int -> int) -> (boolean -> boolean)");
|
assumptions.put("id", "(int -> int) -> (boolean -> boolean)");
|
||||||
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
||||||
if (type.isError()) {
|
if (type.isError()) {
|
||||||
@ -148,7 +148,7 @@ class TypeAssumptionParserTest {
|
|||||||
new FunctionType(BOOLEAN, BOOLEAN)
|
new FunctionType(BOOLEAN, BOOLEAN)
|
||||||
)), assumption.getValue());
|
)), assumption.getValue());
|
||||||
parser = new TypeAssumptionParser();
|
parser = new TypeAssumptionParser();
|
||||||
HashMap<String, String> assumptions2 = new HashMap<>();
|
Map<String, String> assumptions2 = new LinkedHashMap<>();
|
||||||
assumptions2.put("id", "((int -> int) -> (boolean -> boolean)) -> ((int2 -> boolean2) -> (boolean2 -> int2))");
|
assumptions2.put("id", "((int -> int) -> (boolean -> boolean)) -> ((int2 -> boolean2) -> (boolean2 -> int2))");
|
||||||
type = parser.parse(assumptions2);
|
type = parser.parse(assumptions2);
|
||||||
if (type.isError()) {
|
if (type.isError()) {
|
||||||
@ -178,7 +178,7 @@ class TypeAssumptionParserTest {
|
|||||||
@Test
|
@Test
|
||||||
void longFunction() {
|
void longFunction() {
|
||||||
TypeAssumptionParser parser = new TypeAssumptionParser();
|
TypeAssumptionParser parser = new TypeAssumptionParser();
|
||||||
HashMap<String, String> assumptions = new HashMap<>();
|
Map<String, String> assumptions = new LinkedHashMap<>();
|
||||||
assumptions.put("fun", "(a -> b -> c) -> d");
|
assumptions.put("fun", "(a -> b -> c) -> d");
|
||||||
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
||||||
assertTrue(type.isOk());
|
assertTrue(type.isOk());
|
||||||
|
@ -6,13 +6,14 @@ import edu.kit.typicalc.model.term.IntegerTerm;
|
|||||||
import edu.kit.typicalc.model.term.VarTerm;
|
import edu.kit.typicalc.model.term.VarTerm;
|
||||||
import edu.kit.typicalc.model.type.NamedType;
|
import edu.kit.typicalc.model.type.NamedType;
|
||||||
import edu.kit.typicalc.model.type.TypeAbstraction;
|
import edu.kit.typicalc.model.type.TypeAbstraction;
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||||
|
|
||||||
class AbsStepDefaultTest {
|
class AbsStepDefaultTest {
|
||||||
static InferenceStep premise = null;
|
static InferenceStep premise = null;
|
||||||
@ -22,7 +23,7 @@ class AbsStepDefaultTest {
|
|||||||
static TypeAbstraction typeAbstraction = null;
|
static TypeAbstraction typeAbstraction = null;
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void setUp() {
|
static void setUp() {
|
||||||
Map<VarTerm, TypeAbstraction> map = new HashMap<>();
|
Map<VarTerm, TypeAbstraction> map = new LinkedHashMap<>();
|
||||||
VarTerm term = new VarTerm("test");
|
VarTerm term = new VarTerm("test");
|
||||||
namedType = new NamedType("testType");
|
namedType = new NamedType("testType");
|
||||||
typeAbstraction = new TypeAbstraction(namedType);
|
typeAbstraction = new TypeAbstraction(namedType);
|
||||||
|
@ -9,10 +9,11 @@ import edu.kit.typicalc.model.type.TypeAbstraction;
|
|||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||||
|
|
||||||
class AbsStepWithLetTest {
|
class AbsStepWithLetTest {
|
||||||
static InferenceStep premise = null;
|
static InferenceStep premise = null;
|
||||||
@ -22,7 +23,7 @@ class AbsStepWithLetTest {
|
|||||||
static TypeAbstraction typeAbstraction = null;
|
static TypeAbstraction typeAbstraction = null;
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void setUp() {
|
static void setUp() {
|
||||||
Map<VarTerm, TypeAbstraction> map = new HashMap<>();
|
Map<VarTerm, TypeAbstraction> map = new LinkedHashMap<>();
|
||||||
VarTerm term = new VarTerm("test");
|
VarTerm term = new VarTerm("test");
|
||||||
namedType = new NamedType("testType");
|
namedType = new NamedType("testType");
|
||||||
typeAbstraction = new TypeAbstraction(namedType);
|
typeAbstraction = new TypeAbstraction(namedType);
|
||||||
|
@ -9,10 +9,11 @@ import edu.kit.typicalc.model.type.TypeAbstraction;
|
|||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||||
|
|
||||||
class AppStepDefaultTest {
|
class AppStepDefaultTest {
|
||||||
static InferenceStep premise1 = null;
|
static InferenceStep premise1 = null;
|
||||||
@ -23,7 +24,7 @@ class AppStepDefaultTest {
|
|||||||
static TypeAbstraction typeAbstraction = null;
|
static TypeAbstraction typeAbstraction = null;
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void setUp() {
|
static void setUp() {
|
||||||
Map<VarTerm, TypeAbstraction> map = new HashMap<>();
|
Map<VarTerm, TypeAbstraction> map = new LinkedHashMap<>();
|
||||||
VarTerm term = new VarTerm("test");
|
VarTerm term = new VarTerm("test");
|
||||||
namedType = new NamedType("testType");
|
namedType = new NamedType("testType");
|
||||||
typeAbstraction = new TypeAbstraction(namedType);
|
typeAbstraction = new TypeAbstraction(namedType);
|
||||||
|
@ -9,10 +9,11 @@ import edu.kit.typicalc.model.type.TypeAbstraction;
|
|||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||||
|
|
||||||
class ConstStepDefaultTest {
|
class ConstStepDefaultTest {
|
||||||
static Conclusion conclusion = null;
|
static Conclusion conclusion = null;
|
||||||
@ -21,7 +22,7 @@ class ConstStepDefaultTest {
|
|||||||
static TypeAbstraction typeAbstraction = null;
|
static TypeAbstraction typeAbstraction = null;
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void setUp() {
|
static void setUp() {
|
||||||
Map<VarTerm, TypeAbstraction> map = new HashMap<>();
|
Map<VarTerm, TypeAbstraction> map = new LinkedHashMap<>();
|
||||||
VarTerm term = new VarTerm("test");
|
VarTerm term = new VarTerm("test");
|
||||||
namedType = new NamedType("testType");
|
namedType = new NamedType("testType");
|
||||||
typeAbstraction = new TypeAbstraction(namedType);
|
typeAbstraction = new TypeAbstraction(namedType);
|
||||||
|
@ -9,10 +9,11 @@ import edu.kit.typicalc.model.type.TypeAbstraction;
|
|||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||||
|
|
||||||
class LetStepDefaultTest {
|
class LetStepDefaultTest {
|
||||||
static InferenceStep premise = null;
|
static InferenceStep premise = null;
|
||||||
@ -23,7 +24,7 @@ class LetStepDefaultTest {
|
|||||||
static TestTypeInfererLet typeInferer = null;
|
static TestTypeInfererLet typeInferer = null;
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void setUp() {
|
static void setUp() {
|
||||||
Map<VarTerm, TypeAbstraction> map = new HashMap<>();
|
Map<VarTerm, TypeAbstraction> map = new LinkedHashMap<>();
|
||||||
VarTerm term = new VarTerm("test");
|
VarTerm term = new VarTerm("test");
|
||||||
namedType = new NamedType("testType");
|
namedType = new NamedType("testType");
|
||||||
typeAbstraction = new TypeAbstraction(namedType);
|
typeAbstraction = new TypeAbstraction(namedType);
|
||||||
|
@ -6,14 +6,15 @@ import edu.kit.typicalc.model.term.IntegerTerm;
|
|||||||
import edu.kit.typicalc.model.term.VarTerm;
|
import edu.kit.typicalc.model.term.VarTerm;
|
||||||
import edu.kit.typicalc.model.type.NamedType;
|
import edu.kit.typicalc.model.type.NamedType;
|
||||||
import edu.kit.typicalc.model.type.TypeAbstraction;
|
import edu.kit.typicalc.model.type.TypeAbstraction;
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
class StepFactoryDefaultTest {
|
class StepFactoryDefaultTest {
|
||||||
|
|
||||||
static InferenceStep premise = null;
|
static InferenceStep premise = null;
|
||||||
@ -23,7 +24,7 @@ class StepFactoryDefaultTest {
|
|||||||
static TypeAbstraction typeAbstraction = null;
|
static TypeAbstraction typeAbstraction = null;
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void setUp() {
|
static void setUp() {
|
||||||
Map<VarTerm, TypeAbstraction> map = new HashMap<>();
|
Map<VarTerm, TypeAbstraction> map = new LinkedHashMap<>();
|
||||||
VarTerm term = new VarTerm("test");
|
VarTerm term = new VarTerm("test");
|
||||||
namedType = new NamedType("testType");
|
namedType = new NamedType("testType");
|
||||||
typeAbstraction = new TypeAbstraction(namedType);
|
typeAbstraction = new TypeAbstraction(namedType);
|
||||||
|
@ -6,14 +6,15 @@ import edu.kit.typicalc.model.term.IntegerTerm;
|
|||||||
import edu.kit.typicalc.model.term.VarTerm;
|
import edu.kit.typicalc.model.term.VarTerm;
|
||||||
import edu.kit.typicalc.model.type.NamedType;
|
import edu.kit.typicalc.model.type.NamedType;
|
||||||
import edu.kit.typicalc.model.type.TypeAbstraction;
|
import edu.kit.typicalc.model.type.TypeAbstraction;
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
class StepFactoryWithLetTest {
|
class StepFactoryWithLetTest {
|
||||||
|
|
||||||
static InferenceStep premise = null;
|
static InferenceStep premise = null;
|
||||||
@ -24,7 +25,7 @@ class StepFactoryWithLetTest {
|
|||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void setUp() {
|
static void setUp() {
|
||||||
Map<VarTerm, TypeAbstraction> map = new HashMap<>();
|
Map<VarTerm, TypeAbstraction> map = new LinkedHashMap<>();
|
||||||
VarTerm term = new VarTerm("test");
|
VarTerm term = new VarTerm("test");
|
||||||
namedType = new NamedType("testType");
|
namedType = new NamedType("testType");
|
||||||
typeAbstraction = new TypeAbstraction(namedType);
|
typeAbstraction = new TypeAbstraction(namedType);
|
||||||
|
@ -9,10 +9,11 @@ import edu.kit.typicalc.model.type.TypeAbstraction;
|
|||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||||
|
|
||||||
class VarStepDefaultTest {
|
class VarStepDefaultTest {
|
||||||
static InferenceStep premise = null;
|
static InferenceStep premise = null;
|
||||||
@ -22,7 +23,7 @@ class VarStepDefaultTest {
|
|||||||
static TypeAbstraction typeAbstraction = null;
|
static TypeAbstraction typeAbstraction = null;
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void setUp() {
|
static void setUp() {
|
||||||
Map<VarTerm, TypeAbstraction> map = new HashMap<>();
|
Map<VarTerm, TypeAbstraction> map = new LinkedHashMap<>();
|
||||||
VarTerm term = new VarTerm("test");
|
VarTerm term = new VarTerm("test");
|
||||||
namedType = new NamedType("testType");
|
namedType = new NamedType("testType");
|
||||||
typeAbstraction = new TypeAbstraction(namedType);
|
typeAbstraction = new TypeAbstraction(namedType);
|
||||||
|
@ -9,10 +9,11 @@ import edu.kit.typicalc.model.type.TypeAbstraction;
|
|||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||||
|
|
||||||
class VarStepWithLetTest {
|
class VarStepWithLetTest {
|
||||||
static InferenceStep premise = null;
|
static InferenceStep premise = null;
|
||||||
@ -22,7 +23,7 @@ class VarStepWithLetTest {
|
|||||||
static TypeAbstraction typeAbstraction = null;
|
static TypeAbstraction typeAbstraction = null;
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void setUp() {
|
static void setUp() {
|
||||||
Map<VarTerm, TypeAbstraction> map = new HashMap<>();
|
Map<VarTerm, TypeAbstraction> map = new LinkedHashMap<>();
|
||||||
VarTerm term = new VarTerm("test");
|
VarTerm term = new VarTerm("test");
|
||||||
namedType = new NamedType("testType");
|
namedType = new NamedType("testType");
|
||||||
typeAbstraction = new TypeAbstraction(namedType);
|
typeAbstraction = new TypeAbstraction(namedType);
|
||||||
|
Loading…
Reference in New Issue
Block a user