!7 cmodule TrailsTree { switchable S solverModule; transient O root; transient JTree tree; transient SingleComponentPanel scp; visual scp = singleComponentPanel(makeTree()); JTree makeTree() { ret tree = jDynamicTree(root, lambda1 getChildren); } L getChildren(O o) { print("getChildren " + o); /*if (isShortNamed LogicRule(o)) { o = getOpt trail(o); if (o cast S) ret ll(o); }*/ if (o instanceof Pair) { O b = o/Pair.b; print('shortName, shortName(b)); if (isShortNamed LogicRule(b)) { O trail = get trail(b); print(+trail); ret getChildren(trail); } o = b; } if (o cast Map) ret mapToPairs(o); if (o cast L) ret o; null; } start { if (empty(solverModule)) setField(solverModule := (S) vmBus_query winogradSolver()); virtual PhilosophyBot1 engine = dm_rget engine(solverModule); L logicRules = cloneList((Cl) rget logicRules(engine)); Map logicRuleIndex = indexByField n(logicRules); L> trails = shallowImportAll((Iterable) rcall deducedFactsWithTrails(engine)); setField(root := concatLists( map(logicRules, lambda1 ruleToNode), map withTrailToPair(trails))); } O ruleToNode(virtual LogicRule rule) { ret pair(rule, get trail(rule)); } }