// 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) { new Matches m; if (!simpleStarMatchOnCTokensIC("if * and input * then say *", javaTokDroppingBracketsC_unquote(rule), m)) unsuitableRule(); SS map = matchDollarVarsIC(ai_bigXToDollarX($2), input); printStructs("$2", $2, +input, +map); if (map == null) null; S pat = formatVars($1, mapPlus(map, "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); }