// returns comments static LS gazelle_proposeCalculationFunctions(S ruleText, ai_gazelle_analyzeStatementsForRule_Data data) { PairS rule = splitAtDoubleArrow_pair(ruleText); S var1 = firstIntAsString(rule.a), var2 = secondIntAsString(rule.a); S var3 = firstIntAsString(rule.b); if (var1 == null || var2 == null || var3 == null) ret emptyList(); LS functions = ai_numberCalculationFunctions(); for (SS map : listPlus(data.completeGoodMappings, null)) { if (empty(functions)) null; L numbers = ll(parseDouble(getOrKeep(map, var1)), parseDouble(getOrKeep(map, var2))); double result = parseDouble(getOrKeep(map, var3)); print("Checking map: " + map + " - " + numbers + " -> " + result); functions = filter(functions, func(S f) -> bool { ai_checkNumberCalculationFunction1(f, numbers, result) }); print("Remaining functions: " + functions); } ret ll(format("compute var " + quote(var3) + " from " + quote(var1) + " and " + quote(var2) + " using *", first(functions))); }