svoid dm_gazelle_matchStep_condition(GazelleTree t, O... _) { if (t.rule() == null) ret; bool debug = boolPar debug(_) || boolPar debugConditions(_); GRuleLine next = get(t.rule().insWithType, t.mr.iCond); if (debug) print("matchStep_condition: " + getString type(next)); if (next == null || !eq(next.type, "condition")) ret; bool satisfied = false; //S cond = next.text; S cond = t.mr.applyMappingTo(next); if (gazelle_isEmbeddedEval(cond)) { if (debug) print("Embedded eval: " + cond); satisfied = eqic(dm_processEmbeddedSafeEvals(cond), "true"); } else { GazelleEvalContext subCtx = cast callF(requiredPar contextMaker(_)); subCtx.engine.dropRulesWhere(r -> neq(r.purpose, "condition to eval")); L l = dm_gazelle_reasonAboutChatInput_v2(null, cond, paramsPlus(paramsMinus(_, 'acceptablePurposes), ctx := subCtx)); gazelle_processSafeEvalsInTree(l); if (debug) { print("Sub-Tree for condition " + cond + ":"); printIndentLines(l); } for (GazelleTree tree : l) if (eqic(tree.line, "true")) break with satisfied = true; else if (eqic(tree.line, "false")) break; } if (debug) print("satisfied=" + satisfied); if (!satisfied) ret; t.mr.iCond++; gazelle_addPredictionToTreeNode(t); t.mr.remainingConditions = dropFirst(t.mr.remainingConditions); t.mr.remainingConditionsWithType = dropFirst(t.mr.remainingConditionsWithType); }