/******************************************************************************/
	OVERVIEW
/******************************************************************************/
Skilaki is an expert system shell, implemented in prolog which provides the
following features:
	* QUERY THE USER: Undefined predicates can result in a dialogue
	  with the user.
	* CONDITIONAL ANSWERS: Undefined predicates can be used to provide
	  conditional answers.
	* CONSTRUCTIVE NEGATION: Negation can result in binding of variables
	* PROOF TRACES: A proof trace may be built up to provide an explanation
	  for the success of a goal
	* WHY TRACES: A why proof trace may be built up to provide an
	  explanation as to why a question has been asked. Though we
	  support this facility, no tools are provided to display the trace.

CONSTRUCTIVE NEGATION
In skilaki `existential' variables can be used in constructive negation. These
are variables which apear not exclusively inside a negation. Thus while the
query
	Enter Query> \+ foo(X,Y).
is interpreted as
	forall X,Y \+ foo(X,Y)
the query
	Enter Query> \+ foo(X,Y), zoo(X).
is interpreted as
	forall Y thereExists X \+ foo(X,Y), zoo(X)

The system is implemented by means of a compiler and files to be compiled
are recognised by the '.sk' suffix. Declarations to drive the compiler (see
next section) should be placed in normal ('.pl') files.

Because of the limited nature of this report, the user is advised to examine
and run queries on the examples provided. The executable 'skilaki' will load
the examples and start a simple tty based interface. Recomended queries
include
	Enter Query> should_take(fred, Drug).		/* drugs.sk */
	Enter Query> likes(A, B).			/* chan.sk */
/******************************************************************************/
	USER DECLARATIONS FOR QUERY THE USER
/******************************************************************************/
The query the user interface (QTU) supports the following declarations
examples can be found in the file meta_decl.pl

*) template(-Goal, -GoalVars, -AtomList)
	This allows alternative templates to displayed when asking questions
	eg.
		template(has_age(X,Y),[Y],['What is',X,'''s age?']).
		The template will be used if by QTU if the only variable
		in the goal has_age(X,Y) is Y.
		All other variable instantiations which do not have a template
		will go through the default mechanism.
*) ask_limits(-Goal, -GoalVars, (Max,Min))
	This allows a maximum and minimum number of answers for any given
	goal to be specified.
	eg.
		ask_limits(has_age(_,Y), [Y], (1,1))
		This says that the goal has_age(A,B) with B being variable and
		A non var has one and only one answer.
		To specify any number of answers use '?'.
*) default_answer(-Goal, -GoalVars, -List)
	This allows a default answer to be suplied. A default answer is always
	written out when a value is requested.
	eg
		default_answer(complains_of(_,Y), [Y], [diarrhoea]).
		When the goal complains_of(A,B) is encountered with B being
		variable and A ground, the default answer is [diarrhoea]
*) suggested_answer(-Goal, -GoalVars, -List)
	This allows a default answer to be suplied. A suggested answer is
	only written out when requested
	eg
		suggested_answer(complains_of(_,Y), [Y], [pain]).
		When the goal complains_of(A,B) is encountered with B being
		variable and A ground, the suggested answer is [pain]
*) valid_answer(-Goal, -GoalVars)
	This allows validation of user answers. On failure of the validation,
	an explanation of the validation failure can be requested.
	eg
		valid_answer(has_age(_,Y), [Y]) :- integer(Y), Y > 0, Y < 150.

/******************************************************************************/
	 PROGRAMMER'S INTERFACE
/******************************************************************************/
The most useful top level calls are:

*) find_residue(+Goal,+Flags,-Quals,-Proof, +VN)
	This call is used to run a skilaki query.
		Goal	- prolog goal
		Flags	- a term of the form flags(IntF,QualF,LeashF)
			where IntF,QualF,LeashF are the flags contolling
			Interaction,Qualification,Leashing respectively. They
			should have the value on/off.
		Quals	- will be instantiated to the qualifications
		Proof	- will be instantiated to the proof
		VN	- the variable names in the goal: for example for the
			goal foo(X,Y,x(X)) should have
			VN = [X='X', Y='Y']

*) skilaki_consult(+File)
	This call is used to load a skilaki object file
		File	- the name of the (object) file to be compiled.

*) getCompilerOptions(+Names, -Values)
	This gets the compiler settings
		Names	- a list of valid compiler flag names
		Values	- will be instantiated to the toggle (on/off) values
			for Names.

	The default flags and values (see compilerDefaults)  are
		int=on,
		quals=on,
		proof=off,
		why=off,
		leash=off,
		reduce=on,
		redRes=off,
		redQual=off,
		redNeg=on,
		stubber=interactive,
		error_handler=on


*) setCompilerOptions(+Names, +Values)
	This allows changing the compiler
		Names	- a list of valid compiler flag names
			(see compilerDefaults)
		Values	- the toggle (on/off) values for Names.

*) invoke_unknown(+IntX, +QualX, +Pred, +Goal, -Quals, -Proof, +Why, +VN)
	This is invoked on unknown predicates (can be used directly)
		IntX	- Interaction flag (on/off)
		QualX	- Qualification flag (on/off)
		Pred	- primary functor of Goal
		Goal	- prolog goal
		Quals	- will be instantiated to the qualifications
		Proof	- will be instantiated to the proof
		Why	- why explanation
		VN	- the variable names in the goal
