Grammar filtering now also checks:
1) grammar containing unreachable rules are filtered out
2) grammar containing unproductive rules are filtered out
3) grammar containing cyclic and vertical ambiguity are filtered out