/* ******************************************************
	main module of Prototype 4 in Sicstus Prolog
******************************************************** */

install :-
        fcompile(basic_funs4),
        fcompile(naming4),
        fcompile(tr_basics4),
        fcompile(tr_appl4),
        fcompile(keys_basics4),
        fcompile(keys_appl4),
        fcompile(parser4),
        fcompile(query4),
        fcompile(upload4).


init :- 
	load(basic_funs4),
	load(naming4),
	load(tr_basics4),
	load(tr_appl4),
	load(keys_basics4),
	load(keys_appl4),
	load(parser4),
	load(query4),
	load(upload4),
	initparser,
	initkey, init_keyappl,
	dynpred(tracking), dynpred(tr),
	dynpred(track([])).


/* ***************************************************************** 
	Insert clause to transaction base
 ***************************************************************** */

instrans('<-'(Lhs,Rhs)) :-
	parse_body(Rhs,Passed,da),
	assert((Lhs :- (tr, Passed))).


instrans( Pred ) :-
	not(Pred = '<-'(_,_)),
	assert((Pred :- tr)).


