// e. g. // if (Y -> is the opposite of -> X) // and input (if something is not X, then it is...) // then say (Y!) static S ai_ifAndInput_v2(S rule, S input) { print("ai_ifAndInput_v2"); new Matches m; if (!simpleStarMatchOnCTokensIC("if * and input * then say *", javaTokDroppingBracketsC_unquote(rule), m)) unsuitableRule(); S d2 = $2; printStructs(+d2, +input); S x = matchBigX(d2, input); printStructs(+x); if (x == null) null; S pat = formatVars($1, litmap("X", x, "Y", "$X")); printStruct(+pat); T3 t = ai_tripelize(pat); printStruct(+t); S y = random(ai_texts(t)); if (y == null) null; ret ai_replaceBigY($3, y); }