Simplify grammar; add predicate implementation