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