X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FGSS.java;h=d25593ffb592e393f0f3ce70e811671c23921c7f;hb=3473141880127c6aa52d094d51739e5eb67f1703;hp=7408eba088e290735c11aa6e29e6a00227eb8d0d;hpb=06d4d872050cac83ebd1a0abbf0e00d18ed3c44d;p=sbp.git diff --git a/src/edu/berkeley/sbp/GSS.java b/src/edu/berkeley/sbp/GSS.java index 7408eba..d25593f 100644 --- a/src/edu/berkeley/sbp/GSS.java +++ b/src/edu/berkeley/sbp/GSS.java @@ -16,9 +16,10 @@ class GSS { public int resets = 0; public int waits = 0; - HashMapBag inhibited = new HashMapBag(); - HashMapBag waiting = new HashMapBag(); - HashMapBag performed = new HashMapBag(); + HashMapBag inhibited = new HashMapBag(); + HashMapBag expectedInhibit = new HashMapBag(); + HashMapBag waiting = new HashMapBag(); + HashMapBag performed = new HashMapBag(); /** FIXME */ public Forest.Ref finalResult; @@ -63,6 +64,8 @@ class GSS { performed.clear(); hash = new IntPairMap(); singularReductions = new IntPairMap(); + expectedInhibit.clear(); + expectedInhibit.addAll(inhibited); good = false; closed = false; reducing = false; @@ -175,6 +178,7 @@ class GSS { throw new Reset(); } inhibited.add(p, seq); + expectedInhibit.remove(p, seq); } } @@ -196,6 +200,11 @@ class GSS { reducing_list[i] = null; n.performReductions(); } + if (expectedInhibit.size() > 0) { + inhibited.removeAll(expectedInhibit); + System.out.println("\n!!!!\n"); + throw new Reset(); + } } catch (Reset r) { reset(); reduce();