def update_legal_actions(self, current_node):
        """
        Think differently depending on current nodetype (status). The function directly create children node and
        add them to the parent node
        Returns:

        """
        current_node_type = current_node.node_type

        # depending on type of current node, ask corresponding question
        if current_node_type is Node_Type.USER_QUESTION:
            # A1: Propose an one-step thought.
            if not current_node.disable_a1:
                self.do_action_generate_ost_step(current_node)

            # A2: Propose the remaining thought steps
            self.do_action_generate_direct_answers(current_node)

            # A3: Propose next sub-question along with its answer.
            self.do_action_generate_subquestions(current_node)

            # A5: Rephrase the question/sub-question.
            if not current_node.disable_a5:
                self.do_action_generate_rephrased_user_question(current_node)

        elif current_node_type is Node_Type.REPHRASED_USER_QUESTION:
            # A1: Propose an one-step thought.
            if not current_node.disable_a1:
                self.do_action_generate_ost_step(current_node)

            # A2: Propose the remaining thought steps
            self.do_action_generate_direct_answers(current_node)

            # A3: Propose next sub-question along with its answer.
            self.do_action_generate_subquestions(current_node)

        elif current_node_type is Node_Type.DIRECT_ANSWER:
            raise ValueError("DIRECT_ANSWER node cannot create children!!")

        elif current_node_type is Node_Type.SUBQUESTION:
            # A1: Propose an one-step thought.
            if not current_node.disable_a1:
                self.do_action_generate_ost_step(current_node)

            # A2: Propose the remaining thought steps
            self.do_action_generate_direct_answers(current_node)

            # A3: Propose next sub-question along with its answer.
            self.do_action_generate_subquestions(current_node)

            # A4: Answer the sub-question again.
            self.do_action_generate_re_subanswers(current_node)

        elif current_node_type is Node_Type.RE_SUBANSWER:
            # A1: Propose an one-step thought.
            if not current_node.disable_a1:
                self.do_action_generate_ost_step(current_node)

            # A2: Propose the remaining thought steps
            self.do_action_generate_direct_answers(current_node)

            # A3: Propose next sub-question along with its answer.
            self.do_action_generate_subquestions(current_node)

        elif current_node_type is Node_Type.OST_STEP:
            # A1: Propose an one-step thought.
            if not current_node.disable_a1:
                self.do_action_generate_ost_step(current_node)

            # A2: Propose the remaining thought steps
            self.do_action_generate_direct_answers(current_node)

        return current_node.children  # a list of children

        Think differently depending on current nodetype (status). The function directly create children node and
        add them to the parent node
        Returns:

        
envs/rstar/rstar_env.py