/* ************************************************************
        module for basic transaction functions
************************************************************* */

:- op(450,fx,[ins,del]).

% basic strong insertion
%
ins(X) :- 
	call(X), !, fail
	;
	assert(X).

weakins(X) :-
	call(X), !, true
	;
	assert(X).

% basic strong delete
%
del(X) :- 
	retract(X).

% create a list of N unique and uninstantiated args
%
createpreds(0,[]).
createpreds(N,[_|L]) :-
	N>0, M is N-1, createpreds(M,L).

dbase(Pred) :-
        deleting(tr),
        call(Pred),
        inserting(tr).

