// executes things like "hasWord($x) => ..." sclass AI_ExecuteSimpleForWhere implements Steppable { // filled by user (necessary) ForWhere fw; DeepZipTools tools; // handle output swappable void addLogicRule(BasicLogicRule rule) {} // iterate values for function swappable Iterable elementsForFunction(S functionName) { null; } // internal variables O var; S functionName; Iterator elements; *() {} *(DeepZipTools *tools, IVF1 *addLogicRule, IF1 *elementsForFunction, ForWhere *fw) {} public bool step() { if (elements == null) { Pair p = forWhereParseSimpleFunctionCall(fw, tools); if (p == null) false; functionName = (S) p.b; var = p.a; elements = iterator(elementsForFunction(functionName)); } if (!elements.hasNext()) false; addLogicRule((BasicLogicRule) tools.replaceVars(fw.body, litmap(var, elements.next()))); true; } }