fixed State.contains()

State.contains() should only check if the mentions are the same
even if they aren't being produced by the same rule.