/* This problem is from the Swedish blog post "Ã…rhundradets proffsproblem, sista delen!" by Mats Andersson http://www.mats-andersson.se/blogg/show.asp?svarsID=579 (I did solve this by hand a couple of years ago.) * With 1800 generations and stop_criteria=generations gen = 583 (time: 20.482s) results_best = [[7,(Y + (-3 - Z) * X) mod 10]] stop_criteria 'generations' reached gen = 275 (time: 12.668s) results_best = [[4,or(Y - -7 - Z,-7) * (and(Z,X) + X)]] stop_criteria 'generations' reached * With stop_criteria=at_least_one_solution Interrupted after 15minutes gen = 5086 (time: 210.272s) results_best = [[4,or(3 - (-4 + Z),Y) * (and(8,Z) + X)]] Cf number_puzzle3.conf */ import util. data(number_puzzle3,Data,Vars,Unknown,Ops,Constants,MaxSize,Params) :- Data = [ [[A,B,C],D] : [A,B,C,D] in chunks_of([ 8,0,0,6, 8,0,0,7, 8,0,6,9, 8,0,7,1, 8,6,7,9, 6,8,9,7 ],4)], Unknown = [8,0,0], Vars = ['X','Y','Z'], Ops = [+,-,*,/,mod,and,or,not], Constants = -10..10, MaxSize = 21, Params = new_map([ init_size=1000, num_gens=1800 % stop_criteria=generations ]).