application of new rules

This commit is contained in:
Florian Steurer 2016-03-22 20:47:39 +01:00
parent 0e524caae7
commit 14e00913e8
3 changed files with 9 additions and 2 deletions

View File

@ -20,7 +20,7 @@ public interface IRuleSet {
public Optional<MPair> reduceWildcardLowRight(MPair pair);
public Optional<MPair> reduceWildcardUp(MPair pair);
public Optional<MPair> reduceWildcardUpRight(MPair pair);
public Optional<MPair> reduceWildCardLowUp(MPair pair);
public Optional<MPair> reduceWildcardLowUp(MPair pair);
public Optional<MPair> reduceWildcardUpLow(MPair pair);
public Optional<MPair> reduceWildcardLeft(MPair pair);

View File

@ -613,7 +613,7 @@ public class RuleSet implements IRuleSet{
}
@Override
public Optional<MPair> reduceWildCardLowUp(MPair pair) {
public Optional<MPair> reduceWildcardLowUp(MPair pair) {
if(pair.getPairOp() != PairOperator.SMALLERDOTWC)
return Optional.empty();

View File

@ -178,6 +178,13 @@ public class Unify {
Optional<MPair> 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()) {