_________________________________________________________________________

  Copyright (c) 1994 Mauro Gaspari  All Rights Reserved
_________________________________________________________________________


USERINFO (FW_RULES Version 1.1, sicstus2.1 #9): 
_________________________________________________________________________
SYNTAX:

RULE ::= LHS then RHS.
LHS  ::= WMel | not WMel | {WMel,Ref} | <Prolog goal> | LHS,LHS
RHS  ::= erase(Ref), assert(P) | retract(P) | <Prolog goal> | RHS,RHS
WMel ::= <Prolog fact>

A declaration of the name and arity of the facts which are on the WM must 
be inserted on the top of the file, as an example:

wm phys_object/7, monkey/3, goal/5, testcase/2, found/0.

{goal(active,on,floor,C,D),Goal},
{monkey(A,On,B),Monkey},
On \==floor
then
	print_jump_message,
	erase(Monkey),
	erase(Goal),
	assert(monkey(A,floor,B)),
	assert(goal(satisfied,on,floor,C,D)).
........

Module, use_module and other directives can be inserted on the top of the 
file.
_________________________________________________________________________
AVAILABLE PREDICATES:

run/0		Starts a recognize-act cycle which terminates when no 
		production are true.

run/1		run(P) starts a recognize-act cycle which terminates
		successfully when P is asserted on the WM; otherwise 
		it fails.

fw_init/0	Initialize the WM.

fw_compile/1	Compile a file of forward rules (.fw).
fw_compile/2	The second arg can be the atom: 'time' or 'debug'.

fw_consult/1	Consults a file of forward rules (.fw).
fw_consult/2	The second arg can be the atom: 'time' or 'debug'.

fw_assert/1	These predicates must be used from Prolog when
fw_asserta/1	asserting and retracting the WM facts.
fw_asserta/1
fw_assertz/1
fw_retract/1
	   
upd/1		Sets a bit (identified by an integer) of the WM bitmap.
del/1
fw_map/2	fw_map(Fact,N) gets the mapping number of Fact: the
		integer to be used in upd and del operations.
_________________________________________________________________________
HOW TO START FW_RULES:

?- compile(fw_rules).	Or

?- use_module(library('fw_rules/fw_rules')).  	If it is installed as a 
						sicstus library.

_________________________________________________________________________
SEE ALSO:
examples/mb.fw		(monkey and banana)
examples/diag.fw

_________________________________________________________________________
BUG REPORTS: 
gaspari@cs.unibo.it

_________________________________________________________________________
REFERENCES:
    M. Gaspari, "Extending Prolog with Data Driven Rules", In Proceedings 
    of  The  Sixth International  Conference Artificial  Intelligence and 
    Information-Control  Systems  of Robots,  World Scientific, September 
    12-16, 1994.
    Available also as a Technical Report UBLCS-94-2 from ftp.cs.unibo.it 
    pub/UBLCS/UBLCS-94-3.
