From 0b7aea21d927c6cc0294bbd7079ecc4b2f3dcc62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Tue, 8 May 2018 18:52:43 +0200 Subject: [PATCH 1/8] modified: ../../test/bytecode/LambdaTest.java modified: ../../test/bytecode/javFiles/Lambda2.jav --- test/bytecode/LambdaTest.java | 2 +- test/bytecode/javFiles/Lambda2.jav | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/bytecode/LambdaTest.java b/test/bytecode/LambdaTest.java index f29690cb..12e16829 100644 --- a/test/bytecode/LambdaTest.java +++ b/test/bytecode/LambdaTest.java @@ -13,7 +13,7 @@ public class LambdaTest { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Lambda.jav"; + path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Lambda2.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); compiler.generateBytecode(); diff --git a/test/bytecode/javFiles/Lambda2.jav b/test/bytecode/javFiles/Lambda2.jav index fbcdaf55..92f32b71 100644 --- a/test/bytecode/javFiles/Lambda2.jav +++ b/test/bytecode/javFiles/Lambda2.jav @@ -1,3 +1,4 @@ +import java.lang.String; public class Lambda2 { @@ -23,10 +24,12 @@ public static List map(List input, Function func) { } class List{ - A get(); + /* A get(); void add(A); + */ } - +/* class Function{ B apply(A a); -} \ No newline at end of file +} +*/ \ No newline at end of file From 9575afd0b4ae1a0c9fcae45ea1c9e2664e0faece Mon Sep 17 00:00:00 2001 From: Fayez Abu Alia Date: Tue, 15 May 2018 10:33:30 +0200 Subject: [PATCH 2/8] Fun umbenannt und Argumente umgedreht --- src/de/dhbwstuttgart/bytecode/BytecodeGen.java | 2 ++ src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java | 6 +++++- .../bytecode/descriptor/DescriptorToString.java | 10 +++++----- .../bytecode/descriptor/DescriptorVisitor.java | 10 +++++----- src/de/dhbwstuttgart/bytecode/signature/Signature.java | 8 +++++--- .../bytecode/{ => utilities}/KindOfLambda.java | 2 +- .../dhbwstuttgart/bytecode/{ => utilities}/Lambda.java | 2 +- .../bytecode/{ => utilities}/MethodFromMethodCall.java | 2 +- .../bytecode/{ => utilities}/NormalConstructor.java | 2 +- .../bytecode/{ => utilities}/NormalMethod.java | 2 +- .../bytecode/{ => utilities}/SamMethod.java | 2 +- src/de/dhbwstuttgart/core/JavaTXCompiler.java | 2 +- .../parser/SyntaxTreeGenerator/StatementGenerator.java | 2 +- 13 files changed, 30 insertions(+), 22 deletions(-) rename src/de/dhbwstuttgart/bytecode/{ => utilities}/KindOfLambda.java (98%) rename src/de/dhbwstuttgart/bytecode/{ => utilities}/Lambda.java (93%) rename src/de/dhbwstuttgart/bytecode/{ => utilities}/MethodFromMethodCall.java (96%) rename src/de/dhbwstuttgart/bytecode/{ => utilities}/NormalConstructor.java (95%) rename src/de/dhbwstuttgart/bytecode/{ => utilities}/NormalMethod.java (97%) rename src/de/dhbwstuttgart/bytecode/{ => utilities}/SamMethod.java (94%) diff --git a/src/de/dhbwstuttgart/bytecode/BytecodeGen.java b/src/de/dhbwstuttgart/bytecode/BytecodeGen.java index 52feb6e5..36c7173a 100644 --- a/src/de/dhbwstuttgart/bytecode/BytecodeGen.java +++ b/src/de/dhbwstuttgart/bytecode/BytecodeGen.java @@ -17,6 +17,8 @@ import de.dhbwstuttgart.bytecode.descriptor.DescriptorToString; import de.dhbwstuttgart.bytecode.descriptor.TypeToDescriptor; import de.dhbwstuttgart.bytecode.signature.Signature; import de.dhbwstuttgart.bytecode.signature.TypeToString; +import de.dhbwstuttgart.bytecode.utilities.NormalConstructor; +import de.dhbwstuttgart.bytecode.utilities.NormalMethod; import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal; import de.dhbwstuttgart.syntaxtree.*; import de.dhbwstuttgart.syntaxtree.statement.Literal; diff --git a/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java b/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java index ce5d3def..c00c152a 100644 --- a/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java +++ b/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java @@ -31,6 +31,10 @@ import de.dhbwstuttgart.bytecode.descriptor.TypeToDescriptor; import de.dhbwstuttgart.bytecode.signature.Signature; import de.dhbwstuttgart.bytecode.signature.TypeToSignature; import de.dhbwstuttgart.bytecode.signature.TypeToString; +import de.dhbwstuttgart.bytecode.utilities.KindOfLambda; +import de.dhbwstuttgart.bytecode.utilities.Lambda; +import de.dhbwstuttgart.bytecode.utilities.MethodFromMethodCall; +import de.dhbwstuttgart.bytecode.utilities.SamMethod; import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal; import de.dhbwstuttgart.syntaxtree.FormalParameter; import de.dhbwstuttgart.syntaxtree.Method; @@ -566,7 +570,7 @@ public class BytecodeGenMethod implements StatementVisitor { methSig.visitReturnType().visitTypeVariable("R"); // ")"+lam.getReturn.getBounds Signature sig = new Signature(lambdaExpression, numberOfParams); - String name = "Fun" + numberOfParams; + String name = "Fun" + numberOfParams + "$$"; classWriter.visit(Opcodes.V1_8, Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT, name, sig.toString(), Type.getInternalName(Object.class), null); MethodVisitor mvApply = classWriter.visitMethod(Opcodes.ACC_PUBLIC + Opcodes.ACC_ABSTRACT, "apply", methDesc, diff --git a/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java b/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java index 65f48f71..cba540f8 100644 --- a/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java +++ b/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java @@ -2,12 +2,12 @@ package de.dhbwstuttgart.bytecode.descriptor; import java.util.Iterator; -import de.dhbwstuttgart.bytecode.Lambda; -import de.dhbwstuttgart.bytecode.MethodFromMethodCall; -import de.dhbwstuttgart.bytecode.NormalConstructor; -import de.dhbwstuttgart.bytecode.NormalMethod; -import de.dhbwstuttgart.bytecode.SamMethod; import de.dhbwstuttgart.bytecode.signature.TypeToSignature; +import de.dhbwstuttgart.bytecode.utilities.Lambda; +import de.dhbwstuttgart.bytecode.utilities.MethodFromMethodCall; +import de.dhbwstuttgart.bytecode.utilities.NormalConstructor; +import de.dhbwstuttgart.bytecode.utilities.NormalMethod; +import de.dhbwstuttgart.bytecode.utilities.SamMethod; import de.dhbwstuttgart.syntaxtree.FormalParameter; import de.dhbwstuttgart.syntaxtree.statement.Expression; import de.dhbwstuttgart.syntaxtree.type.RefType; diff --git a/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorVisitor.java b/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorVisitor.java index 6bc57f21..35f1423e 100644 --- a/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorVisitor.java +++ b/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorVisitor.java @@ -1,10 +1,10 @@ package de.dhbwstuttgart.bytecode.descriptor; -import de.dhbwstuttgart.bytecode.Lambda; -import de.dhbwstuttgart.bytecode.MethodFromMethodCall; -import de.dhbwstuttgart.bytecode.NormalConstructor; -import de.dhbwstuttgart.bytecode.NormalMethod; -import de.dhbwstuttgart.bytecode.SamMethod; +import de.dhbwstuttgart.bytecode.utilities.Lambda; +import de.dhbwstuttgart.bytecode.utilities.MethodFromMethodCall; +import de.dhbwstuttgart.bytecode.utilities.NormalConstructor; +import de.dhbwstuttgart.bytecode.utilities.NormalMethod; +import de.dhbwstuttgart.bytecode.utilities.SamMethod; public interface DescriptorVisitor { public String visit(NormalMethod method); diff --git a/src/de/dhbwstuttgart/bytecode/signature/Signature.java b/src/de/dhbwstuttgart/bytecode/signature/Signature.java index 46202cb1..8c2cc1d3 100644 --- a/src/de/dhbwstuttgart/bytecode/signature/Signature.java +++ b/src/de/dhbwstuttgart/bytecode/signature/Signature.java @@ -59,9 +59,6 @@ public class Signature { private void createSignatureForFunN(LambdaExpression lambdaExpression, int numberOfParams) { - sw.visitFormalTypeParameter("R"); - // getBounds vom Return-Type - sw.visitClassBound().visitClassType(Type.getInternalName(Object.class)); sw.visitClassBound().visitEnd(); for(int i = 0;i> result = unify.unifySequential(xConsSet, finiteClosure, logFile); //Set> result = unify.unify(xConsSet, finiteClosure); diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java index aaa31f74..15f2268d 100644 --- a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java +++ b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java @@ -904,7 +904,7 @@ public class StatementGenerator { funNParams.add(TypePlaceholder.fresh(expression.getStart()))); RefTypeOrTPHOrWildcardOrGeneric lambdaType = TypePlaceholder.fresh(expression.getStart()); //RefType lambdaType = new RefType(reg.getName("Fun"+params.getFormalparalist().size()), - //funNParams, name.getStart()); + //funNParams, name.getStart()); return new LambdaExpression(lambdaType, params, block, expression.getStart()); } } From dcc36f082f62603b17285f05b43a0b790cff5383 Mon Sep 17 00:00:00 2001 From: Fayez Abu Alia Date: Wed, 16 May 2018 13:37:31 +0200 Subject: [PATCH 3/8] =?UTF-8?q?code=20aufr=C3=A4umen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/de/dhbwstuttgart/bytecode/AStatement.java | 30 +++++++++++ .../dhbwstuttgart/bytecode/ArgumentExpr.java | 11 ++++ src/de/dhbwstuttgart/bytecode/AssignStmt.java | 11 ++++ .../bytecode/BytecodeGenMethod.java | 52 +++++++------------ src/de/dhbwstuttgart/bytecode/IStatement.java | 9 ++++ src/de/dhbwstuttgart/bytecode/LoopStmt.java | 25 +++++++++ src/de/dhbwstuttgart/bytecode/ReturnStmt.java | 14 +++++ 7 files changed, 120 insertions(+), 32 deletions(-) create mode 100644 src/de/dhbwstuttgart/bytecode/AStatement.java create mode 100644 src/de/dhbwstuttgart/bytecode/ArgumentExpr.java create mode 100644 src/de/dhbwstuttgart/bytecode/AssignStmt.java create mode 100644 src/de/dhbwstuttgart/bytecode/IStatement.java create mode 100644 src/de/dhbwstuttgart/bytecode/LoopStmt.java create mode 100644 src/de/dhbwstuttgart/bytecode/ReturnStmt.java diff --git a/src/de/dhbwstuttgart/bytecode/AStatement.java b/src/de/dhbwstuttgart/bytecode/AStatement.java new file mode 100644 index 00000000..5c28bf43 --- /dev/null +++ b/src/de/dhbwstuttgart/bytecode/AStatement.java @@ -0,0 +1,30 @@ +package de.dhbwstuttgart.bytecode; + +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; + +import de.dhbwstuttgart.syntaxtree.statement.BinaryExpr; +import de.dhbwstuttgart.syntaxtree.statement.Expression; + +public abstract class AStatement implements IStatement { + protected Expression expr; + + public AStatement(Expression expr) { + this.expr = expr; + } + + @Override + public boolean isExprBinary() { + return (expr instanceof BinaryExpr); + } + + @Override + public void genBCForRelOp(MethodVisitor mv,Label branchLabel, Label endLabel, BytecodeGenMethod bytecodeGenMethod) { + mv.visitInsn(Opcodes.ICONST_1); + mv.visitJumpInsn(Opcodes.GOTO, endLabel); + mv.visitLabel(branchLabel); + mv.visitInsn(Opcodes.ICONST_0); + mv.visitLabel(endLabel); + } +} diff --git a/src/de/dhbwstuttgart/bytecode/ArgumentExpr.java b/src/de/dhbwstuttgart/bytecode/ArgumentExpr.java new file mode 100644 index 00000000..b396e8d1 --- /dev/null +++ b/src/de/dhbwstuttgart/bytecode/ArgumentExpr.java @@ -0,0 +1,11 @@ +package de.dhbwstuttgart.bytecode; + +import de.dhbwstuttgart.syntaxtree.statement.Expression; + +public class ArgumentExpr extends AStatement { + + public ArgumentExpr(Expression expr) { + super(expr); + } + +} diff --git a/src/de/dhbwstuttgart/bytecode/AssignStmt.java b/src/de/dhbwstuttgart/bytecode/AssignStmt.java new file mode 100644 index 00000000..366c450a --- /dev/null +++ b/src/de/dhbwstuttgart/bytecode/AssignStmt.java @@ -0,0 +1,11 @@ +package de.dhbwstuttgart.bytecode; + +import de.dhbwstuttgart.syntaxtree.statement.Expression; + +public class AssignStmt extends AStatement { + + public AssignStmt(Expression rightSide) { + super(rightSide); + } + +} diff --git a/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java b/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java index c00c152a..8b928a31 100644 --- a/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java +++ b/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java @@ -55,6 +55,8 @@ public class BytecodeGenMethod implements StatementVisitor { HashMap genericsAndBoundsMethod; private HashMap genericsAndBounds; private boolean isBinaryExp = false; + + private IStatement statement; // for tests ** private String fieldName; @@ -148,6 +150,7 @@ public class BytecodeGenMethod implements StatementVisitor { @Override public void visit(Assign assign) { + statement = new AssignStmt(assign.rightSide); isAssignStmt = true; // if the right side is a lambda => the left side must be a functional interface @@ -157,8 +160,7 @@ public class BytecodeGenMethod implements StatementVisitor { isRightSideALambda = false; } - if (assign.rightSide instanceof BinaryExpr) - isBinaryExp = true; + isBinaryExp = statement.isExprBinary(); if (assign.lefSide instanceof AssignToField) { @@ -198,7 +200,7 @@ public class BytecodeGenMethod implements StatementVisitor { Label endLabel = new Label(); // this case for while loops - if(!isAssignStmt) + if(statement instanceof LoopStmt) mv.visitLabel(endLabel); binary.lexpr.accept(this); @@ -341,18 +343,9 @@ public class BytecodeGenMethod implements StatementVisitor { default: break; } - if(isAssignStmt) { - mv.visitInsn(Opcodes.ICONST_1); - mv.visitJumpInsn(Opcodes.GOTO, endLabel); - mv.visitLabel(branchLabel); - mv.visitInsn(Opcodes.ICONST_0); - mv.visitLabel(endLabel); - } else { - loopBlock.accept(this); - mv.visitJumpInsn(Opcodes.GOTO, endLabel); - - mv.visitLabel(branchLabel); - } + + statement.genBCForRelOp(mv, branchLabel, endLabel,this); + break; } } @@ -375,18 +368,7 @@ public class BytecodeGenMethod implements StatementVisitor { default: break; } - if(isAssignStmt) { - mv.visitInsn(Opcodes.ICONST_1); - mv.visitJumpInsn(Opcodes.GOTO, endLabel); - mv.visitLabel(branchLabel); - mv.visitInsn(Opcodes.ICONST_0); - mv.visitLabel(endLabel); - } else { - loopBlock.accept(this); - mv.visitJumpInsn(Opcodes.GOTO, endLabel); - - mv.visitLabel(branchLabel); - } + statement.genBCForRelOp(mv, branchLabel, endLabel, this); } @@ -644,6 +626,7 @@ public class BytecodeGenMethod implements StatementVisitor { @Override public void visit(MethodCall methodCall) { + methodCall.receiver.accept(this); methodCall.arglist.accept(this); @@ -667,7 +650,7 @@ public class BytecodeGenMethod implements StatementVisitor { @Override public void visit(NewClass methodCall) { - + mv.visitTypeInsn(Opcodes.NEW, methodCall.name.replace(".", "/")); mv.visitInsn(Opcodes.DUP); // creates Descriptor @@ -776,8 +759,10 @@ public class BytecodeGenMethod implements StatementVisitor { @Override public void visit(Return aReturn) { - if(aReturn.retexpr instanceof BinaryExpr) - isBinaryExp = true; + + statement = new ReturnStmt(aReturn.retexpr); + + isBinaryExp = statement.isExprBinary(); aReturn.retexpr.accept(this); @@ -818,10 +803,12 @@ public class BytecodeGenMethod implements StatementVisitor { @Override public void visit(WhileStmt whileStmt) { + + statement = new LoopStmt(whileStmt.expr, whileStmt.loopBlock); this.loopBlock = whileStmt.loopBlock; - if(whileStmt.expr instanceof BinaryExpr) - isBinaryExp = true; + + isBinaryExp = statement.isExprBinary(); whileStmt.expr.accept(this); @@ -1030,6 +1017,7 @@ public class BytecodeGenMethod implements StatementVisitor { @Override public void visit(ArgumentList argumentList) { for (Expression al : argumentList.getArguments()) { + statement = new ArgumentExpr(al); al.accept(this); } } diff --git a/src/de/dhbwstuttgart/bytecode/IStatement.java b/src/de/dhbwstuttgart/bytecode/IStatement.java new file mode 100644 index 00000000..f8d61097 --- /dev/null +++ b/src/de/dhbwstuttgart/bytecode/IStatement.java @@ -0,0 +1,9 @@ +package de.dhbwstuttgart.bytecode; + +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; + +public interface IStatement { + public boolean isExprBinary(); + public void genBCForRelOp(MethodVisitor mv, Label branchLabel, Label endLabel, BytecodeGenMethod bytecodeGenMethod); +} diff --git a/src/de/dhbwstuttgart/bytecode/LoopStmt.java b/src/de/dhbwstuttgart/bytecode/LoopStmt.java new file mode 100644 index 00000000..109efd34 --- /dev/null +++ b/src/de/dhbwstuttgart/bytecode/LoopStmt.java @@ -0,0 +1,25 @@ +package de.dhbwstuttgart.bytecode; + +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; + +import de.dhbwstuttgart.syntaxtree.statement.Expression; +import de.dhbwstuttgart.syntaxtree.statement.Statement; + +public class LoopStmt extends AStatement { + + private Statement loopBlock; + + public LoopStmt(Expression expr, Statement loopBlock) { + super(expr); + this.loopBlock = loopBlock; + } + + @Override + public void genBCForRelOp(MethodVisitor mv,Label branchLabel, Label endLabel, BytecodeGenMethod bytecodeGenMethod) { + this.loopBlock.accept(bytecodeGenMethod); + mv.visitJumpInsn(Opcodes.GOTO, endLabel); + mv.visitLabel(branchLabel); + } +} diff --git a/src/de/dhbwstuttgart/bytecode/ReturnStmt.java b/src/de/dhbwstuttgart/bytecode/ReturnStmt.java new file mode 100644 index 00000000..bd747720 --- /dev/null +++ b/src/de/dhbwstuttgart/bytecode/ReturnStmt.java @@ -0,0 +1,14 @@ +package de.dhbwstuttgart.bytecode; + +import org.objectweb.asm.MethodVisitor; + +import de.dhbwstuttgart.syntaxtree.statement.BinaryExpr; +import de.dhbwstuttgart.syntaxtree.statement.Expression; + +public class ReturnStmt extends AStatement { + + public ReturnStmt(Expression retexpr) { + super(retexpr); + } + +} From 0f29bc038a8b1dc514ea9fbeed00258a7f21e3f5 Mon Sep 17 00:00:00 2001 From: Fayez Abu Alia Date: Wed, 23 May 2018 15:38:41 +0200 Subject: [PATCH 4/8] =?UTF-8?q?Bugs=20gefixt.=20Tests=20f=C3=BCr=20relatio?= =?UTF-8?q?nalen=20Operatoren(GreaterEqualTest,=20...)=20laufen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Für Typplaceholder werden Generics verwendet. Neue Tests angefügt. --- .../dhbwstuttgart/bytecode/BytecodeGen.java | 7 +- .../bytecode/BytecodeGenMethod.java | 220 +++++++++--------- .../descriptor/DescriptorToString.java | 17 +- .../bytecode/descriptor/TypeToDescriptor.java | 5 +- .../bytecode/signature/Signature.java | 51 +++- .../bytecode/signature/TypeToSignature.java | 2 + test/bytecode/BinaryTest.java | 40 ++++ test/bytecode/FacTest.java | 44 ++++ test/bytecode/PlusTest.java | 2 +- test/bytecode/RelOpsTest.java | 44 ++++ test/bytecode/javFiles/BinaryInMeth.jav | 11 + test/bytecode/javFiles/Fac.jav | 16 ++ test/bytecode/javFiles/Gen.jav | 2 +- test/bytecode/javFiles/Matrix.jav | 26 +-- test/bytecode/javFiles/Op.jav | 2 +- test/bytecode/javFiles/Plus.jav | 2 +- test/bytecode/javFiles/RelOps.jav | 7 + test/bytecode/javFiles/While.jav | 4 + test/logFiles/log | 107 +++++++++ 19 files changed, 467 insertions(+), 142 deletions(-) create mode 100644 test/bytecode/BinaryTest.java create mode 100644 test/bytecode/FacTest.java create mode 100644 test/bytecode/RelOpsTest.java create mode 100644 test/bytecode/javFiles/BinaryInMeth.jav create mode 100644 test/bytecode/javFiles/Fac.jav create mode 100644 test/bytecode/javFiles/RelOps.jav create mode 100644 test/logFiles/log diff --git a/src/de/dhbwstuttgart/bytecode/BytecodeGen.java b/src/de/dhbwstuttgart/bytecode/BytecodeGen.java index 36c7173a..f9bf72ed 100644 --- a/src/de/dhbwstuttgart/bytecode/BytecodeGen.java +++ b/src/de/dhbwstuttgart/bytecode/BytecodeGen.java @@ -117,7 +117,7 @@ public class BytecodeGen implements ASTVisitor { boolean isConsWithNoParamsVisited = false; for(ResultSet rs : listOfResultSets) { resultSet = rs; - + for(Constructor c : classOrInterface.getConstructors()) { if(!isConsWithNoParamsVisited) c.accept(this); @@ -191,13 +191,13 @@ public class BytecodeGen implements ASTVisitor { System.out.println(acc); /*Prüfe, ob die Rückgabe-Type der Methode eine Type-Variable ist*/ - boolean hasGenInParameterList = genericsAndBounds.containsKey(resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor())); + boolean hasGenInParameterList = genericsAndBounds.containsKey(retType) || retType.subSequence(0, 4).equals("TPH "); /*Wenn die Rückgabe-Type eine Typ-variable ist, erzeuge direkt die Signature, wenn nicht, * prüfe, ob einer der Parameter Typ-Variable als Typ hat*/ if(!hasGenInParameterList) { for(String paramName : methodParamsAndTypes.keySet()) { String typeOfParam = methodParamsAndTypes.get(paramName).acceptTV(new TypeToDescriptor()); - if(genericsAndBounds.containsKey(typeOfParam)) { + if(genericsAndBounds.containsKey(typeOfParam)||typeOfParam.substring(0, 4).equals("TPH ")) { hasGenInParameterList = true; break; } @@ -213,6 +213,7 @@ public class BytecodeGen implements ASTVisitor { boolean hasGen = method.getGenerics().iterator().hasNext() || hasGenInParameterList; /* if method has generics or return type is TPH, create signature */ + // zwite operand muss weggelassen werden if(hasGen||method.getReturnType().acceptTV(new TypeToString()).equals("TPH")) { // resultset hier zum testen Signature signature = new Signature(method, genericsAndBoundsMethod, methodParamsAndTypes,resultSet); diff --git a/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java b/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java index 8b928a31..8bb7dca1 100644 --- a/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java +++ b/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java @@ -29,8 +29,6 @@ import org.objectweb.asm.signature.SignatureWriter; import de.dhbwstuttgart.bytecode.descriptor.DescriptorToString; import de.dhbwstuttgart.bytecode.descriptor.TypeToDescriptor; import de.dhbwstuttgart.bytecode.signature.Signature; -import de.dhbwstuttgart.bytecode.signature.TypeToSignature; -import de.dhbwstuttgart.bytecode.signature.TypeToString; import de.dhbwstuttgart.bytecode.utilities.KindOfLambda; import de.dhbwstuttgart.bytecode.utilities.Lambda; import de.dhbwstuttgart.bytecode.utilities.MethodFromMethodCall; @@ -55,20 +53,17 @@ public class BytecodeGenMethod implements StatementVisitor { HashMap genericsAndBoundsMethod; private HashMap genericsAndBounds; private boolean isBinaryExp = false; - - private IStatement statement; + + private IStatement statement = null; // for tests ** private String fieldName; private String fieldDesc; private Expression rightSideTemp; - + private boolean isRightSideALambda = false; private KindOfLambda kindOfLambda; private HashMap classFiles; - - private boolean isAssignStmt = false; - private Statement loopBlock; private ArrayList varsFunInterface = new ArrayList<>();; @@ -113,7 +108,7 @@ public class BytecodeGenMethod implements StatementVisitor { private String getResolvedType(RefTypeOrTPHOrWildcardOrGeneric type) { return resultSet.resolveType(type).resolvedType.acceptTV(new TypeToDescriptor()); } - + @Override public void visit(Block block) { for (Statement stmt : block.getStatements()) { @@ -138,7 +133,7 @@ public class BytecodeGenMethod implements StatementVisitor { mv.visitVarInsn(Opcodes.ALOAD, paramsAndLocals.get(localVar.name)); if (isBinaryExp) { - getVlaueIns(getResolvedType(localVar.getType())); + doUnboxing(getResolvedType(localVar.getType())); } } @@ -151,8 +146,6 @@ public class BytecodeGenMethod implements StatementVisitor { @Override public void visit(Assign assign) { statement = new AssignStmt(assign.rightSide); - isAssignStmt = true; - // if the right side is a lambda => the left side must be a functional interface if (assign.rightSide instanceof LambdaExpression) { isRightSideALambda = true; @@ -161,7 +154,6 @@ public class BytecodeGenMethod implements StatementVisitor { } isBinaryExp = statement.isExprBinary(); - if (assign.lefSide instanceof AssignToField) { // load_0, ldc or .. then putfield @@ -171,26 +163,24 @@ public class BytecodeGenMethod implements StatementVisitor { } if (isBinaryExp) { BinaryExpr binary = (BinaryExpr) assign.rightSide; - String lexpType = getResolvedType(binary.lexpr.getType()); - String rexpType = getResolvedType(binary.rexpr.getType()); - getValueOfIns(getLargerType(lexpType, rexpType)); + String binaryType = getResolvedType(binary.getType()); + doBoxing(binaryType); isBinaryExp = false; } assign.lefSide.accept(this); - - isAssignStmt =false; - } + statement = null; + } @Override public void visit(BinaryExpr binary) { - + String lexpType = getResolvedType(binary.lexpr.getType()); String rexpType = getResolvedType(binary.rexpr.getType()); - - String largerType = getLargerType(lexpType,rexpType); + + String largerType = getLargerType(lexpType, rexpType); String typeOfBinary = getResolvedType(binary.getType()); - + if (typeOfBinary.equals(Type.getInternalName(String.class))) { mv.visitTypeInsn(Opcodes.NEW, Type.getInternalName(StringBuilder.class)); mv.visitInsn(Opcodes.DUP); @@ -200,23 +190,21 @@ public class BytecodeGenMethod implements StatementVisitor { Label endLabel = new Label(); // this case for while loops - if(statement instanceof LoopStmt) + if (statement instanceof LoopStmt) mv.visitLabel(endLabel); - + binary.lexpr.accept(this); - - if(!lexpType.equals(rexpType) && - !lexpType.equals(largerType)) + + if (!lexpType.equals(rexpType) && !lexpType.equals(largerType)) doCast(lexpType, largerType); - + binary.rexpr.accept(this); - - if(!lexpType.equals(rexpType) && - !rexpType.equals(largerType)) + + if (!lexpType.equals(rexpType) && !rexpType.equals(largerType)) doCast(rexpType, largerType); - + Operator op = binary.operation; - + switch (op) { case ADD: doVisitAddOpInsn(largerType); @@ -243,28 +231,31 @@ public class BytecodeGenMethod implements StatementVisitor { case BIGGERTHAN: case BIGGEREQUAL: Label branchLabel = new Label(); - doVisitRelOpInsn(op,largerType, branchLabel, endLabel); + doVisitRelOpInsn(op, largerType, branchLabel, endLabel); break; - + default: break; } } + /* + * Diese Methode wird nicht mehr gebraucht, da es jetzt nicht möglich ist, dass + * solche Fälle: Integer -> Integer (OP) Short ,... usw, nicht vorkommen! + */ private String getLargerType(String lexpType, String rexpType) { - if(lexpType.equals(Type.getInternalName(String.class)) || - rexpType.equals(Type.getInternalName(String.class))) { + if (lexpType.equals(Type.getInternalName(String.class)) + || rexpType.equals(Type.getInternalName(String.class))) { return Type.getInternalName(String.class); - } else - if(lexpType.equals(Type.getInternalName(Double.class)) || - rexpType.equals(Type.getInternalName(Double.class))) { + } else if (lexpType.equals(Type.getInternalName(Double.class)) + || rexpType.equals(Type.getInternalName(Double.class))) { return Type.getInternalName(Double.class); - } else if(lexpType.equals(Type.getInternalName(Float.class)) || - rexpType.equals(Type.getInternalName(Float.class))) { + } else if (lexpType.equals(Type.getInternalName(Float.class)) + || rexpType.equals(Type.getInternalName(Float.class))) { return Type.getInternalName(Float.class); - } else if(lexpType.equals(Type.getInternalName(Long.class)) || - rexpType.equals(Type.getInternalName(Long.class))) { + } else if (lexpType.equals(Type.getInternalName(Long.class)) + || rexpType.equals(Type.getInternalName(Long.class))) { return Type.getInternalName(Long.class); } else { return Type.getInternalName(Integer.class); @@ -276,19 +267,19 @@ public class BytecodeGenMethod implements StatementVisitor { case "java/lang/Long": mv.visitInsn(Opcodes.I2L); break; - + case "java/lang/Double": - if(sourceType.equals(Type.getInternalName(Long.class))) { + if (sourceType.equals(Type.getInternalName(Long.class))) { mv.visitInsn(Opcodes.L2D); - } else if(sourceType.equals(Type.getInternalName(Float.class))) { + } else if (sourceType.equals(Type.getInternalName(Float.class))) { mv.visitInsn(Opcodes.F2D); } else { mv.visitInsn(Opcodes.I2D); } break; - + case "java/lang/Float": - if(sourceType.equals(Type.getInternalName(Long.class))) { + if (sourceType.equals(Type.getInternalName(Long.class))) { mv.visitInsn(Opcodes.L2F); } else { mv.visitInsn(Opcodes.I2F); @@ -296,14 +287,18 @@ public class BytecodeGenMethod implements StatementVisitor { break; // braucht man eigentlic nicht, muss getestet werden case "java/lang/String": - if(sourceType.equals(Type.getInternalName(Double.class))) { - mv.visitMethodInsn(Opcodes.INVOKESTATIC, Type.getInternalName(String.class), "valueOf", "(D)Ljava/lang/String;", false); - } else if(sourceType.equals(Type.getInternalName(Long.class))) { - mv.visitMethodInsn(Opcodes.INVOKESTATIC, Type.getInternalName(String.class), "valueOf", "(J)Ljava/lang/String;", false); - } else if(sourceType.equals(Type.getInternalName(Float.class))) { - mv.visitMethodInsn(Opcodes.INVOKESTATIC, Type.getInternalName(String.class), "valueOf", "(F)Ljava/lang/String;", false); + if (sourceType.equals(Type.getInternalName(Double.class))) { + mv.visitMethodInsn(Opcodes.INVOKESTATIC, Type.getInternalName(String.class), "valueOf", + "(D)Ljava/lang/String;", false); + } else if (sourceType.equals(Type.getInternalName(Long.class))) { + mv.visitMethodInsn(Opcodes.INVOKESTATIC, Type.getInternalName(String.class), "valueOf", + "(J)Ljava/lang/String;", false); + } else if (sourceType.equals(Type.getInternalName(Float.class))) { + mv.visitMethodInsn(Opcodes.INVOKESTATIC, Type.getInternalName(String.class), "valueOf", + "(F)Ljava/lang/String;", false); } else { - mv.visitMethodInsn(Opcodes.INVOKESTATIC, Type.getInternalName(String.class), "valueOf", "(I)Ljava/lang/String;", false); + mv.visitMethodInsn(Opcodes.INVOKESTATIC, Type.getInternalName(String.class), "valueOf", + "(I)Ljava/lang/String;", false); } break; default: @@ -312,7 +307,7 @@ public class BytecodeGenMethod implements StatementVisitor { } private void doVisitRelOpInsn(Operator op, String typeOfBinary, Label branchLabel, Label endLabel) { - + switch (typeOfBinary) { case "java/lang/Long": mv.visitInsn(Opcodes.LCMP); @@ -343,9 +338,9 @@ public class BytecodeGenMethod implements StatementVisitor { default: break; } - - statement.genBCForRelOp(mv, branchLabel, endLabel,this); - + + statement.genBCForRelOp(mv, branchLabel, endLabel, this); + break; } } @@ -368,8 +363,8 @@ public class BytecodeGenMethod implements StatementVisitor { default: break; } + statement.genBCForRelOp(mv, branchLabel, endLabel, this); - } private void doVisitModOpInsn(String typeOfBinary) { @@ -532,7 +527,7 @@ public class BytecodeGenMethod implements StatementVisitor { cw.visitInnerClass("java/lang/invoke/MethodHandles$Lookup", "java/lang/invoke/MethodHandles", "Lookup", Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC + Opcodes.ACC_FINAL); - generateBCForFunN(lambdaExpression,typeErasure); + generateBCForFunN(lambdaExpression, typeErasure); } private void generateBCForFunN(LambdaExpression lambdaExpression, String methDesc) { @@ -626,7 +621,7 @@ public class BytecodeGenMethod implements StatementVisitor { @Override public void visit(MethodCall methodCall) { - + methodCall.receiver.accept(this); methodCall.arglist.accept(this); @@ -634,7 +629,7 @@ public class BytecodeGenMethod implements StatementVisitor { genericsAndBoundsMethod, genericsAndBounds); String mDesc = method.accept(new DescriptorToString(resultSet)); - // is methodCall.receiver functional Interface)? + // is methodCall.receiver functional Interface)? if (varsFunInterface.contains(methodCall.receiver.getType())) { mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, getResolvedType(methodCall.receiver.getType()), methodCall.name, mDesc, false); @@ -650,7 +645,7 @@ public class BytecodeGenMethod implements StatementVisitor { @Override public void visit(NewClass methodCall) { - + mv.visitTypeInsn(Opcodes.NEW, methodCall.name.replace(".", "/")); mv.visitInsn(Opcodes.DUP); // creates Descriptor @@ -679,40 +674,40 @@ public class BytecodeGenMethod implements StatementVisitor { public void visit(UnaryExpr unaryExpr) { unaryExpr.expr.accept(this); Operation op = unaryExpr.operation; - + String typeOfUnary = getResolvedType(unaryExpr.getType()); - + boolean isIncOrDec = false; - + switch (op) { case POSTDECREMENT: case POSTINCREMENT: - if(isAssignStmt) + if (statement instanceof AssignStmt) mv.visitInsn(Opcodes.DUP); genBCForIncAndDec(op, typeOfUnary); - getValueOfIns(typeOfUnary); + doBoxing(typeOfUnary); isIncOrDec = true; break; case PREDECREMENT: case PREINCREMENT: genBCForIncAndDec(op, typeOfUnary); - getValueOfIns(typeOfUnary); - if(isAssignStmt) + doBoxing(typeOfUnary); + if (statement instanceof AssignStmt) mv.visitInsn(Opcodes.DUP); isIncOrDec = true; break; - + case MINUS: doVisitNegIns(typeOfUnary); break; default: break; } - + // Für Byte und Short muss noch einen Cast geben i2b, i2s // das wird später gemacht, da bytecode für cast noch nicht erzeugt wird - - if(isIncOrDec && (unaryExpr.expr instanceof LocalVar)) { + + if (isIncOrDec && (unaryExpr.expr instanceof LocalVar)) { LocalVar local = (LocalVar) unaryExpr.expr; mv.visitVarInsn(Opcodes.ASTORE, paramsAndLocals.get(local.name)); } @@ -733,14 +728,14 @@ public class BytecodeGenMethod implements StatementVisitor { mv.visitInsn(Opcodes.INEG); break; } - + } private void genBCForIncAndDec(Operation op, String typeOfUnary) { - - getVlaueIns(typeOfUnary); - doAssign(typeOfUnary, 1.0, true); - + + doUnboxing(typeOfUnary); + loadValue(typeOfUnary, 1.0, true); + switch (op) { case POSTDECREMENT: case PREDECREMENT: @@ -751,7 +746,7 @@ public class BytecodeGenMethod implements StatementVisitor { case PREINCREMENT: doVisitAddOpInsn(typeOfUnary); break; - + default: break; } @@ -759,22 +754,19 @@ public class BytecodeGenMethod implements StatementVisitor { @Override public void visit(Return aReturn) { - statement = new ReturnStmt(aReturn.retexpr); - isBinaryExp = statement.isExprBinary(); - + aReturn.retexpr.accept(this); - + if (isBinaryExp) { BinaryExpr binary = (BinaryExpr) aReturn.retexpr; - String lexpType = getResolvedType(binary.lexpr.getType()); - String rexpType = getResolvedType(binary.rexpr.getType()); - getValueOfIns(getLargerType(lexpType, rexpType)); + doBoxing(getResolvedType(binary.getType())); isBinaryExp = false; } - + mv.visitInsn(Opcodes.ARETURN); + statement = null; } @Override @@ -787,7 +779,8 @@ public class BytecodeGenMethod implements StatementVisitor { // mv.visitMethodInsn(Opcodes.INVOKESTATIC, // staticClassName.getType().toString().replace(".", "/"), // staticClassName.toString(), staticClassName.getType().toString(), false); - //mv.visitFieldInsn(Opcodes.GETSTATIC, getResolvedType(staticClassName.getType()), fieldName, fieldDesc); + // mv.visitFieldInsn(Opcodes.GETSTATIC, + // getResolvedType(staticClassName.getType()), fieldName, fieldDesc); throw new NotImplementedException("Static noch nicht implementiert!"); } @@ -803,16 +796,11 @@ public class BytecodeGenMethod implements StatementVisitor { @Override public void visit(WhileStmt whileStmt) { - statement = new LoopStmt(whileStmt.expr, whileStmt.loopBlock); - this.loopBlock = whileStmt.loopBlock; - - isBinaryExp = statement.isExprBinary(); - whileStmt.expr.accept(this); - isBinaryExp = false; + statement = null; } @Override @@ -825,12 +813,13 @@ public class BytecodeGenMethod implements StatementVisitor { public void visit(Literal literal) { Object value = literal.value; String typeOfLiteral = getResolvedType(literal.getType()); - // Name der Methode muss geändert werden - doAssign(typeOfLiteral, value, false); - + // Der Wert des Literals wird auf den Stack geladen und + // geboxt, wenn es nötig ist. + loadValue(typeOfLiteral, value, false); } - private void getVlaueIns(String type) { + // Unboxing: RefType -> prim + private void doUnboxing(String type) { switch (type) { case "java/lang/String": mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, Type.getInternalName(StringBuilder.class), "append", @@ -860,11 +849,13 @@ public class BytecodeGenMethod implements StatementVisitor { case "java/lang/Character": break; default: + // mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/Integer", "intValue", + // "()I", false); break; } } - private void doAssign(String type, Object value, boolean isOperator) { + private void loadValue(String type, Object value, boolean isOperator) { switch (type) { case "java/lang/String": mv.visitLdcInsn(String.valueOf(value)); @@ -895,17 +886,21 @@ public class BytecodeGenMethod implements StatementVisitor { visitCharLiteral((Character) value); break; default: + // wenn die Typ des Literals = Number ist, wird integer-value + // verwendet + // visitIntegerLiteral(((Double) value).intValue(), false); break; } - - if(!type.equals("java/lang/String")&&!type.equals("java/lang/Boolean")) { + // Boxing + if (!type.equals("java/lang/String") && !type.equals("java/lang/Boolean")) { if (!this.isBinaryExp && !isOperator) - getValueOfIns(type); + doBoxing(type); } - + } - private void getValueOfIns(String type) { + // Boxing: prim -> RefType + private void doBoxing(String type) { switch (type) { case "java/lang/String": mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/StringBuilder", "toString", "()Ljava/lang/String;", @@ -943,7 +938,7 @@ public class BytecodeGenMethod implements StatementVisitor { private void visitCharLiteral(Character value) { mv.visitIntInsn(Opcodes.BIPUSH, (int) value); - + } private void visitDoubleLiteral(Double value) { @@ -1019,6 +1014,7 @@ public class BytecodeGenMethod implements StatementVisitor { for (Expression al : argumentList.getArguments()) { statement = new ArgumentExpr(al); al.accept(this); + statement = null; } } @@ -1042,12 +1038,12 @@ public class BytecodeGenMethod implements StatementVisitor { varsFunInterface.add(assignLeftSide.localVar.getType()); int index = paramsAndLocals.size(); String var = assignLeftSide.localVar.name; - if(!paramsAndLocals.containsKey(var)) { + if (!paramsAndLocals.containsKey(var)) { paramsAndLocals.put(var, index + 1); - }else { + } else { paramsAndLocals.put(var, index); } - + mv.visitVarInsn(Opcodes.ASTORE, paramsAndLocals.size()); // Debug::: diff --git a/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java b/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java index cba540f8..0e97ca4c 100644 --- a/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java +++ b/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java @@ -46,12 +46,18 @@ public class DescriptorToString implements DescriptorVisitor{ }else if(method.getGenericsAndBounds().containsKey(fpDesc)){ desc += "L"+method.getGenericsAndBounds().get(fpDesc)+ ";"; }else { - desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";"; +// desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";"; + String resType = resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor()); + if(resType.subSequence(0, 4).equals("TPH ")) { + desc += "L"+method.getGenericsAndBoundsMethod().get(resType.substring(4)+"$")+ ";"; + } else { + desc += "L"+resType+ ";"; + } } } //TODO: generate a class java%% ... %% else if(resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor()).contains("<")){ - desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.toString().replace(".", "%").replace("<", "%%").replace(">", "%%")+ ";"; + desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.toString().replace(".", "$$").replace("<", "$$$").replace(">", "$$$")+ ";"; } else { desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";"; @@ -68,7 +74,12 @@ public class DescriptorToString implements DescriptorVisitor{ }else if(method.getGenericsAndBounds().containsKey(ret)){ desc += ")L"+method.getGenericsAndBounds().get(ret)+ ";"; }else { - desc += ")" + "L"+resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";"; + String resType = resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor()); + if(resType.subSequence(0, 4).equals("TPH ")) { + desc += ")" + "L"+method.getGenericsAndBoundsMethod().get(resType.substring(4)+"$")+ ";"; + } else { + desc += ")" + "L"+resType+ ";"; + } } }else { desc += ")" + "L"+resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";"; diff --git a/src/de/dhbwstuttgart/bytecode/descriptor/TypeToDescriptor.java b/src/de/dhbwstuttgart/bytecode/descriptor/TypeToDescriptor.java index e374bb93..e5c853b3 100644 --- a/src/de/dhbwstuttgart/bytecode/descriptor/TypeToDescriptor.java +++ b/src/de/dhbwstuttgart/bytecode/descriptor/TypeToDescriptor.java @@ -13,6 +13,8 @@ public class TypeToDescriptor implements TypeVisitor{ @Override public String visit(RefType refType) { return refType.getName().toString().replace(".", "/"); +// String t = refType.getName().toString().replace(".", "/"); +// return t.equals("Fun1")?(t+"$$"):t; } @Override @@ -27,7 +29,8 @@ public class TypeToDescriptor implements TypeVisitor{ @Override public String visit(ExtendsWildcardType extendsWildcardType) { - throw new NotImplementedException(); + return extendsWildcardType.getInnerType().toString(); + //throw new NotImplementedException(); } @Override diff --git a/src/de/dhbwstuttgart/bytecode/signature/Signature.java b/src/de/dhbwstuttgart/bytecode/signature/Signature.java index 8c2cc1d3..48804661 100644 --- a/src/de/dhbwstuttgart/bytecode/signature/Signature.java +++ b/src/de/dhbwstuttgart/bytecode/signature/Signature.java @@ -59,7 +59,7 @@ public class Signature { private void createSignatureForFunN(LambdaExpression lambdaExpression, int numberOfParams) { - sw.visitClassBound().visitEnd(); +// sw.visitClassBound().visitEnd(); for(int i = 0;i wird eine Formal Type Parameter K$ erzeugt und Bound = Object + String ret = resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToSignature()); + if(ret.substring(0,4).equals("TPH ")) { + String g = ret.substring(4)+"$"; + sw.visitFormalTypeParameter(g); + sw.visitClassBound().visitClassType(Type.getInternalName(Object.class)); + genericsAndBoundsMethod.put(g, Type.getInternalName(Object.class)); + sw.visitClassBound().visitEnd(); + } + + for(String paramName : methodParamsAndTypes.keySet()) { + RefTypeOrTPHOrWildcardOrGeneric t = methodParamsAndTypes.get(paramName); + String pT = t.acceptTV(new TypeToSignature()); + // S.o + if(pT.substring(0,4).equals("TPH ") && !genericsAndBoundsMethod.containsKey(pT)) { + String gP = pT.substring(4)+"$"; + sw.visitFormalTypeParameter(gP); + sw.visitClassBound().visitClassType(Type.getInternalName(Object.class)); + genericsAndBoundsMethod.put(gP, Type.getInternalName(Object.class)); + sw.visitClassBound().visitEnd(); + } + } + + // visit each method-parameter to create the signature for(String paramName : methodParamsAndTypes.keySet()) { RefTypeOrTPHOrWildcardOrGeneric t = methodParamsAndTypes.get(paramName); // parameter type deswegen ist true @@ -101,6 +125,15 @@ public class Signature { if(isConstructor) { sw.visitReturnType().visitBaseType('V'); }else { +// String ret = resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToSignature()); +// if(ret.substring(0,4).equals("TPH ")) { +// String g = ret.substring(4); +// if(!genericsAndBoundsMethod.containsKey(g)) { +// genericsAndBoundsMethod.put(g, Type.getInternalName(Object.class)); +// } else { +// genericsAndBoundsMethod.put(g+"_", Type.getInternalName(Object.class)); +// } +// } RefTypeOrTPHOrWildcardOrGeneric returnType = method.getReturnType(); // return type deswegen ist false doVisitParamsOrReturn(returnType, false); @@ -132,10 +165,16 @@ public class Signature { break; case "TPH": RefTypeOrTPHOrWildcardOrGeneric r = resultSet.resolveType(t).resolvedType; - if(!r.acceptTV(new TypeToSignature()).substring(0, 4).equals("TPH ")) - sv.visitInterface().visitClassType(r.acceptTV(new TypeToSignature())); -// sv.visitClassType(r.acceptTV(new TypeToSignature())); - System.out.println(r.getClass()+" Signature TPH: "+r.acceptTV(new TypeToSignature())); + // der Fall wenn die Type eine Interface ist, muss betrachtet werden + // Deswegen muss in ResutSet noch enthalten werden, ob die Type eine + // Interface oder eine Klasse ist. + if(!r.acceptTV(new TypeToSignature()).substring(0, 4).equals("TPH ")) { +// sv.visitInterface().visitClassType(r.acceptTV(new TypeToSignature())); + sv.visitClassType(r.acceptTV(new TypeToSignature())); + } else { + System.out.println(r.getClass()+" Signature TPH: "+r.acceptTV(new TypeToSignature())); + sv.visitTypeVariable(r.acceptTV(new TypeToSignature()).substring(4)+"$"); + } break; default: if(!isParameterType) diff --git a/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java b/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java index 78b2fb22..a1357d4c 100644 --- a/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java +++ b/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java @@ -27,6 +27,8 @@ public class TypeToSignature implements TypeVisitor { } params += ";>"; } +// String t = refType.getName().toString().replace(".", "/"); +// return t.equals("Fun1")?t+"$$"+params+";":t+params+";"; return refType.getName().toString().replace(".", "/") + params+";"; } diff --git a/test/bytecode/BinaryTest.java b/test/bytecode/BinaryTest.java new file mode 100644 index 00000000..7f2f5fa4 --- /dev/null +++ b/test/bytecode/BinaryTest.java @@ -0,0 +1,40 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class BinaryTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/test/bytecode/javFiles/BinaryInMeth.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + compiler.generateBytecode(); + pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("BinaryInMeth"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void test() { + fail("Not yet implemented"); + } + +} diff --git a/test/bytecode/FacTest.java b/test/bytecode/FacTest.java new file mode 100644 index 00000000..b2840026 --- /dev/null +++ b/test/bytecode/FacTest.java @@ -0,0 +1,44 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class FacTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Fac.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + compiler.generateBytecode(); + pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("Fac"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method getFac = classToTest.getDeclaredMethod("getFac", Integer.class,Integer.class); + Integer result = (Integer) getFac.invoke(instanceOfClass,3); + assertEquals(result, 6); + } + +} diff --git a/test/bytecode/PlusTest.java b/test/bytecode/PlusTest.java index 016cb706..51503c58 100644 --- a/test/bytecode/PlusTest.java +++ b/test/bytecode/PlusTest.java @@ -29,7 +29,7 @@ public class PlusTest { compiler = new JavaTXCompiler(fileToTest); compiler.generateBytecode(); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/examples/"; + pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("Plus"); instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); diff --git a/test/bytecode/RelOpsTest.java b/test/bytecode/RelOpsTest.java new file mode 100644 index 00000000..06b24630 --- /dev/null +++ b/test/bytecode/RelOpsTest.java @@ -0,0 +1,44 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class RelOpsTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/test/bytecode/javFiles/RelOps.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + compiler.generateBytecode(); + pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("RelOps"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("m", Integer.class,Integer.class); + Boolean result = (Boolean) m.invoke(instanceOfClass, 7,3); + assertFalse(result); + } + +} diff --git a/test/bytecode/javFiles/BinaryInMeth.jav b/test/bytecode/javFiles/BinaryInMeth.jav new file mode 100644 index 00000000..f5a11798 --- /dev/null +++ b/test/bytecode/javFiles/BinaryInMeth.jav @@ -0,0 +1,11 @@ +import java.lang.Integer; +public class BinaryInMeth { + + m(a){ + return ++a; + } + + m2(a,b){ + return m(a+b); + } +} \ No newline at end of file diff --git a/test/bytecode/javFiles/Fac.jav b/test/bytecode/javFiles/Fac.jav new file mode 100644 index 00000000..d3d1a8d9 --- /dev/null +++ b/test/bytecode/javFiles/Fac.jav @@ -0,0 +1,16 @@ +import java.lang.Integer; +import java.lang.Long; +import java.lang.Double; + +public class Fac { + + getFac(n){ + var res = 1; + var i = 1; + while(i<=n) { + res = res * i; + i++; + } + return res; + } +} \ No newline at end of file diff --git a/test/bytecode/javFiles/Gen.jav b/test/bytecode/javFiles/Gen.jav index 5d579eb8..3b58b188 100644 --- a/test/bytecode/javFiles/Gen.jav +++ b/test/bytecode/javFiles/Gen.jav @@ -2,7 +2,7 @@ import java.lang.Integer; import java.util.Vector; public class Gen{ - Vector m(Vector v){ + Vector m(Vector v){ return v; } } diff --git a/test/bytecode/javFiles/Matrix.jav b/test/bytecode/javFiles/Matrix.jav index 8120a7c5..80f41b16 100644 --- a/test/bytecode/javFiles/Matrix.jav +++ b/test/bytecode/javFiles/Matrix.jav @@ -7,19 +7,19 @@ class Matrix extends Vector> { var ret = new Matrix(); var i = 0; while(i < size()) { - var v1 = this.elementAt(i); - var v2 = new Vector(); - var j = 0; - while(j < v1.size()) { - var erg = 0; - var k = 0; - while(k < v1.size()) { - erg = erg + v1.elementAt(k) - * m.elementAt(k).elementAt(j); - k++; } - v2.addElement(new Integer(erg)); - j++; } - ret.addElement(v2); +// var v1 = this.elementAt(i); +// var v2 = new Vector(); +// var j = 0; +// while(j < v1.size()) { +// var erg = 0; +// var k = 0; +// while(k < v1.size()) { +// erg = erg + v1.elementAt(k) +// * m.elementAt(k).elementAt(j); +// k++; } +// v2.addElement(new Integer(erg)); +// j++; } +// ret.addElement(v2); i++; } return ret; diff --git a/test/bytecode/javFiles/Op.jav b/test/bytecode/javFiles/Op.jav index c01e7e6e..082f48d8 100644 --- a/test/bytecode/javFiles/Op.jav +++ b/test/bytecode/javFiles/Op.jav @@ -9,7 +9,7 @@ import java.lang.Byte; public class Op { - Integer m(Integer a, Integer b) { + m(a, b) { //var c = a+b; return a+b; } diff --git a/test/bytecode/javFiles/Plus.jav b/test/bytecode/javFiles/Plus.jav index 4d425bf0..86b4eb36 100644 --- a/test/bytecode/javFiles/Plus.jav +++ b/test/bytecode/javFiles/Plus.jav @@ -1,4 +1,4 @@ -import java.lang.Integer; +//import java.lang.Integer; public class Plus { diff --git a/test/bytecode/javFiles/RelOps.jav b/test/bytecode/javFiles/RelOps.jav new file mode 100644 index 00000000..d75ee2f3 --- /dev/null +++ b/test/bytecode/javFiles/RelOps.jav @@ -0,0 +1,7 @@ +import java.lang.Integer; + +public class RelOps { + m(a,b){ + return a Deswegen kann +// nicht auf den Stack geladen. +//import java.lang.Long; public class While { m(x) { diff --git a/test/logFiles/log b/test/logFiles/log new file mode 100644 index 00000000..5d17ab28 --- /dev/null +++ b/test/logFiles/log @@ -0,0 +1,107 @@ +FC:\{java.lang.Number=Elem: Node(java.lang.Number) +Prec: [java.lang.Object, java.io.Serializable] +Desc: [java.lang.Integer] + +, java.lang.Comparable=Elem: Node(java.lang.Comparable) +Prec: [] +Desc: [java.lang.Integer] + +, java.lang.Comparable=Elem: Node(java.lang.Comparable) +Prec: [java.lang.Object] +Desc: [] + +, java.lang.Integer=Elem: Node(java.lang.Integer) +Prec: [java.lang.Number, java.lang.Object, java.lang.Comparable, java.io.Serializable] +Desc: [] + +, java.lang.Iterable=Elem: Node(java.lang.Iterable) +Prec: [java.lang.Object] +Desc: [] + +, java.lang.Iterable=Elem: Node(java.lang.Iterable) +Prec: [java.lang.Object] +Desc: [] + +, java.util.Collection=Elem: Node(java.util.Collection) +Prec: [] +Desc: [java.util.AbstractList, java.util.Vector, java.util.List, java.util.AbstractCollection] + +, java.util.AbstractCollection=Elem: Node(java.util.AbstractCollection) +Prec: [java.lang.Object, java.util.Collection] +Desc: [java.util.AbstractList, java.util.Vector] + +, java.util.AbstractList=Elem: Node(java.util.AbstractList) +Prec: [java.lang.Object, java.util.Collection, java.util.AbstractCollection, java.util.List] +Desc: [java.util.Vector] + +, java.lang.Cloneable=Elem: Node(java.lang.Cloneable) +Prec: [java.lang.Object] +Desc: [java.util.Vector] + +, java.lang.Comparable=Elem: Node(java.lang.Comparable) +Prec: [java.lang.Object] +Desc: [] + +, java.lang.Object=Elem: Node(java.lang.Object) +Prec: [java.lang.Object] +Desc: [java.lang.Number, java.lang.Comparable, java.lang.Integer, java.lang.Iterable, java.lang.Iterable, java.util.AbstractCollection, java.util.AbstractList, java.lang.Cloneable, java.lang.Comparable, Gen, java.lang.Object, java.util.Vector, java.util.Collection, java.util.RandomAccess, java.util.Collection, java.util.List, java.io.Serializable, java.lang.Iterable, java.util.Collection] + +, java.util.Vector=Elem: Node(java.util.Vector) +Prec: [java.util.AbstractList, java.lang.Cloneable, java.lang.Object, java.util.Collection, java.util.RandomAccess, java.io.Serializable, java.util.AbstractCollection, java.util.List] +Desc: [] + +, Gen=Elem: Node(Gen) +Prec: [java.lang.Object] +Desc: [] + +, java.util.Collection=Elem: Node(java.util.Collection) +Prec: [java.lang.Object, java.lang.Iterable] +Desc: [] + +, java.util.RandomAccess=Elem: Node(java.util.RandomAccess) +Prec: [java.lang.Object] +Desc: [java.util.Vector] + +, java.util.List=Elem: Node(java.util.List) +Prec: [java.lang.Object, java.util.Collection] +Desc: [] + +, java.util.Collection=Elem: Node(java.util.Collection) +Prec: [java.lang.Object, java.lang.Iterable] +Desc: [] + +, java.io.Serializable=Elem: Node(java.io.Serializable) +Prec: [java.lang.Object] +Desc: [java.lang.Number, java.util.Vector, java.lang.Integer] + +, java.lang.Iterable=Elem: Node(java.lang.Iterable) +Prec: [java.lang.Object] +Desc: [] + +, java.lang.Iterable=Elem: Node(java.lang.Iterable) +Prec: [] +Desc: [java.util.Collection, java.util.Collection, java.util.Collection] + +, java.util.Collection=Elem: Node(java.util.Collection) +Prec: [java.lang.Object, java.lang.Iterable] +Desc: [] + +, java.util.List=Elem: Node(java.util.List) +Prec: [] +Desc: [java.util.AbstractList, java.util.Vector] + +} +class Gen { + + java.util.Vector m(java.util.Vector v)({ + return (v)::java.util.Vector; + })::TPH K + + Gen()({ + super(()); + })::TPH N + +}Unifikation: [(java.util.Vector <. java.util.Vector, )] +Unifikation: [] +[] +RES: [] From f617ad8946b5472b6c79f3513ed43c6083976e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Thu, 24 May 2018 10:28:22 +0200 Subject: [PATCH 5/8] modified: ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java Relationen auf verschiedene Numeric-Typen umgestellt im equals Null abgefragt --- .../typeinference/typeAlgo/TYPEStmt.java | 44 +- .../typeinference/unify/model/UnifyPair.java | 3 + test/bytecode/javFiles/While.jav | 2 +- test/logFiles/log | 479 +++++++++++++++--- 4 files changed, 449 insertions(+), 79 deletions(-) diff --git a/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java b/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java index 4cf58121..4dad9de6 100644 --- a/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java +++ b/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java @@ -272,10 +272,48 @@ public class TYPEStmt implements StatementVisitor{ binary.operation.equals(BinaryExpr.Operator.BIGGEREQUAL) || binary.operation.equals(BinaryExpr.Operator.BIGGERTHAN) || binary.operation.equals(BinaryExpr.Operator.LESSTHAN)){ - constraintsSet.addUndConstraint(new Pair(binary.lexpr.getType(), number, PairOperator.SMALLERDOT)); - constraintsSet.addUndConstraint(new Pair(binary.rexpr.getType(), number, PairOperator.SMALLERDOT)); + //eingefuegt PL 2018-05-24 + Set numericRelationConcatenation = new HashSet<>(); + Constraint numeric = new Constraint<>(); + numeric.add(new Pair(binary.lexpr.getType(), bytee, PairOperator.SMALLERDOT)); + numeric.add(new Pair(binary.rexpr.getType(), bytee, PairOperator.SMALLERDOT)); + numeric.add(new Pair(binary.getType(), bool, PairOperator.SMALLERDOT)); + numericRelationConcatenation.add(numeric); + numeric = new Constraint<>(); + numeric.add(new Pair(binary.lexpr.getType(), shortt, PairOperator.SMALLERDOT)); + numeric.add(new Pair(binary.rexpr.getType(), shortt, PairOperator.SMALLERDOT)); + numeric.add(new Pair(binary.getType(), bool, PairOperator.SMALLERDOT)); + numericRelationConcatenation.add(numeric); + numeric = new Constraint<>(); + numeric.add(new Pair(binary.lexpr.getType(), integer, PairOperator.SMALLERDOT)); + numeric.add(new Pair(binary.rexpr.getType(), integer, PairOperator.SMALLERDOT)); + numeric.add(new Pair(binary.getType(), bool, PairOperator.SMALLERDOT)); + numericRelationConcatenation.add(numeric); + numeric = new Constraint<>(); + numeric.add(new Pair(binary.lexpr.getType(), longg, PairOperator.SMALLERDOT)); + numeric.add(new Pair(binary.rexpr.getType(), longg, PairOperator.SMALLERDOT)); + numeric.add(new Pair(binary.getType(), bool, PairOperator.SMALLERDOT)); + numericRelationConcatenation.add(numeric); + numeric = new Constraint<>(); + numeric.add(new Pair(binary.lexpr.getType(), floatt, PairOperator.SMALLERDOT)); + numeric.add(new Pair(binary.rexpr.getType(), floatt, PairOperator.SMALLERDOT)); + numeric.add(new Pair(binary.getType(), bool, PairOperator.SMALLERDOT)); + numericRelationConcatenation.add(numeric); + numeric = new Constraint<>(); + numeric.add(new Pair(binary.lexpr.getType(), doublee, PairOperator.SMALLERDOT)); + numeric.add(new Pair(binary.rexpr.getType(), doublee, PairOperator.SMALLERDOT)); + numeric.add(new Pair(binary.getType(), bool, PairOperator.SMALLERDOT)); + numericRelationConcatenation.add(numeric); + + //***ACHTUNG: Moeglicherweise oder und und-Contraint falsch + constraintsSet.addOderConstraint(numericRelationConcatenation); + //***ACHTUNG: Moeglicherweise oder und und-Contraint falsch + + //auskommentiert PL 2018-05-24 + //constraintsSet.addUndConstraint(new Pair(binary.lexpr.getType(), number, PairOperator.SMALLERDOT)); + //constraintsSet.addUndConstraint(new Pair(binary.rexpr.getType(), number, PairOperator.SMALLERDOT)); //Rückgabetyp ist Boolean - constraintsSet.addUndConstraint(new Pair(bool, binary.getType(), PairOperator.EQUALSDOT)); + //constraintsSet.addUndConstraint(new Pair(bool, binary.getType(), PairOperator.EQUALSDOT)); }else{ throw new NotImplementedException(); } diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java b/src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java index b631e5ec..19dee99f 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java @@ -149,6 +149,9 @@ public class UnifyPair { UnifyPair other = (UnifyPair) obj; if (isUndefinedPair()) { + if (other.getBasePair() != basePair || (other.getBasePair() == null && basePair == null)) { + return false; + } if (!other.getBasePair().equals(basePair) || !other.getAllSubstitutions().equals(getAllSubstitutions())) { return false; diff --git a/test/bytecode/javFiles/While.jav b/test/bytecode/javFiles/While.jav index 5b983f3e..ed7e8356 100644 --- a/test/bytecode/javFiles/While.jav +++ b/test/bytecode/javFiles/While.jav @@ -2,7 +2,7 @@ import java.lang.Integer; // wenn nur ein Import da steht,wird die Type von // dem Literal 2 Number berechnet => Deswegen kann // nicht auf den Stack geladen. -//import java.lang.Long; +import java.lang.Long; public class While { m(x) { diff --git a/test/logFiles/log b/test/logFiles/log index 5d17ab28..03035949 100644 --- a/test/logFiles/log +++ b/test/logFiles/log @@ -1,107 +1,436 @@ FC:\{java.lang.Number=Elem: Node(java.lang.Number) Prec: [java.lang.Object, java.io.Serializable] -Desc: [java.lang.Integer] +Desc: [java.lang.Integer, java.lang.Long] + +, java.lang.Object=Elem: Node(java.lang.Object) +Prec: [java.lang.Object] +Desc: [java.lang.Number, java.lang.Object, java.lang.Integer, java.lang.Comparable, java.lang.Long, java.lang.Comparable, While, java.io.Serializable, java.lang.Comparable] , java.lang.Comparable=Elem: Node(java.lang.Comparable) Prec: [] -Desc: [java.lang.Integer] - -, java.lang.Comparable=Elem: Node(java.lang.Comparable) -Prec: [java.lang.Object] -Desc: [] +Desc: [java.lang.Integer, java.lang.Long] , java.lang.Integer=Elem: Node(java.lang.Integer) Prec: [java.lang.Number, java.lang.Object, java.lang.Comparable, java.io.Serializable] Desc: [] -, java.lang.Iterable=Elem: Node(java.lang.Iterable) +, java.lang.Comparable=Elem: Node(java.lang.Comparable) Prec: [java.lang.Object] Desc: [] -, java.lang.Iterable=Elem: Node(java.lang.Iterable) -Prec: [java.lang.Object] +, java.lang.Long=Elem: Node(java.lang.Long) +Prec: [java.lang.Number, java.lang.Object, java.lang.Comparable, java.io.Serializable] Desc: [] -, java.util.Collection=Elem: Node(java.util.Collection) -Prec: [] -Desc: [java.util.AbstractList, java.util.Vector, java.util.List, java.util.AbstractCollection] - -, java.util.AbstractCollection=Elem: Node(java.util.AbstractCollection) -Prec: [java.lang.Object, java.util.Collection] -Desc: [java.util.AbstractList, java.util.Vector] - -, java.util.AbstractList=Elem: Node(java.util.AbstractList) -Prec: [java.lang.Object, java.util.Collection, java.util.AbstractCollection, java.util.List] -Desc: [java.util.Vector] - -, java.lang.Cloneable=Elem: Node(java.lang.Cloneable) +, java.lang.Comparable=Elem: Node(java.lang.Comparable) Prec: [java.lang.Object] -Desc: [java.util.Vector] - -, java.lang.Comparable=Elem: Node(java.lang.Comparable) -Prec: [java.lang.Object] -Desc: [] - -, java.lang.Object=Elem: Node(java.lang.Object) -Prec: [java.lang.Object] -Desc: [java.lang.Number, java.lang.Comparable, java.lang.Integer, java.lang.Iterable, java.lang.Iterable, java.util.AbstractCollection, java.util.AbstractList, java.lang.Cloneable, java.lang.Comparable, Gen, java.lang.Object, java.util.Vector, java.util.Collection, java.util.RandomAccess, java.util.Collection, java.util.List, java.io.Serializable, java.lang.Iterable, java.util.Collection] - -, java.util.Vector=Elem: Node(java.util.Vector) -Prec: [java.util.AbstractList, java.lang.Cloneable, java.lang.Object, java.util.Collection, java.util.RandomAccess, java.io.Serializable, java.util.AbstractCollection, java.util.List] -Desc: [] - -, Gen=Elem: Node(Gen) -Prec: [java.lang.Object] -Desc: [] - -, java.util.Collection=Elem: Node(java.util.Collection) -Prec: [java.lang.Object, java.lang.Iterable] -Desc: [] - -, java.util.RandomAccess=Elem: Node(java.util.RandomAccess) -Prec: [java.lang.Object] -Desc: [java.util.Vector] - -, java.util.List=Elem: Node(java.util.List) -Prec: [java.lang.Object, java.util.Collection] -Desc: [] - -, java.util.Collection=Elem: Node(java.util.Collection) -Prec: [java.lang.Object, java.lang.Iterable] Desc: [] , java.io.Serializable=Elem: Node(java.io.Serializable) Prec: [java.lang.Object] -Desc: [java.lang.Number, java.util.Vector, java.lang.Integer] +Desc: [java.lang.Number, java.lang.Integer, java.lang.Long] -, java.lang.Iterable=Elem: Node(java.lang.Iterable) +, While=Elem: Node(While) Prec: [java.lang.Object] Desc: [] -, java.lang.Iterable=Elem: Node(java.lang.Iterable) -Prec: [] -Desc: [java.util.Collection, java.util.Collection, java.util.Collection] - -, java.util.Collection=Elem: Node(java.util.Collection) -Prec: [java.lang.Object, java.lang.Iterable] +, java.lang.Comparable=Elem: Node(java.lang.Comparable) +Prec: [java.lang.Object] Desc: [] -, java.util.List=Elem: Node(java.util.List) -Prec: [] -Desc: [java.util.AbstractList, java.util.Vector] - } -class Gen { +class While { - java.util.Vector m(java.util.Vector v)({ - return (v)::java.util.Vector; - })::TPH K + TPH K m(TPH L x)({ + while((x)::TPH L | 2.0)({ + (x)::TPH L = (x)::TPH L | 1.0; + })::TPH Q; + return (x)::TPH L; + })::TPH S - Gen()({ + While()({ super(()); - })::TPH N + })::TPH V -}Unifikation: [(java.util.Vector <. java.util.Vector, )] -Unifikation: [] -[] +}0 AA: [] +1 Unifikation: [(O <. java.lang.Long, 0), (L <. java.lang.Float, 1), (P <. java.lang.Long, 1), (M =. java.lang.Boolean, 0), (N <. java.lang.Float, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (L <. java.lang.Long, 1)] +1 UndefinedPairs; (L <. java.lang.Float, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (N <. java.lang.Float, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. java.lang.Number, 1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (O <. java.lang.Double, 0), (P <. java.lang.Double, 1)] +1 UndefinedPairs; (L <. java.lang.Float, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (N <. java.lang.Float, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L =. java.lang.String, 1), (P <. L, 1, 1), (O =. java.lang.String, 0), (P =. java.lang.String, 1)] +1 UndefinedPairs; (L <. java.lang.Float, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Float, 1), (O <. java.lang.Byte, 0), (M =. java.lang.Boolean, 0), (N <. java.lang.Float, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (P <. java.lang.Integer, 1)] +1 UndefinedPairs; (L <. java.lang.Float, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (N <. java.lang.Float, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Float, 0), (P <. java.lang.Float, 1)] +1 UndefinedPairs; (L <. java.lang.Float, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Float, 1), (L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (N <. java.lang.Float, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1)] +1 UndefinedPairs; (L <. java.lang.Float, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (N <. java.lang.Float, 0), (M <. java.lang.Boolean, 0), (O <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (P <. java.lang.Integer, 1)] +1 UndefinedPairs; (L <. java.lang.Float, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(O <. java.lang.Long, 0), (L <. java.lang.Integer, 1), (P <. java.lang.Long, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (L <. java.lang.Long, 1), (N <. java.lang.Integer, 0)] +1 AA: [] +2 Unifikation: [(O <. java.lang.Long, 0), (java.lang.Integer <. K, , -1), (P <. java.lang.Long, 1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (P <. java.lang.Integer, 1), (java.lang.Integer <. java.lang.Long, ), (N <. java.lang.Integer, 0)] +1 UndefinedPairs; (java.lang.Integer <. java.lang.Long, ) +BasePair; (L <. java.lang.Long, 1) +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. java.lang.Number, 1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (O <. java.lang.Double, 0), (P <. java.lang.Double, 1), (N <. java.lang.Integer, 0)] +1 AA: [] +2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (P <. java.lang.Number, 1), (java.lang.Integer <. java.lang.Double, ), (P <. java.lang.Integer, 1), (O <. java.lang.Double, 0), (P <. java.lang.Double, 1), (N <. java.lang.Integer, 0)] +1 UndefinedPairs; (java.lang.Integer <. java.lang.Double, ) +BasePair; (L <. java.lang.Double, 1) +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L =. java.lang.String, 1), (P <. L, 1, 1), (O =. java.lang.String, 0), (N <. java.lang.Integer, 0), (P =. java.lang.String, 1)] +1 AA: [] +2 Unifikation: [(java.lang.Integer <. K, , -1), (java.lang.Integer =. java.lang.String, ), (M =. java.lang.Boolean, 0), (java.lang.String <. java.lang.Integer, ), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (O =. java.lang.String, 0), (P =. java.lang.String, 1), (N <. java.lang.Integer, 0)] +1 UndefinedPairs; (java.lang.Integer =. java.lang.String, ) +BasePair; (L =. java.lang.String, 1) +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Integer, 1), (O <. java.lang.Byte, 0), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (P <. java.lang.Integer, 1), (N <. java.lang.Integer, 0)] +1 AA: [] +2 Unifikation: [(java.lang.Integer <. K, , -1), (O <. java.lang.Byte, 0), (M =. java.lang.Boolean, 0), (java.lang.Integer <. java.lang.Byte, ), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (P <. java.lang.Integer, 1), (N <. java.lang.Integer, 0)] +1 UndefinedPairs; (java.lang.Integer <. java.lang.Byte, ) +BasePair; (L <. java.lang.Byte, 1) +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Integer, 1), (L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Float, 0), (P <. java.lang.Float, 1), (N <. java.lang.Integer, 0)] +1 AA: [] +2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (java.lang.Integer <. java.lang.Float, ), (O <. java.lang.Float, 0), (P <. java.lang.Integer, 1), (P <. java.lang.Float, 1), (N <. java.lang.Integer, 0)] +1 UndefinedPairs; (java.lang.Integer <. java.lang.Float, ) +BasePair; (L <. java.lang.Float, 1) +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1), (N <. java.lang.Integer, 0)] +1 AA: [] +2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1), (N <. java.lang.Integer, 0)] +nextSet: [[(K =. java.lang.Object, -1)], [(K =. java.lang.Integer, -1)], [(K =. java.lang.Comparable, -1)], [(K =. java.lang.Number, -1)], [(K =. java.io.Serializable, -1)]] +2 AA: [] +3 Unifikation: [(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1), (N <. java.lang.Integer, 0)] +nextSet: [[(P =. java.lang.Integer, 1)], [(P =. ? extends java.lang.Integer, 1)]] +3 AA: [] +4 Unifikation: [(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O <. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1), (N <. java.lang.Integer, 0)] +nextSet: [[(O =. java.lang.Integer, 0)], [(O =. ? extends java.lang.Integer, 0)]] +4 AA: [] +5 Unifikation: [(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1), (N <. java.lang.Integer, 0)] +nextSet: [[(N =. java.lang.Integer, 0)], [(N =. ? extends java.lang.Integer, 0)]] +5 AA: [] +6 Unifikation: [(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)] +[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)] +Result1 [[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)]] +Result1 [[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)]] +Result1 [[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)]] +Result1 [[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)]] +Result1 [[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)]] +Result1 [[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)]] +RES: [[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)]] +0 AA: [] +1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (O <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (P <. java.lang.Integer, 1), (N <. java.lang.Integer, 0)] +1 AA: [] +2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (O <. java.lang.Short, 0), (java.lang.Integer <. java.lang.Short, ), (P <. java.lang.Integer, 1), (N <. java.lang.Integer, 0)] +1 UndefinedPairs; (java.lang.Integer <. java.lang.Short, ) +BasePair; (L <. java.lang.Short, 1) +RES: [] +0 AA: [] +1 Unifikation: [(O <. java.lang.Long, 0), (P <. java.lang.Long, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (L <. java.lang.Long, 1)] +nextSet: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] +1 AA: [] +2 Unifikation: [(O <. java.lang.Long, 0), (? extends java.lang.Long <. L, , 1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (L <. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)] +1 UndefinedPairs; (L <. java.lang.Short, 1) +BasePair; null +abhSubst: [] +a: [(P =. ? extends java.lang.Long, 1)] +Durchschnitt: [] +nextSet: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] +nextSetasList: [] +Number erased Elements (undef): 1 +Number erased Elements (undef): 1 +Number of Backtracking: 1 +RES: [] +0 AA: [] +1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. java.lang.Number, 1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (O <. java.lang.Double, 0), (P <. java.lang.Double, 1)] +1 UndefinedPairs; (L <. java.lang.Short, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (L =. java.lang.String, 1), (P <. L, 1, 1), (O =. java.lang.String, 0), (P =. java.lang.String, 1)] +1 UndefinedPairs; (L <. java.lang.Short, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(O <. java.lang.Byte, 0), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (P <. java.lang.Integer, 1)] +1 UndefinedPairs; (L <. java.lang.Byte, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (O <. java.lang.Float, 0), (P <. java.lang.Float, 1)] +1 UndefinedPairs; (L <. java.lang.Float, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1)] +1 AA: [] +2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (java.lang.Integer <. java.lang.Short, ), (N <. java.lang.Short, 0), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1)] +1 UndefinedPairs; (java.lang.Integer <. java.lang.Short, ) +BasePair; (L <. java.lang.Short, 1) +RES: [] +0 AA: [] +1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (O <. java.lang.Short, 0), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (P <. java.lang.Integer, 1)] +1 UndefinedPairs; (L <. java.lang.Short, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(O <. java.lang.Long, 0), (P <. java.lang.Long, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (L <. java.lang.Long, 1), (N <. java.lang.Long, 0)] +nextSet: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] +1 AA: [] +2 Unifikation: [(O <. java.lang.Long, 0), (? extends java.lang.Long <. L, , 1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L <. K, 1, -1), (L <. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1), (N <. java.lang.Long, 0)] +2 AA: [] +3 Unifikation: [(O <. java.lang.Long, 0), (M =. java.lang.Boolean, 0), (L =. java.lang.Long, 1), (java.lang.Long <. K, , -1), (java.lang.Long <. java.lang.Long, ), (P =. ? extends java.lang.Long, 1), (N <. java.lang.Long, 0)] +nextSet: [[(K =. java.lang.Long, -1)], [(K =. java.lang.Object, -1)], [(K =. java.lang.Comparable, -1)], [(K =. java.lang.Number, -1)], [(K =. java.io.Serializable, -1)]] +3 AA: [] +4 Unifikation: [(O <. java.lang.Long, 0), (K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1), (N <. java.lang.Long, 0)] +nextSet: [[(O =. java.lang.Long, 0)], [(O =. ? extends java.lang.Long, 0)]] +4 AA: [] +5 Unifikation: [(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1), (N <. java.lang.Long, 0)] +nextSet: [[(N =. java.lang.Long, 0)], [(N =. ? extends java.lang.Long, 0)]] +5 AA: [] +6 Unifikation: [(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)] +[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)] +Result1 [[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)]] +Result1 [[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)]] +Result1 [[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)]] +Result1 [[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)]] +Result1 [[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)]] +Result1 [[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)]] +RES: [[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)]] +0 AA: [] +1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. java.lang.Number, 1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (L <. java.lang.Long, 1), (O <. java.lang.Double, 0), (P <. java.lang.Double, 1), (N <. java.lang.Long, 0)] +nextSet: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Number, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] +1 AA: [] +2 Unifikation: [(M =. java.lang.Boolean, 0), (? extends java.lang.Number <. java.lang.Double, ), (java.lang.Boolean <. java.lang.Boolean, ), (L <. K, 1, -1), (L <. java.lang.Double, 1), (? extends java.lang.Number <. L, , 1), (L <. java.lang.Long, 1), (O <. java.lang.Double, 0), (P =. ? extends java.lang.Number, 1), (N <. java.lang.Long, 0)] +1 UndefinedPairs; (java.lang.Number <. java.lang.Double, ) +BasePair; (P <. java.lang.Double, 1) +1 UndefinedPairs; (L <. java.lang.Double, 1) +BasePair; null +abhSubst: [(P =. ? extends java.lang.Number, 1)] +a: [(P =. ? extends java.lang.Number, 1)] +Durchschnitt: [(P =. ? extends java.lang.Number, 1)] +nextSet: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Number, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] +nextSetasList: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] +Number erased Elements (undef): 0 +Number erased Elements (undef): 0 +Number of Backtracking: 1 +2 AA: [] +3 Unifikation: [(P =. java.lang.Number, 1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (java.lang.Number <. java.lang.Double, ), (L <. K, 1, -1), (L <. java.lang.Double, 1), (L <. java.lang.Long, 1), (O <. java.lang.Double, 0), (java.lang.Number <. L, , 1), (N <. java.lang.Long, 0)] +2 UndefinedPairs; (java.lang.Number <. java.lang.Double, ) +BasePair; (P <. java.lang.Double, 1) +2 UndefinedPairs; (L <. java.lang.Double, 1) +BasePair; null +abhSubst: [(P =. java.lang.Number, 1)] +a: [(P =. java.lang.Number, 1)] +Durchschnitt: [(P =. java.lang.Number, 1)] +nextSet: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Number, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] +nextSetasList: [[(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] +Number erased Elements (undef): 0 +Number erased Elements (undef): 0 +Number of Backtracking: 2 +3 AA: [] +4 Unifikation: [(M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (? extends java.lang.Integer <. java.lang.Double, ), (L <. K, 1, -1), (L <. java.lang.Double, 1), (? extends java.lang.Integer <. L, , 1), (L <. java.lang.Long, 1), (O <. java.lang.Double, 0), (P =. ? extends java.lang.Integer, 1), (N <. java.lang.Long, 0)] +3 UndefinedPairs; (java.lang.Integer <. java.lang.Double, ) +BasePair; (P <. java.lang.Double, 1) +abhSubst: [(P =. ? extends java.lang.Integer, 1)] +a: [(P =. ? extends java.lang.Integer, 1)] +Durchschnitt: [(P =. ? extends java.lang.Integer, 1)] +nextSet: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Number, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] +nextSetasList: [[(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] +Number erased Elements (undef): 0 +Number erased Elements (undef): 0 +Number of Backtracking: 3 +4 AA: [] +5 Unifikation: [(java.lang.Integer <. L, , 1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L <. K, 1, -1), (L <. java.lang.Double, 1), (P =. java.lang.Integer, 1), (L <. java.lang.Long, 1), (O <. java.lang.Double, 0), (java.lang.Integer <. java.lang.Double, ), (N <. java.lang.Long, 0)] +4 UndefinedPairs; (java.lang.Integer <. java.lang.Double, ) +BasePair; (P <. java.lang.Double, 1) +abhSubst: [(P =. java.lang.Integer, 1)] +a: [(P =. java.lang.Integer, 1)] +Durchschnitt: [(P =. java.lang.Integer, 1)] +nextSet: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Number, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] +nextSetasList: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] +Number erased Elements (undef): 0 +Number erased Elements (undef): 0 +Number of Backtracking: 4 +5 AA: [] +6 Unifikation: [(? extends java.lang.Long <. L, , 1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L <. K, 1, -1), (L <. java.lang.Double, 1), (? extends java.lang.Long <. java.lang.Double, ), (L <. java.lang.Long, 1), (O <. java.lang.Double, 0), (P =. ? extends java.lang.Long, 1), (N <. java.lang.Long, 0)] +5 UndefinedPairs; (java.lang.Long <. java.lang.Double, ) +BasePair; (P <. java.lang.Double, 1) +5 UndefinedPairs; (L <. java.lang.Double, 1) +BasePair; null +abhSubst: [(P =. ? extends java.lang.Long, 1)] +a: [(P =. ? extends java.lang.Long, 1)] +Durchschnitt: [(P =. ? extends java.lang.Long, 1)] +nextSet: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Number, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] +nextSetasList: [[(P =. java.lang.Long, 1)]] +Number erased Elements (undef): 0 +Number erased Elements (undef): 0 +Number of Backtracking: 5 +6 AA: [] +7 Unifikation: [(java.lang.Long <. java.lang.Double, ), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L <. K, 1, -1), (L <. java.lang.Double, 1), (P =. java.lang.Long, 1), (java.lang.Long <. L, , 1), (L <. java.lang.Long, 1), (O <. java.lang.Double, 0), (N <. java.lang.Long, 0)] +6 UndefinedPairs; (java.lang.Long <. java.lang.Double, ) +BasePair; (P <. java.lang.Double, 1) +6 UndefinedPairs; (L <. java.lang.Double, 1) +BasePair; null +abhSubst: [(P =. java.lang.Long, 1)] +a: [(P =. java.lang.Long, 1)] +Durchschnitt: [(P =. java.lang.Long, 1)] +nextSet: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Number, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] +nextSetasList: [] +Number erased Elements (undef): 0 +Number erased Elements (undef): 0 +Number of Backtracking: 6 +RES: [] +0 AA: [] +1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L =. java.lang.String, 1), (P <. L, 1, 1), (L <. java.lang.Long, 1), (O =. java.lang.String, 0), (N <. java.lang.Long, 0), (P =. java.lang.String, 1)] +1 AA: [] +2 Unifikation: [(M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Long, 1), (java.lang.String <. java.lang.Long, ), (java.lang.Long <. K, , -1), (java.lang.Long =. java.lang.String, ), (O =. java.lang.String, 0), (P =. java.lang.String, 1), (N <. java.lang.Long, 0)] +1 UndefinedPairs; (java.lang.String <. java.lang.Long, ) +BasePair; (P <. java.lang.Long, 1) +RES: [] +0 AA: [] +1 Unifikation: [(O <. java.lang.Byte, 0), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (L <. java.lang.Long, 1), (P <. java.lang.Integer, 1), (N <. java.lang.Long, 0)] +1 UndefinedPairs; (L <. java.lang.Byte, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Float, 0), (L <. java.lang.Long, 1), (P <. java.lang.Float, 1), (N <. java.lang.Long, 0)] +1 UndefinedPairs; (L <. java.lang.Float, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Integer, 0), (L <. java.lang.Long, 1), (P <. java.lang.Integer, 1), (N <. java.lang.Long, 0)] +1 AA: [] +2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1), (java.lang.Integer <. java.lang.Long, ), (N <. java.lang.Long, 0)] +1 UndefinedPairs; (java.lang.Integer <. java.lang.Long, ) +BasePair; (L <. java.lang.Long, 1) +RES: [] +0 AA: [] +1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (O <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (L <. java.lang.Long, 1), (P <. java.lang.Integer, 1), (N <. java.lang.Long, 0)] +1 UndefinedPairs; (L <. java.lang.Short, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(O <. java.lang.Long, 0), (P <. java.lang.Long, 1), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Byte, 0), (L <. K, 1, -1), (P <. L, 1, 1), (L <. java.lang.Long, 1)] +nextSet: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] +1 AA: [] +2 Unifikation: [(O <. java.lang.Long, 0), (? extends java.lang.Long <. L, , 1), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (N <. java.lang.Byte, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L <. K, 1, -1), (L <. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)] +1 UndefinedPairs; (L <. java.lang.Byte, 1) +BasePair; null +abhSubst: [] +a: [(P =. ? extends java.lang.Long, 1)] +Durchschnitt: [] +nextSet: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] +nextSetasList: [] +Number erased Elements (undef): 1 +Number erased Elements (undef): 1 +Number of Backtracking: 1 +RES: [] +0 AA: [] +1 Unifikation: [(M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Byte, 0), (L <. K, 1, -1), (P <. java.lang.Number, 1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (O <. java.lang.Double, 0), (P <. java.lang.Double, 1)] +1 UndefinedPairs; (L <. java.lang.Byte, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Byte, 0), (L <. K, 1, -1), (L =. java.lang.String, 1), (P <. L, 1, 1), (O =. java.lang.String, 0), (P =. java.lang.String, 1)] +1 UndefinedPairs; (L <. java.lang.Byte, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(O <. java.lang.Byte, 0), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Byte, 0), (L <. K, 1, -1), (P <. L, 1, 1), (P <. java.lang.Integer, 1)] +1 UndefinedPairs; (L <. java.lang.Byte, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Byte, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Float, 0), (P <. java.lang.Float, 1)] +1 UndefinedPairs; (L <. java.lang.Float, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Byte, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1)] +1 AA: [] +2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Integer <. java.lang.Byte, ), (N <. java.lang.Byte, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1)] +1 UndefinedPairs; (java.lang.Integer <. java.lang.Byte, ) +BasePair; (L <. java.lang.Byte, 1) +RES: [] +0 AA: [] +1 Unifikation: [(M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Byte, 0), (O <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (P <. java.lang.Integer, 1)] +1 UndefinedPairs; (L <. java.lang.Byte, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(O <. java.lang.Long, 0), (P <. java.lang.Long, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (N <. java.lang.Double, 0), (L <. java.lang.Long, 1)] +nextSet: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] +1 AA: [] +2 Unifikation: [(O <. java.lang.Long, 0), (? extends java.lang.Long <. L, , 1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L <. K, 1, -1), (L <. java.lang.Double, 1), (N <. java.lang.Double, 0), (L <. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)] +1 UndefinedPairs; (L <. java.lang.Double, 1) +BasePair; null +abhSubst: [] +a: [(P =. ? extends java.lang.Long, 1)] +Durchschnitt: [] +nextSet: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] +nextSetasList: [] +Number erased Elements (undef): 1 +Number erased Elements (undef): 1 +Number of Backtracking: 1 +RES: [] +0 AA: [] +1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L <. java.lang.Double, 1), (P <. java.lang.Number, 1), (P <. L, 1, 1), (N <. java.lang.Double, 0), (O <. java.lang.Double, 0), (P <. java.lang.Double, 1)] +1 UndefinedPairs; (L <. java.lang.Double, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L <. java.lang.Double, 1), (L =. java.lang.String, 1), (P <. L, 1, 1), (N <. java.lang.Double, 0), (O =. java.lang.String, 0), (P =. java.lang.String, 1)] +1 UndefinedPairs; (L <. java.lang.Double, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(O <. java.lang.Byte, 0), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (N <. java.lang.Double, 0), (P <. java.lang.Integer, 1)] +1 UndefinedPairs; (L <. java.lang.Byte, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (N <. java.lang.Double, 0), (O <. java.lang.Float, 0), (P <. java.lang.Float, 1)] +1 UndefinedPairs; (L <. java.lang.Float, 1) +BasePair; null +RES: [] +0 AA: [] +1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (N <. java.lang.Double, 0), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1)] +1 AA: [] +2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (N <. java.lang.Double, 0), (O <. java.lang.Integer, 0), (java.lang.Integer <. java.lang.Double, ), (P <. java.lang.Integer, 1)] +1 UndefinedPairs; (java.lang.Integer <. java.lang.Double, ) +BasePair; (L <. java.lang.Double, 1) +RES: [] +0 AA: [] +1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (O <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Double, 1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (N <. java.lang.Double, 0), (P <. java.lang.Integer, 1)] +1 UndefinedPairs; (L <. java.lang.Double, 1) +BasePair; null RES: [] From f5398fa8e93b7cf42f5fca0c10dcb86a1f2c0208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Thu, 24 May 2018 10:34:50 +0200 Subject: [PATCH 6/8] deleted: ../../test/logFiles/log --- test/logFiles/log | 436 ---------------------------------------------- 1 file changed, 436 deletions(-) delete mode 100644 test/logFiles/log diff --git a/test/logFiles/log b/test/logFiles/log deleted file mode 100644 index 03035949..00000000 --- a/test/logFiles/log +++ /dev/null @@ -1,436 +0,0 @@ -FC:\{java.lang.Number=Elem: Node(java.lang.Number) -Prec: [java.lang.Object, java.io.Serializable] -Desc: [java.lang.Integer, java.lang.Long] - -, java.lang.Object=Elem: Node(java.lang.Object) -Prec: [java.lang.Object] -Desc: [java.lang.Number, java.lang.Object, java.lang.Integer, java.lang.Comparable, java.lang.Long, java.lang.Comparable, While, java.io.Serializable, java.lang.Comparable] - -, java.lang.Comparable=Elem: Node(java.lang.Comparable) -Prec: [] -Desc: [java.lang.Integer, java.lang.Long] - -, java.lang.Integer=Elem: Node(java.lang.Integer) -Prec: [java.lang.Number, java.lang.Object, java.lang.Comparable, java.io.Serializable] -Desc: [] - -, java.lang.Comparable=Elem: Node(java.lang.Comparable) -Prec: [java.lang.Object] -Desc: [] - -, java.lang.Long=Elem: Node(java.lang.Long) -Prec: [java.lang.Number, java.lang.Object, java.lang.Comparable, java.io.Serializable] -Desc: [] - -, java.lang.Comparable=Elem: Node(java.lang.Comparable) -Prec: [java.lang.Object] -Desc: [] - -, java.io.Serializable=Elem: Node(java.io.Serializable) -Prec: [java.lang.Object] -Desc: [java.lang.Number, java.lang.Integer, java.lang.Long] - -, While=Elem: Node(While) -Prec: [java.lang.Object] -Desc: [] - -, java.lang.Comparable=Elem: Node(java.lang.Comparable) -Prec: [java.lang.Object] -Desc: [] - -} -class While { - - TPH K m(TPH L x)({ - while((x)::TPH L | 2.0)({ - (x)::TPH L = (x)::TPH L | 1.0; - })::TPH Q; - return (x)::TPH L; - })::TPH S - - While()({ - super(()); - })::TPH V - -}0 AA: [] -1 Unifikation: [(O <. java.lang.Long, 0), (L <. java.lang.Float, 1), (P <. java.lang.Long, 1), (M =. java.lang.Boolean, 0), (N <. java.lang.Float, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (L <. java.lang.Long, 1)] -1 UndefinedPairs; (L <. java.lang.Float, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (N <. java.lang.Float, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. java.lang.Number, 1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (O <. java.lang.Double, 0), (P <. java.lang.Double, 1)] -1 UndefinedPairs; (L <. java.lang.Float, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (N <. java.lang.Float, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L =. java.lang.String, 1), (P <. L, 1, 1), (O =. java.lang.String, 0), (P =. java.lang.String, 1)] -1 UndefinedPairs; (L <. java.lang.Float, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Float, 1), (O <. java.lang.Byte, 0), (M =. java.lang.Boolean, 0), (N <. java.lang.Float, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (P <. java.lang.Integer, 1)] -1 UndefinedPairs; (L <. java.lang.Float, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (N <. java.lang.Float, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Float, 0), (P <. java.lang.Float, 1)] -1 UndefinedPairs; (L <. java.lang.Float, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Float, 1), (L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (N <. java.lang.Float, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1)] -1 UndefinedPairs; (L <. java.lang.Float, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (N <. java.lang.Float, 0), (M <. java.lang.Boolean, 0), (O <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (P <. java.lang.Integer, 1)] -1 UndefinedPairs; (L <. java.lang.Float, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(O <. java.lang.Long, 0), (L <. java.lang.Integer, 1), (P <. java.lang.Long, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (L <. java.lang.Long, 1), (N <. java.lang.Integer, 0)] -1 AA: [] -2 Unifikation: [(O <. java.lang.Long, 0), (java.lang.Integer <. K, , -1), (P <. java.lang.Long, 1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (P <. java.lang.Integer, 1), (java.lang.Integer <. java.lang.Long, ), (N <. java.lang.Integer, 0)] -1 UndefinedPairs; (java.lang.Integer <. java.lang.Long, ) -BasePair; (L <. java.lang.Long, 1) -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. java.lang.Number, 1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (O <. java.lang.Double, 0), (P <. java.lang.Double, 1), (N <. java.lang.Integer, 0)] -1 AA: [] -2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (P <. java.lang.Number, 1), (java.lang.Integer <. java.lang.Double, ), (P <. java.lang.Integer, 1), (O <. java.lang.Double, 0), (P <. java.lang.Double, 1), (N <. java.lang.Integer, 0)] -1 UndefinedPairs; (java.lang.Integer <. java.lang.Double, ) -BasePair; (L <. java.lang.Double, 1) -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L =. java.lang.String, 1), (P <. L, 1, 1), (O =. java.lang.String, 0), (N <. java.lang.Integer, 0), (P =. java.lang.String, 1)] -1 AA: [] -2 Unifikation: [(java.lang.Integer <. K, , -1), (java.lang.Integer =. java.lang.String, ), (M =. java.lang.Boolean, 0), (java.lang.String <. java.lang.Integer, ), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (O =. java.lang.String, 0), (P =. java.lang.String, 1), (N <. java.lang.Integer, 0)] -1 UndefinedPairs; (java.lang.Integer =. java.lang.String, ) -BasePair; (L =. java.lang.String, 1) -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Integer, 1), (O <. java.lang.Byte, 0), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (P <. java.lang.Integer, 1), (N <. java.lang.Integer, 0)] -1 AA: [] -2 Unifikation: [(java.lang.Integer <. K, , -1), (O <. java.lang.Byte, 0), (M =. java.lang.Boolean, 0), (java.lang.Integer <. java.lang.Byte, ), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (P <. java.lang.Integer, 1), (N <. java.lang.Integer, 0)] -1 UndefinedPairs; (java.lang.Integer <. java.lang.Byte, ) -BasePair; (L <. java.lang.Byte, 1) -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Integer, 1), (L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Float, 0), (P <. java.lang.Float, 1), (N <. java.lang.Integer, 0)] -1 AA: [] -2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (java.lang.Integer <. java.lang.Float, ), (O <. java.lang.Float, 0), (P <. java.lang.Integer, 1), (P <. java.lang.Float, 1), (N <. java.lang.Integer, 0)] -1 UndefinedPairs; (java.lang.Integer <. java.lang.Float, ) -BasePair; (L <. java.lang.Float, 1) -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1), (N <. java.lang.Integer, 0)] -1 AA: [] -2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1), (N <. java.lang.Integer, 0)] -nextSet: [[(K =. java.lang.Object, -1)], [(K =. java.lang.Integer, -1)], [(K =. java.lang.Comparable, -1)], [(K =. java.lang.Number, -1)], [(K =. java.io.Serializable, -1)]] -2 AA: [] -3 Unifikation: [(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1), (N <. java.lang.Integer, 0)] -nextSet: [[(P =. java.lang.Integer, 1)], [(P =. ? extends java.lang.Integer, 1)]] -3 AA: [] -4 Unifikation: [(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O <. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1), (N <. java.lang.Integer, 0)] -nextSet: [[(O =. java.lang.Integer, 0)], [(O =. ? extends java.lang.Integer, 0)]] -4 AA: [] -5 Unifikation: [(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1), (N <. java.lang.Integer, 0)] -nextSet: [[(N =. java.lang.Integer, 0)], [(N =. ? extends java.lang.Integer, 0)]] -5 AA: [] -6 Unifikation: [(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)] -[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)] -Result1 [[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)]] -Result1 [[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)]] -Result1 [[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)]] -Result1 [[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)]] -Result1 [[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)]] -Result1 [[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)]] -RES: [[(M =. java.lang.Boolean, 0), (K =. java.lang.Integer, -1), (L =. java.lang.Integer, 1), (O =. java.lang.Integer, 0), (N =. java.lang.Integer, 0), (P =. ? extends java.lang.Integer, 1)]] -0 AA: [] -1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (O <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (P <. java.lang.Integer, 1), (N <. java.lang.Integer, 0)] -1 AA: [] -2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (O <. java.lang.Short, 0), (java.lang.Integer <. java.lang.Short, ), (P <. java.lang.Integer, 1), (N <. java.lang.Integer, 0)] -1 UndefinedPairs; (java.lang.Integer <. java.lang.Short, ) -BasePair; (L <. java.lang.Short, 1) -RES: [] -0 AA: [] -1 Unifikation: [(O <. java.lang.Long, 0), (P <. java.lang.Long, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (L <. java.lang.Long, 1)] -nextSet: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] -1 AA: [] -2 Unifikation: [(O <. java.lang.Long, 0), (? extends java.lang.Long <. L, , 1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (L <. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)] -1 UndefinedPairs; (L <. java.lang.Short, 1) -BasePair; null -abhSubst: [] -a: [(P =. ? extends java.lang.Long, 1)] -Durchschnitt: [] -nextSet: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] -nextSetasList: [] -Number erased Elements (undef): 1 -Number erased Elements (undef): 1 -Number of Backtracking: 1 -RES: [] -0 AA: [] -1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. java.lang.Number, 1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (O <. java.lang.Double, 0), (P <. java.lang.Double, 1)] -1 UndefinedPairs; (L <. java.lang.Short, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (L =. java.lang.String, 1), (P <. L, 1, 1), (O =. java.lang.String, 0), (P =. java.lang.String, 1)] -1 UndefinedPairs; (L <. java.lang.Short, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(O <. java.lang.Byte, 0), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (P <. java.lang.Integer, 1)] -1 UndefinedPairs; (L <. java.lang.Byte, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (O <. java.lang.Float, 0), (P <. java.lang.Float, 1)] -1 UndefinedPairs; (L <. java.lang.Float, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1)] -1 AA: [] -2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (java.lang.Integer <. java.lang.Short, ), (N <. java.lang.Short, 0), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1)] -1 UndefinedPairs; (java.lang.Integer <. java.lang.Short, ) -BasePair; (L <. java.lang.Short, 1) -RES: [] -0 AA: [] -1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (O <. java.lang.Short, 0), (N <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (P <. java.lang.Integer, 1)] -1 UndefinedPairs; (L <. java.lang.Short, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(O <. java.lang.Long, 0), (P <. java.lang.Long, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (L <. java.lang.Long, 1), (N <. java.lang.Long, 0)] -nextSet: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] -1 AA: [] -2 Unifikation: [(O <. java.lang.Long, 0), (? extends java.lang.Long <. L, , 1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L <. K, 1, -1), (L <. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1), (N <. java.lang.Long, 0)] -2 AA: [] -3 Unifikation: [(O <. java.lang.Long, 0), (M =. java.lang.Boolean, 0), (L =. java.lang.Long, 1), (java.lang.Long <. K, , -1), (java.lang.Long <. java.lang.Long, ), (P =. ? extends java.lang.Long, 1), (N <. java.lang.Long, 0)] -nextSet: [[(K =. java.lang.Long, -1)], [(K =. java.lang.Object, -1)], [(K =. java.lang.Comparable, -1)], [(K =. java.lang.Number, -1)], [(K =. java.io.Serializable, -1)]] -3 AA: [] -4 Unifikation: [(O <. java.lang.Long, 0), (K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1), (N <. java.lang.Long, 0)] -nextSet: [[(O =. java.lang.Long, 0)], [(O =. ? extends java.lang.Long, 0)]] -4 AA: [] -5 Unifikation: [(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1), (N <. java.lang.Long, 0)] -nextSet: [[(N =. java.lang.Long, 0)], [(N =. ? extends java.lang.Long, 0)]] -5 AA: [] -6 Unifikation: [(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)] -[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)] -Result1 [[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)]] -Result1 [[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)]] -Result1 [[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)]] -Result1 [[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)]] -Result1 [[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)]] -Result1 [[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)]] -RES: [[(K =. java.lang.Long, -1), (M =. java.lang.Boolean, 0), (O =. java.lang.Long, 0), (N =. java.lang.Long, 0), (L =. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)]] -0 AA: [] -1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. java.lang.Number, 1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (L <. java.lang.Long, 1), (O <. java.lang.Double, 0), (P <. java.lang.Double, 1), (N <. java.lang.Long, 0)] -nextSet: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Number, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] -1 AA: [] -2 Unifikation: [(M =. java.lang.Boolean, 0), (? extends java.lang.Number <. java.lang.Double, ), (java.lang.Boolean <. java.lang.Boolean, ), (L <. K, 1, -1), (L <. java.lang.Double, 1), (? extends java.lang.Number <. L, , 1), (L <. java.lang.Long, 1), (O <. java.lang.Double, 0), (P =. ? extends java.lang.Number, 1), (N <. java.lang.Long, 0)] -1 UndefinedPairs; (java.lang.Number <. java.lang.Double, ) -BasePair; (P <. java.lang.Double, 1) -1 UndefinedPairs; (L <. java.lang.Double, 1) -BasePair; null -abhSubst: [(P =. ? extends java.lang.Number, 1)] -a: [(P =. ? extends java.lang.Number, 1)] -Durchschnitt: [(P =. ? extends java.lang.Number, 1)] -nextSet: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Number, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] -nextSetasList: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] -Number erased Elements (undef): 0 -Number erased Elements (undef): 0 -Number of Backtracking: 1 -2 AA: [] -3 Unifikation: [(P =. java.lang.Number, 1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (java.lang.Number <. java.lang.Double, ), (L <. K, 1, -1), (L <. java.lang.Double, 1), (L <. java.lang.Long, 1), (O <. java.lang.Double, 0), (java.lang.Number <. L, , 1), (N <. java.lang.Long, 0)] -2 UndefinedPairs; (java.lang.Number <. java.lang.Double, ) -BasePair; (P <. java.lang.Double, 1) -2 UndefinedPairs; (L <. java.lang.Double, 1) -BasePair; null -abhSubst: [(P =. java.lang.Number, 1)] -a: [(P =. java.lang.Number, 1)] -Durchschnitt: [(P =. java.lang.Number, 1)] -nextSet: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Number, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] -nextSetasList: [[(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] -Number erased Elements (undef): 0 -Number erased Elements (undef): 0 -Number of Backtracking: 2 -3 AA: [] -4 Unifikation: [(M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (? extends java.lang.Integer <. java.lang.Double, ), (L <. K, 1, -1), (L <. java.lang.Double, 1), (? extends java.lang.Integer <. L, , 1), (L <. java.lang.Long, 1), (O <. java.lang.Double, 0), (P =. ? extends java.lang.Integer, 1), (N <. java.lang.Long, 0)] -3 UndefinedPairs; (java.lang.Integer <. java.lang.Double, ) -BasePair; (P <. java.lang.Double, 1) -abhSubst: [(P =. ? extends java.lang.Integer, 1)] -a: [(P =. ? extends java.lang.Integer, 1)] -Durchschnitt: [(P =. ? extends java.lang.Integer, 1)] -nextSet: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Number, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] -nextSetasList: [[(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] -Number erased Elements (undef): 0 -Number erased Elements (undef): 0 -Number of Backtracking: 3 -4 AA: [] -5 Unifikation: [(java.lang.Integer <. L, , 1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L <. K, 1, -1), (L <. java.lang.Double, 1), (P =. java.lang.Integer, 1), (L <. java.lang.Long, 1), (O <. java.lang.Double, 0), (java.lang.Integer <. java.lang.Double, ), (N <. java.lang.Long, 0)] -4 UndefinedPairs; (java.lang.Integer <. java.lang.Double, ) -BasePair; (P <. java.lang.Double, 1) -abhSubst: [(P =. java.lang.Integer, 1)] -a: [(P =. java.lang.Integer, 1)] -Durchschnitt: [(P =. java.lang.Integer, 1)] -nextSet: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Number, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] -nextSetasList: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] -Number erased Elements (undef): 0 -Number erased Elements (undef): 0 -Number of Backtracking: 4 -5 AA: [] -6 Unifikation: [(? extends java.lang.Long <. L, , 1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L <. K, 1, -1), (L <. java.lang.Double, 1), (? extends java.lang.Long <. java.lang.Double, ), (L <. java.lang.Long, 1), (O <. java.lang.Double, 0), (P =. ? extends java.lang.Long, 1), (N <. java.lang.Long, 0)] -5 UndefinedPairs; (java.lang.Long <. java.lang.Double, ) -BasePair; (P <. java.lang.Double, 1) -5 UndefinedPairs; (L <. java.lang.Double, 1) -BasePair; null -abhSubst: [(P =. ? extends java.lang.Long, 1)] -a: [(P =. ? extends java.lang.Long, 1)] -Durchschnitt: [(P =. ? extends java.lang.Long, 1)] -nextSet: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Number, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] -nextSetasList: [[(P =. java.lang.Long, 1)]] -Number erased Elements (undef): 0 -Number erased Elements (undef): 0 -Number of Backtracking: 5 -6 AA: [] -7 Unifikation: [(java.lang.Long <. java.lang.Double, ), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L <. K, 1, -1), (L <. java.lang.Double, 1), (P =. java.lang.Long, 1), (java.lang.Long <. L, , 1), (L <. java.lang.Long, 1), (O <. java.lang.Double, 0), (N <. java.lang.Long, 0)] -6 UndefinedPairs; (java.lang.Long <. java.lang.Double, ) -BasePair; (P <. java.lang.Double, 1) -6 UndefinedPairs; (L <. java.lang.Double, 1) -BasePair; null -abhSubst: [(P =. java.lang.Long, 1)] -a: [(P =. java.lang.Long, 1)] -Durchschnitt: [(P =. java.lang.Long, 1)] -nextSet: [[(P =. java.lang.Number, 1)], [(P =. java.lang.Integer, 1)], [(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Number, 1)], [(P =. ? extends java.lang.Integer, 1)], [(P =. ? extends java.lang.Long, 1)]] -nextSetasList: [] -Number erased Elements (undef): 0 -Number erased Elements (undef): 0 -Number of Backtracking: 6 -RES: [] -0 AA: [] -1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L =. java.lang.String, 1), (P <. L, 1, 1), (L <. java.lang.Long, 1), (O =. java.lang.String, 0), (N <. java.lang.Long, 0), (P =. java.lang.String, 1)] -1 AA: [] -2 Unifikation: [(M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Long, 1), (java.lang.String <. java.lang.Long, ), (java.lang.Long <. K, , -1), (java.lang.Long =. java.lang.String, ), (O =. java.lang.String, 0), (P =. java.lang.String, 1), (N <. java.lang.Long, 0)] -1 UndefinedPairs; (java.lang.String <. java.lang.Long, ) -BasePair; (P <. java.lang.Long, 1) -RES: [] -0 AA: [] -1 Unifikation: [(O <. java.lang.Byte, 0), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (L <. java.lang.Long, 1), (P <. java.lang.Integer, 1), (N <. java.lang.Long, 0)] -1 UndefinedPairs; (L <. java.lang.Byte, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Float, 0), (L <. java.lang.Long, 1), (P <. java.lang.Float, 1), (N <. java.lang.Long, 0)] -1 UndefinedPairs; (L <. java.lang.Float, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Integer, 0), (L <. java.lang.Long, 1), (P <. java.lang.Integer, 1), (N <. java.lang.Long, 0)] -1 AA: [] -2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1), (java.lang.Integer <. java.lang.Long, ), (N <. java.lang.Long, 0)] -1 UndefinedPairs; (java.lang.Integer <. java.lang.Long, ) -BasePair; (L <. java.lang.Long, 1) -RES: [] -0 AA: [] -1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (O <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (L <. java.lang.Long, 1), (P <. java.lang.Integer, 1), (N <. java.lang.Long, 0)] -1 UndefinedPairs; (L <. java.lang.Short, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(O <. java.lang.Long, 0), (P <. java.lang.Long, 1), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Byte, 0), (L <. K, 1, -1), (P <. L, 1, 1), (L <. java.lang.Long, 1)] -nextSet: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] -1 AA: [] -2 Unifikation: [(O <. java.lang.Long, 0), (? extends java.lang.Long <. L, , 1), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (N <. java.lang.Byte, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L <. K, 1, -1), (L <. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)] -1 UndefinedPairs; (L <. java.lang.Byte, 1) -BasePair; null -abhSubst: [] -a: [(P =. ? extends java.lang.Long, 1)] -Durchschnitt: [] -nextSet: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] -nextSetasList: [] -Number erased Elements (undef): 1 -Number erased Elements (undef): 1 -Number of Backtracking: 1 -RES: [] -0 AA: [] -1 Unifikation: [(M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Byte, 0), (L <. K, 1, -1), (P <. java.lang.Number, 1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (O <. java.lang.Double, 0), (P <. java.lang.Double, 1)] -1 UndefinedPairs; (L <. java.lang.Byte, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Byte, 0), (L <. K, 1, -1), (L =. java.lang.String, 1), (P <. L, 1, 1), (O =. java.lang.String, 0), (P =. java.lang.String, 1)] -1 UndefinedPairs; (L <. java.lang.Byte, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(O <. java.lang.Byte, 0), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Byte, 0), (L <. K, 1, -1), (P <. L, 1, 1), (P <. java.lang.Integer, 1)] -1 UndefinedPairs; (L <. java.lang.Byte, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Byte, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Float, 0), (P <. java.lang.Float, 1)] -1 UndefinedPairs; (L <. java.lang.Float, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Byte, 0), (L <. K, 1, -1), (P <. L, 1, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1)] -1 AA: [] -2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Integer <. java.lang.Byte, ), (N <. java.lang.Byte, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1)] -1 UndefinedPairs; (java.lang.Integer <. java.lang.Byte, ) -BasePair; (L <. java.lang.Byte, 1) -RES: [] -0 AA: [] -1 Unifikation: [(M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (N <. java.lang.Byte, 0), (O <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (P <. java.lang.Integer, 1)] -1 UndefinedPairs; (L <. java.lang.Byte, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(O <. java.lang.Long, 0), (P <. java.lang.Long, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (N <. java.lang.Double, 0), (L <. java.lang.Long, 1)] -nextSet: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] -1 AA: [] -2 Unifikation: [(O <. java.lang.Long, 0), (? extends java.lang.Long <. L, , 1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L <. K, 1, -1), (L <. java.lang.Double, 1), (N <. java.lang.Double, 0), (L <. java.lang.Long, 1), (P =. ? extends java.lang.Long, 1)] -1 UndefinedPairs; (L <. java.lang.Double, 1) -BasePair; null -abhSubst: [] -a: [(P =. ? extends java.lang.Long, 1)] -Durchschnitt: [] -nextSet: [[(P =. java.lang.Long, 1)], [(P =. ? extends java.lang.Long, 1)]] -nextSetasList: [] -Number erased Elements (undef): 1 -Number erased Elements (undef): 1 -Number of Backtracking: 1 -RES: [] -0 AA: [] -1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L <. java.lang.Double, 1), (P <. java.lang.Number, 1), (P <. L, 1, 1), (N <. java.lang.Double, 0), (O <. java.lang.Double, 0), (P <. java.lang.Double, 1)] -1 UndefinedPairs; (L <. java.lang.Double, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L <. java.lang.Double, 1), (L =. java.lang.String, 1), (P <. L, 1, 1), (N <. java.lang.Double, 0), (O =. java.lang.String, 0), (P =. java.lang.String, 1)] -1 UndefinedPairs; (L <. java.lang.Double, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(O <. java.lang.Byte, 0), (M =. java.lang.Boolean, 0), (L <. java.lang.Byte, 1), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (N <. java.lang.Double, 0), (P <. java.lang.Integer, 1)] -1 UndefinedPairs; (L <. java.lang.Byte, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Float, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (N <. java.lang.Double, 0), (O <. java.lang.Float, 0), (P <. java.lang.Float, 1)] -1 UndefinedPairs; (L <. java.lang.Float, 1) -BasePair; null -RES: [] -0 AA: [] -1 Unifikation: [(L <. java.lang.Integer, 1), (M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (L <. K, 1, -1), (L <. java.lang.Double, 1), (P <. L, 1, 1), (N <. java.lang.Double, 0), (O <. java.lang.Integer, 0), (P <. java.lang.Integer, 1)] -1 AA: [] -2 Unifikation: [(java.lang.Integer <. K, , -1), (M =. java.lang.Boolean, 0), (java.lang.Boolean <. java.lang.Boolean, ), (L =. java.lang.Integer, 1), (N <. java.lang.Double, 0), (O <. java.lang.Integer, 0), (java.lang.Integer <. java.lang.Double, ), (P <. java.lang.Integer, 1)] -1 UndefinedPairs; (java.lang.Integer <. java.lang.Double, ) -BasePair; (L <. java.lang.Double, 1) -RES: [] -0 AA: [] -1 Unifikation: [(M =. java.lang.Boolean, 0), (M <. java.lang.Boolean, 0), (O <. java.lang.Short, 0), (L <. K, 1, -1), (L <. java.lang.Double, 1), (L <. java.lang.Short, 1), (P <. L, 1, 1), (N <. java.lang.Double, 0), (P <. java.lang.Integer, 1)] -1 UndefinedPairs; (L <. java.lang.Double, 1) -BasePair; null -RES: [] From 34e632b872fb87f50d02e4a6b47b469d67f76528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Thu, 24 May 2018 14:11:04 +0200 Subject: [PATCH 7/8] modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java Reduce ausgetauscht bei ArgPara und Returntype modified: ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java isUndefinedPair korrigiert. modified: ../../test/bytecode/LambdaTest.java modified: ../../test/bytecode/javFiles/Plus.jav modified: ../../test/bytecode/javFiles/RelOps.jav --- src/de/dhbwstuttgart/core/JavaTXCompiler.java | 5 +++-- src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java | 4 ++-- src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java | 5 +++++ test/bytecode/LambdaTest.java | 2 +- test/bytecode/javFiles/Plus.jav | 2 +- test/bytecode/javFiles/RelOps.jav | 1 + 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/de/dhbwstuttgart/core/JavaTXCompiler.java b/src/de/dhbwstuttgart/core/JavaTXCompiler.java index 68bb2585..05edbaa1 100644 --- a/src/de/dhbwstuttgart/core/JavaTXCompiler.java +++ b/src/de/dhbwstuttgart/core/JavaTXCompiler.java @@ -121,8 +121,9 @@ public class JavaTXCompiler { System.out.println(xConsSet); Set paraTypeVarNames = allClasses.stream().map(x -> x.getMethods().stream().map(y -> y.getParameterList().getFormalparalist() .stream().filter(z -> z.getType() instanceof TypePlaceholder) - .map(z -> ((TypePlaceholder)z.getType()).getName()).collect(Collectors.toCollection(HashSet::new))).reduce((a,b) -> { a.addAll(b); return a;} ).get()) - .reduce((a,b) -> { a.addAll(b); return a;} ).get(); + .map(z -> ((TypePlaceholder)z.getType()).getName()).collect(Collectors.toCollection(HashSet::new))) + .reduce(new HashSet(), (a,b) -> { a.addAll(b); return a;}, (a,b) -> { a.addAll(b); return a;} ) ) + .reduce(new HashSet(), (a,b) -> { a.addAll(b); return a;} ); Set returnTypeVarNames = allClasses.stream().map(x -> x.getMethods().stream().filter(y -> y.getReturnType() instanceof TypePlaceholder) .map(z -> ((TypePlaceholder)z.getReturnType()).getName()).collect(Collectors.toCollection(HashSet::new))).reduce((a,b) -> { a.addAll(b); return a;} ).get(); diff --git a/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java b/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java index 4dad9de6..c15f65fc 100644 --- a/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java +++ b/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java @@ -217,7 +217,7 @@ public class TYPEStmt implements StatementVisitor{ binary.operation.equals(BinaryExpr.Operator.MUL)|| binary.operation.equals(BinaryExpr.Operator.MOD)|| binary.operation.equals(BinaryExpr.Operator.ADD)){ - Set numericAdditionOrStringConcatenation = new HashSet<>(); + Set> numericAdditionOrStringConcatenation = new HashSet<>(); //Zuerst der Fall für Numerische AusdrücPairOpnumericeratorke, das sind Mul, Mod und Div immer: //see: https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.17 @@ -273,7 +273,7 @@ public class TYPEStmt implements StatementVisitor{ binary.operation.equals(BinaryExpr.Operator.BIGGERTHAN) || binary.operation.equals(BinaryExpr.Operator.LESSTHAN)){ //eingefuegt PL 2018-05-24 - Set numericRelationConcatenation = new HashSet<>(); + Set> numericRelationConcatenation = new HashSet<>(); Constraint numeric = new Constraint<>(); numeric.add(new Pair(binary.lexpr.getType(), bytee, PairOperator.SMALLERDOT)); numeric.add(new Pair(binary.rexpr.getType(), bytee, PairOperator.SMALLERDOT)); diff --git a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 1d5ca564..d3448d49 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -586,8 +586,13 @@ public class TypeUnifyTask extends RecursiveTask>> { protected boolean isUndefinedPairSet(Set s) { + if (s.size() >= 1 ) { Boolean ret = s.stream().map(x -> x.isUndefinedPair()).reduce(true, (x,y)-> (x && y)); return ret; + } + else { + return false; + } } protected boolean isUndefinedPairSetSet(Set> s) { diff --git a/test/bytecode/LambdaTest.java b/test/bytecode/LambdaTest.java index 12e16829..f29690cb 100644 --- a/test/bytecode/LambdaTest.java +++ b/test/bytecode/LambdaTest.java @@ -13,7 +13,7 @@ public class LambdaTest { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Lambda2.jav"; + path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Lambda.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); compiler.generateBytecode(); diff --git a/test/bytecode/javFiles/Plus.jav b/test/bytecode/javFiles/Plus.jav index 86b4eb36..4d425bf0 100644 --- a/test/bytecode/javFiles/Plus.jav +++ b/test/bytecode/javFiles/Plus.jav @@ -1,4 +1,4 @@ -//import java.lang.Integer; +import java.lang.Integer; public class Plus { diff --git a/test/bytecode/javFiles/RelOps.jav b/test/bytecode/javFiles/RelOps.jav index d75ee2f3..0fdd2cff 100644 --- a/test/bytecode/javFiles/RelOps.jav +++ b/test/bytecode/javFiles/RelOps.jav @@ -1,4 +1,5 @@ import java.lang.Integer; +import java.lang.Boolean; public class RelOps { m(a,b){ From 65531ac12e41e868e747a72303baa1f79367dd81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Thu, 24 May 2018 16:20:57 +0200 Subject: [PATCH 8/8] =?UTF-8?q?=09modified:=20=20=20../../src/de/dhbwstutt?= =?UTF-8?q?gart/syntaxtree/factory/UnifyTypeFactory.java=20=09modified:=20?= =?UTF-8?q?=20=20../../src/de/dhbwstuttgart/typeinference/constraints/Pair?= =?UTF-8?q?.java=20=09modified:=20=20=20../../src/de/dhbwstuttgart/typeinf?= =?UTF-8?q?erence/typeAlgo/TYPEStmt.java=20=09modified:=20=20=20../../src/?= =?UTF-8?q?de/dhbwstuttgart/typeinference/unify/RuleSet.java=20=09modified?= =?UTF-8?q?:=20=20=20../../src/de/dhbwstuttgart/typeinference/unify/TypeUn?= =?UTF-8?q?ifyTask.java=20=09modified:=20=20=20../../src/de/dhbwstuttgart/?= =?UTF-8?q?typeinference/unify/model/PairOperator.java=20Einf=C3=BChrung?= =?UTF-8?q?=20eines=20neuen=20Operators=20SMALLERNEQDOT=20um=20Ungleichung?= =?UTF-8?q?en=20a=20> numericRelationConcatenation = new HashSet<>(); Constraint numeric = new Constraint<>(); numeric.add(new Pair(binary.lexpr.getType(), bytee, PairOperator.SMALLERDOT)); @@ -308,7 +308,13 @@ public class TYPEStmt implements StatementVisitor{ //***ACHTUNG: Moeglicherweise oder und und-Contraint falsch constraintsSet.addOderConstraint(numericRelationConcatenation); //***ACHTUNG: Moeglicherweise oder und und-Contraint falsch - + */ + //Testeise eingefuegt PL 2018-05-24 + constraintsSet.addUndConstraint(new Pair(binary.lexpr.getType(), number, PairOperator.SMALLERNEQDOT)); + constraintsSet.addUndConstraint(new Pair(binary.rexpr.getType(), number, PairOperator.SMALLERNEQDOT)); + //Rückgabetyp ist Boolean + constraintsSet.addUndConstraint(new Pair(bool, binary.getType(), PairOperator.SMALLERDOT)); + //auskommentiert PL 2018-05-24 //constraintsSet.addUndConstraint(new Pair(binary.lexpr.getType(), number, PairOperator.SMALLERDOT)); //constraintsSet.addUndConstraint(new Pair(binary.rexpr.getType(), number, PairOperator.SMALLERDOT)); diff --git a/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java b/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java index 5631724b..8c1c60ae 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java +++ b/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java @@ -369,9 +369,13 @@ public class RuleSet implements IRuleSet{ @Override public boolean erase1(UnifyPair pair, IFiniteClosure fc) { - if(pair.getPairOp() != PairOperator.SMALLERDOT) + if((pair.getPairOp() != PairOperator.SMALLERDOT) && (pair.getPairOp() != PairOperator.SMALLERNEQDOT)) return false; + if ((pair.getPairOp() == PairOperator.SMALLERNEQDOT) && (pair.getLhsType().equals(pair.getRhsType()))) { + return false; + } + UnifyType lhsType = pair.getLhsType(); if(!(lhsType instanceof ReferenceType) && !(lhsType instanceof PlaceholderType)) return false; diff --git a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index d3448d49..bd50d5de 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -794,10 +794,15 @@ public class TypeUnifyTask extends RecursiveTask>> { UnifyType rhsType = pair.getRhsType(); // Case 1: (a <. Theta') - if(pairOp == PairOperator.SMALLERDOT && lhsType instanceof PlaceholderType) { + if (((pairOp == PairOperator.SMALLERDOT) || (pairOp == PairOperator.SMALLERNEQDOT)) && lhsType instanceof PlaceholderType) { //System.out.println(pair); if (first) { //writeLog(pair.toString()+"\n"); Set> x1 = unifyCase1(pair, fc); + if (pairOp == PairOperator.SMALLERNEQDOT) { + Set remElem = new HashSet<>(); + remElem.add(pair.getRhsType()); + x1.remove(remElem); + } //System.out.println(x1); result.get(0).add(x1); if (x1.isEmpty()) { @@ -853,10 +858,15 @@ public class TypeUnifyTask extends RecursiveTask>> { // result.get(3).add(unifyCase4((PlaceholderType) lhsType, rhsType, fc)); // Case 5: (Theta <. a) - else if(pairOp == PairOperator.SMALLERDOT && rhsType instanceof PlaceholderType) + else if (((pairOp == PairOperator.SMALLERDOT) || (pairOp == PairOperator.SMALLERNEQDOT)) && rhsType instanceof PlaceholderType) if (first) { //writeLog(pair.toString()+"\n"); Set> x1 = unifyCase5(pair, fc); result.get(4).add(x1); + if (pairOp == PairOperator.SMALLERNEQDOT) { + Set remElem = new HashSet<>(); + remElem.add(pair.getLhsType()); + x1.remove(remElem); + } if (x1.isEmpty()) { undefined.add(pair); //Theta ist nicht im FC } diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/PairOperator.java b/src/de/dhbwstuttgart/typeinference/unify/model/PairOperator.java index fd18f6c0..ea323c79 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/PairOperator.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/PairOperator.java @@ -17,6 +17,12 @@ public enum PairOperator { */ SMALLERDOT, + /** + * The smallernedot operator for arguments (T / ... with the Supertype Number + */ + SMALLERNEQDOT, + /** * The smallerdot operator for arguments (T <.? P) is used to express that * T is an element of smArg(P) (or P is an element of grArg(T)) in a CONSTRAINT @@ -35,6 +41,7 @@ public enum PairOperator { switch (this) { case SMALLER: return "<"; case SMALLERDOT: return "<."; + case SMALLERNEQDOT: return "> { var k = 0; while(k < v1.size()) { erg = erg + v1.elementAt(k) * m.elementAt(k).elementAt(j); - //erg = add1(erg, mul1(v1.elementAt(k), - // m.elementAt(k).elementAt(j))); + //erg = add1(erg, mul1(v1.elementAt(k), + // m.elementAt(k).elementAt(j))); k++; } v2.addElement(new Integer(erg)); j++; }