static long ai_hasTriple_vary_worstCase; static bool ai_hasTriple_vary(S a, S b, S c) { // TODO: optimize! L x = ai_variationsOf(a); L y = ai_variationsOf(b); L z = ai_variationsOf(c); int n = l(x)*l(y)*l(z); ai_hasTriple_vary_worstCase = max(ai_hasTriple_vary_worstCase, n); for (S xx : x) for (S yy : y) for (S zz : z) if (ai_hasTriple(xx, yy, zz)) true; false; }