static S cal_structure(CirclesAndLines cal) { ret cal_structure_impl(restructure(cal)); } static S cal_structure_impl(CirclesAndLines cal) { if (cal.arrowClass == Arrow) cal.arrowClass = null; if (cal.circleClass == Circle) cal.circleClass = null; for (Circle c : cal.circles) cal_structure_simplifyElement(c); for (Line l : cal.lines) cal_structure_simplifyElement(l); ret structure(cal); } static void cal_structure_simplifyElement(Base b) { if (eq(b.traits, ll(b.text))) b.traits = null; }