nction  <code>applyCheck</code> takes the current state (where we are accumulating rule violations),
a label that identifies this rule (so that violations of it can be stored together),
the node,
and a logical value telling it whether the node passed the test or not.
If the node failed the test
we make sure that <code>state</code> contains a list with the appropriate label
and then append this node to it.
This &ldquo;create storage space on demand&rdquo; pattern
is widely used but doesn&rsquo;t have a well-