Ensure semantic checking can handle large numbers of clauses
Merge pull request #1787 from cleishm/semantic_check_optimization

Ensure semantic checking can handle large numbers of clauses