def _actions_since_last_query(taken_actions, simulated_actions):
      """Sequence of actions since last issued query."""
      if self.initial_stack and self.initial_stack[-1] == self.grammar.start():
        return simulated_actions
      actions = []
      for action in taken_actions[::-1]:
        actions.append(action)
        if self.grammar.productions()[action].lhs() == self.grammar.start():
          break
      return tuple(actions[::-1] + list(simulated_actions))
Sequence of actions since last issued query.
language/search_agents/muzero/state_tree.py