/* From http://www.dtreg.com/gep.htm """ The output parity value should be 1 if there are an odd number of inputs with the value 1, and the output should be 0 if there are an even number of inputs with the value 1. """ This is XOR. maxCount = 1 code = (A ^ B) = [[[0,0],0],[[0,1],1],[[1,0],1],[[1,1],0]] = [[1,1] = 0] code = (B ^ A) = [[[0,0],0],[[0,1],1],[[1,0],1],[[1,1],0]] = [[1,1] = 0] Cf http://hakank.org/jgap/odd_parity2.conf */ data(odd_parity2,Data,Vars,Unknown,Ops,Constants,MaxC) :- Data = [ [[0,0],0], [[0,1],1], [[1,0],1], [[1,1],0] ], Unknown = [1,1], Vars = ["A","B"], Ops = new_map([infix=["+","-","*","/","mod","^"]]), % Ops = ["^"], Constants = 1..1, MaxC = 2.