X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fedu%2Fberkeley%2Fsbp%2FForest.java;h=bc31117325f3142d700ed341cddeede0dfb4b7d2;hb=dd9286cb6cab28051289fbab244d4b6a19619886;hp=9dabf6064cfc4649667a5f700ce41d83e0b46292;hpb=eda544585c2304faa82d249c4744fd5cecbf9211;p=sbp.git diff --git a/src/edu/berkeley/sbp/Forest.java b/src/edu/berkeley/sbp/Forest.java index 9dabf60..bc31117 100644 --- a/src/edu/berkeley/sbp/Forest.java +++ b/src/edu/berkeley/sbp/Forest.java @@ -71,7 +71,7 @@ public abstract class Forest /*extends PrintableTree>*/ public GraphViz.Node toGraphViz(GraphViz gv) { if (gv.hasNode(this)) return gv.createNode(this); GraphViz.Node n = gv.createNode(this); - n.label = StringUtil.escapify(headToString()==null?"":headToString(), "\r\n"); + n.label = headToString()==null?"":headToString(); n.directed = true; n.comment = reduction==null?null:reduction+""; edges(n); @@ -159,6 +159,10 @@ public abstract class Forest /*extends PrintableTree>*/ * viewed, it becomes immutable */ static class Ref extends Forest { + public HashSet parents = new HashSet(); + public boolean contains(Forest f) { + return hp.contains(f); + } public boolean ambiguous() { if (hp.size()==0) return false; if (hp.size()==1) return hp.iterator().next().ambiguous();