// special adaptation of the one-max problem // must find maximal number of 1-terminals // optimal solution = 32, number of solutions 2^32 PROBLEM OneMaxBinary NONTERMINALS S<>. U<>. V<>. W<>. X<>. Y<>. T<>. TERMINALS A. B. RULES S<> = LOCAL << int n1, n2; >> U<> U<> SEM << n = n1 + n2; >> . U<> = LOCAL << int n1, n2; >> V<> V<> SEM << n = n1 + n2; >> . V<> = LOCAL << int n1, n2; >> W<> W<> SEM << n = n1 + n2; >> . W<> = LOCAL << int n1, n2; >> X<> X<> SEM << n = n1 + n2; >> . // 2^32 solutions X<> = LOCAL << int n1, n2; >> T<> T<> SEM << n = n1 + n2; >> . // uncomment for 2^64 solutions // X<> = LOCAL << int n1, n2; >> // Y<> Y<> SEM << n = n1 + n2; >> // . Y<> = LOCAL << int n1, n2; >> T<> T<> SEM << n = n1 + n2; >> . T<> = A SEM << n = 1; >> | B SEM << n = 0; >> . MAXIMIZE << int n; S(out n); return (double) n; >> END OneMaxBinary.