!7 sclass ThoughtSpaces { new L spaces; new L activeSpaces; void add(ThoughtSpace1 ts) { spaces.add(ts); activeSpaces.add(ts); } bool think() { ThoughtSpace1 ts = first(activeSpaces); if (ts == null) false; activeSpaces.remove(ts); ts.think(true); true; } } p-exp { new ThoughtSpace1 ts; ts.setInput("let's have a cup of Joe"); ts.add(Definition("let's have", "a grouping prefix")); ts.addStepper(ts1_applyGroupingPrefix()); ts.lookingFor.add(ProposeRewrite); new ThoughtSpaces spaces; spaces.add(ts); while (spaces.think()); }