Recursive Depth-First Search

Function sss(s prev ops):

  1. If s is a goal, return '() as the answer. This is a list of no operators, since no operators are required to reach the goal state.

  2. If s is a failure, or no operators remain, return 'failure.

  3. If the next operator, op, is applicable to the input state s, compute new by applying it to s.
    1. If new duplicates one of its ancestor states on prev, try the next operator.

    2. If a search for the goal from the new state,
      (sss new (cons s prev) *ops*)
      succeeds, return the cons of op onto the front of its operator sequence, opseq.
      s &rarr new &rarr ... &rarr goal
               op opseq

    3. Else, try the next operator.
  4. Else, try the next operator.

Contents    Page-10    Prev    Next    Page+10    Index