code: def _check_state_denotations(self, state: GrammarBasedState, worlds: List[NlvrLanguage]) -> List[bool]:
          
          assert state.is_finished(), "Cannot compute denotations for unfinished states!"
          # Since this is a finished state, its group size must be 1.
          batch_index = state.batch_indices[0]
          instance_label_strings = state.extras[batch_index]
          history = state.action_history[0]
          all_actions = state.possible_actions[0]
          action_sequence = [all_actions[action][0] for action in history]
          return self._check_denotation(action_sequence, instance_label_strings, worlds)
docs: Returns whether action history in the state evaluates to the correct denotations over all
          worlds. Only defined when the state is finished.