/* Boxes From PDF file of lecture on automatically defined functions (ADFs) and computational effort (parts of lecture No. 6 and 7) http://www.genetic-programming.com/c2003adfcompeffort.pdf page 3f Via http://www.genetic-programming.com/coursemainpage.html Where W0,L0,and H0 is the volume of box0 and W1,L1,and H1 is the volume of box1 Solution: D = W0*L0*H0 – W1*L1*H1 e.g. solutions as (L0 * (W0 * H0)) - (W1 * (L1 * H1)) [program = L0 * 1 * H0 * (1 * W0) - 1 * (H1 * (W1 * L1 * 1)),res = 0,count = 1] [program = 1 * H0 * (L0 * (W0 - (W0 - W0))) - W1 * (L1 * H1),res = 0,count = 1] [program = L0 * 1 * H0 * 1 * (1 - (1 * 1 - W0)) - W1 * (L1 * (H1 * 1)),res = 0,count = 1] [program = W0 * L0 * H0 - H1 * W1 * L1,res = 0,count = 1] [program = L0 * H0 * W0 - W1 * L1 * 1 * H1,res = 0,count = 1] Cf problem2.conf */ data(boxes,Data,Vars,Unknown,Ops,Constants,MaxSize,Params) :- Data = [ % L0 W0 H0 L1 W1 H1 D [[3, 4, 7, 2, 5,3], 54], [[7,10, 9,10, 3,1], 600], [[10,9, 4, 8, 1,6], 312], [[3, 9, 5, 1, 6,4], 111], [[4, 3, 2, 7, 6,1], -18], [[3, 3, 1, 9, 5,4], -171], [[5, 9, 9, 1, 7,6], 363], [[1, 2, 9, 3, 9,2], -36], [[2, 6, 8, 2, 6,10],-24], [[8, 1,10, 7, 5,1], 45] ], % Vars = ['A','B','C','D','E','F'], Vars = ['L0','W0','H0','L1','W1','H1'], Unknown = [1,1,1,1,1,1], Ops = [-,*], RandomInts = [random(-10,10) : _ in 1..10], Constants = 1..1,% ++ RandomInts, MaxSize = 11, Params = new_map().