sbool printConceptGraph_showIDs; static void printConceptGraph(Concept c) { printConceptGraph_impl(c, 0, "", new IdentityHashMap); } static void printConceptGraph_impl(Concept c, int indent, S prefix, IdentityHashMap seen) { bool isSeen = seen.containsKey(c); seen.put(c, c); StringBuilder buf = new StringBuilder; buf.append(prefix); S cname = dynamicShortName(c); if (eq(cname, "Str")) buf.append("Str " + quote(cget(c, "name"))); else { buf.append(cname); if (printConceptGraph_showIDs) buf.append(" [" + c.id + (isSeen ? ", seen" : "") + "]"); else if (isSeen) buf.append(" [seen]"); for (S field : conceptFields(c)) { O val = cget(c, field); if (val != null && !val instanceof Concept) buf.append(" " + field + "=" + struct(val)); } } printIndent(indent, buf); if (isSeen) ret; L names = dynGetRefNames(c); for (S name : names) { Concept val = cast cget(c, name); if (eq(name, "_if")) name = "if"; // prettify printConceptGraph_impl(val, indent + 2, l(names) == 1 ? "" : name + "=", seen); } }