This is a "read me" file that describes usage of generalized algorithm for solving constraint hierarchies. A theoretical background of this sofisticated algorithm is described in: Bart‡k, R., Expert Systems Based on Constraints, Doctoral Dissertation, Dept. of Theoretical Computer Science, Charles University, January 1997 (summary available on-line at http://kti.ms.mff.cuni.cz/~bartak/) Bart‡k, R., A Generalized Algorithm for Solving Constraint Hierarchies, submitted to JFPLC«97, also available as TR 97/1, Dept. of Theoretical Computer Science, Charles University, January 1997 (available on-line at http://kti.ms.mff.cuni.cz/~bartak/) To use the algorithm you need following modules (consult them in this order): Graphs.pr (basic graph operations) GSP.pr (planning phase of the algorithm) InterArithmetics.pr (interval arithmetics) Executor.pr (executing phase of the algorithm). Constraint Planning First of all, you should construct a constraint network.This is called a planning phase and you need following modules for it: Graphs.pr and GSP.pr. Constraint is an arbitrary relation containing arbitrary functions. Atoms are assumed to be names of variables there (don«t use PROLOG variables in constraints). Example: 3*a+b>15 (3*A+B>15 is forbidden) There are special constraints called functional constraints. In the current implementation, only equalities are assumed to be functional constraints, but you can experiment with functional constraints by encapsulating constraint into the following form f(Constraint). It is also possible to change this view of functional constraints by adding facts is_functional (see GSP.pr file). You add so called labeled constraints into the network. Labeled constraint is C@L where C is a constraint and L is label. Label describes the preference of the constraint. The list of labels is user defined and you can change it by adding fact lab(Labels) into the database. Currently the following list of labels is used: lab([required,strong,prefer,weak,weakest]). Before adding constraints into network, clear the network by clear_graph command. Use add_cons(Constr@Lab) for adding a labeled constraint into network. Use show_graph to show the current network. Note that show_graph also lists all variables in the network with corresponding cells which determine them. Example: ?-clear_graph, ?-add_cons(x>=0@required),add_cons(x+y=<6@strong). ?-add_cons(y>=4@required),add_cons(2*x>=y@weak). ?-show_graph. I recommend to experiment with planning phase for a while. Executing phase Executing phase is much more experimental that the planning phase. Currently, it implements the interval arithmetics which is also used by Indigo algorithm. The constraint network has to contain only equality (=) and disequality (=<,>=) linear constraints with +,-,* operations. Example: 5*a+b=c, a+b>=c etc. (a*b=5 is forbidden) You start the executing phase by calling execute command.