Semantic errors in the grammar can be trivial typos or the sign of a bad design of the FD structure. In any case check the following points:
(pprint (clean-fd (uni-fd input :grammar gr)))This is often instructive. Use the function top-gdp to explore this output FD in detail.