- public Forest resolve() { return this; }
- public void expand(HashSet<Tree<T>> ht, HashSet<Forest<T>> ignore, Tree<T> bogus) {
- if (ignore.contains(this)) { ht.add(bogus); return; }
- for (Forest<T> f : hp) f.expand(ht, ignore, bogus);
+ private void touched() {
+ if (touched) return;
+ touched = true;
+ /*
+ FastSet<Forest<T>> f2 = new FastSet<Forest<T>>();
+ for(Forest f : hp)
+ if (f instanceof Forest.One) f2.add(f);
+ else for(Forest ff : ((Forest.Many<T>)f))
+ f2.add(ff);
+ hp = f2;
+ */
+ }
+ public boolean contains(Forest f) {
+ touched();
+ return hp.contains(f);