From 14e00913e89e49288964f29ef46d8ccf6ce264a2 Mon Sep 17 00:00:00 2001 From: Florian Steurer Date: Tue, 22 Mar 2016 20:47:39 +0100 Subject: [PATCH] application of new rules --- .../typeinference/unify/interfaces/IRuleSet.java | 2 +- src/de/dhbwstuttgart/typeinference/unifynew/RuleSet.java | 2 +- src/de/dhbwstuttgart/typeinference/unifynew/Unify.java | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/de/dhbwstuttgart/typeinference/unify/interfaces/IRuleSet.java b/src/de/dhbwstuttgart/typeinference/unify/interfaces/IRuleSet.java index d86ebdd8..c4de888d 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/interfaces/IRuleSet.java +++ b/src/de/dhbwstuttgart/typeinference/unify/interfaces/IRuleSet.java @@ -20,7 +20,7 @@ public interface IRuleSet { public Optional reduceWildcardLowRight(MPair pair); public Optional reduceWildcardUp(MPair pair); public Optional reduceWildcardUpRight(MPair pair); - public Optional reduceWildCardLowUp(MPair pair); + public Optional reduceWildcardLowUp(MPair pair); public Optional reduceWildcardUpLow(MPair pair); public Optional reduceWildcardLeft(MPair pair); diff --git a/src/de/dhbwstuttgart/typeinference/unifynew/RuleSet.java b/src/de/dhbwstuttgart/typeinference/unifynew/RuleSet.java index 11138a47..52239af4 100644 --- a/src/de/dhbwstuttgart/typeinference/unifynew/RuleSet.java +++ b/src/de/dhbwstuttgart/typeinference/unifynew/RuleSet.java @@ -613,7 +613,7 @@ public class RuleSet implements IRuleSet{ } @Override - public Optional reduceWildCardLowUp(MPair pair) { + public Optional reduceWildcardLowUp(MPair pair) { if(pair.getPairOp() != PairOperator.SMALLERDOTWC) return Optional.empty(); diff --git a/src/de/dhbwstuttgart/typeinference/unifynew/Unify.java b/src/de/dhbwstuttgart/typeinference/unifynew/Unify.java index ae702fba..6e6fe376 100644 --- a/src/de/dhbwstuttgart/typeinference/unifynew/Unify.java +++ b/src/de/dhbwstuttgart/typeinference/unifynew/Unify.java @@ -178,6 +178,13 @@ public class Unify { Optional opt = rules.reduceUpLow(pair); opt = opt.isPresent() ? opt : rules.reduceLow(pair); opt = opt.isPresent() ? opt : rules.reduceUp(pair); + opt = opt.isPresent() ? opt : rules.reduceWildcardLow(pair); + opt = opt.isPresent() ? opt : rules.reduceWildcardLowRight(pair); + opt = opt.isPresent() ? opt : rules.reduceWildcardUp(pair); + opt = opt.isPresent() ? opt : rules.reduceWildcardUpRight(pair); + opt = opt.isPresent() ? opt : rules.reduceWildcardLowUp(pair); + opt = opt.isPresent() ? opt : rules.reduceWildcardUpLow(pair); + opt = opt.isPresent() ? opt : rules.reduceWildcardLeft(pair); // One of the rules has been applied if(opt.isPresent()) {