/* Test of gcd without gcd/2 gen = 11599 (time: 1091.531s) results_best = [[1,if_then_else(1 + if_then_else(5,1,7) * a mod b,b,1)],[1,if_then_else(1 + if_then_else(5,1,7) * a mod b,b,1 != 2)],[1,if_then_else(1 + if_then_else(5,1,7) * a mod b,b,1 != 3)],[1,if_then_else(1 + if_then_else(5,1,7) * a mod b,b,1 != 4)],[1,if_then_else(1 + if_then_else(5,1,7) * a mod b,b,1 != 5)],[1,if_then_else(1 + if_then_else(5,1,7) * a mod b,b,1 != 6)],[1,if_then_else(1 + if_then_else(5,1,7) * a mod b,b,1 != 7)],[1,if_then_else(1 + if_then_else(5,1,7) * a mod b,b,1 != 8)],[1,if_then_else(1 + if_then_else(5,1,7) * a mod b,b,1 != 9)],[1,if_then_else(1 + if_then_else(5,1,7) * a mod b,b,8 != a)]] good = [] With loop: * stop_criteria=generations num_gens=1800 gen = 433 (time: 43.773s) results_best = [[1,sum_i(a * (8 != (10 + (b + 2 mod b) == b) mod (0 mod (b - if_then_else(0,a * 7,0)) - b)),a - b mod a)]] */ data(gcd_test2,Data,Vars,Unknown,Ops,Constants,MaxSize,Params) :- % Data = [[[I,J],T] : I in 1..5,J in 1..5, T = 1+gcd(I,J)], Data = [[[I,J],T] : I in 1..5,J in 1..5, T = gcd(I,J)], % Ops = [+,-,*,gcd], % Ops = [+,-,*,mod,rec], % rec is experimental and does not work Ops = [+,-,*,mod,sum_i,if_then_else,==,!=], % Ops = [+,-,*,/,div,mod,if_then_else,==,!=], Vars = ['a','b'], Constants = 0..10, Unknown = [10,5], MaxSize = 21, Params = new_map([ stop_criteria=generations, num_gens=1800 ]).