;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%%% Search Space algorithm %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%%% %
;%%% Umberto Straccia %
;%%% http://faure.iei.pi.cnr.it/~straccia %
;%%% straccia@iei.pi.cnr.it %
;%%% %
;%%% October, 6th 1997 %
;%%% %
;%%% Version 0.0 %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


;; This is a TEMPLATE for a trivial search algorithm in a space of states.
;; Each state encodes a problem to be solved.
;; It starts with a set of states to be solved
;; and returns true if all of them can be solved.

;; In order to execute the hole procedure, you should define

1. The structure of a state
2. a function get-new-states:State-->2^S, which given the current state,
generates the next state to be analysed
3. a function closed-state:State-->{true,false}, which given a state say
whether it is closed (i.e. solved)
4. a function termination-case, which says whether the search should be
stopped
5. a function get-result, which returns the result of the search

All the templates, can be found in "state-solver-defs.lsp".

The algorithm returns:

;; (result lopen-states lclosed-states l-completed-states current-state lintermediate-states)
;; 1. result ; = true problem is solved
;; 2. lopen-states ; list of to be solved states
;; 3. lclosed-states ; list of solved states
;; 4. lcompleted-states ; list of completed states, but not solved
;; 5. current-state ; current state in which the search has been stopped
;; 6. lintermediate-states ; list of all other states processed

Files:
------
1. init.lsp ; loads all files
2. load-decider.lsp ; loads the search algorithm
3. exec-state-solver.lsp ; a template showing how to invoke the search algorihm
4. state-solver.lsp ; the main search algorithm
5. state-solver-defs.lps ; all templates and predefined functions

;;---------------------------------------------------------------------------

If you have questions or any other suggestions, don't hesitate to contact me.

straccia@iei.pi.cnr.it