From 7ff9554d7851d39b326bb57a0eec054e6bb80a7e Mon Sep 17 00:00:00 2001 From: Florian Steurer Date: Mon, 23 Nov 2015 00:15:12 +0100 Subject: [PATCH] application of adaptRules --- .../dhbwstuttgart/typeinference/unifynew/Unify.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/de/dhbwstuttgart/typeinference/unifynew/Unify.java b/src/de/dhbwstuttgart/typeinference/unifynew/Unify.java index cb8ff602f..480e9a5e7 100644 --- a/src/de/dhbwstuttgart/typeinference/unifynew/Unify.java +++ b/src/de/dhbwstuttgart/typeinference/unifynew/Unify.java @@ -148,7 +148,16 @@ public class Unify { continue; } - // TODO adapt Rules + // Adapt, AdaptExt, AdaptSup + opt = rules.adapt(pair); + opt = opt.isPresent() ? opt : rules.adaptExt(pair); + opt = opt.isPresent() ? opt : rules.adaptSup(pair); + + // One of the rules has been applied + if(opt.isPresent()) { + swapAddOrErase(opt.get(), rules, eqQueue); + continue; + } // None of the rules has been applied targetSet.add(pair);