General tree search

Function tree search takes a problem and a fringe as parameters and returns a solution or a failure. In the function we take the initial state of the problem and the fringe to make a node that we then insert into the fringe. We then enter a do loop where if the fringe is empty we return a failure. we remove front of the fringe from the node. We goal test the problem with the state of our node and return the solution if the current state is the solution. Finally, if we haven't returned yet, we expand the node with the given problem and insert all these nodes into our fringe. Now we need to talk about expanding a node in a problem which returns a set of nodes. Initially, we define an empty set we call successors. For each action and result pair in the successor function of the current node, we insert a new node such that our current node is the parent node and we assign a path cost to the new node as the path cost of the current node and the step cost of the new node with the action. We set the depth of the new node as one more than the depth of the current node and add this new node to the set of successor nodes. We then return this set.