/*
     "replace" interacts badly with this kind of
     built in.   maybe builtins should block any
     kind of access to the predicate -- they are
     in charge of it?

*/


% NOT WORKING
go.

/*
:- [rdelta].

load :-
	rdelta_execute((
			insert(1,2,3,0),
			insert(10,20,30,0)
		       )).

rdelta_provide(S, 'http://example.com/greaterThan', O, _G) :-
	ground(S),    % it might be nice to publish this stuff for checking
	ground(O),
	S > O.

rdelta_provide(S, 'http://example.com/doubled', O, _G) :-
	ground(S),
	var(O),
	O is S * 2.


g :-
	rdelta_execute(anchor((
			       match(_A,_B,C),
			       match(C,'http://example.com/greaterThan',10),
			       match(C,'http://example.com/doubled',D),
			       replace(C,D)
			      ),
			      0)).
	
go :-
	
	load,
	% listing(rdelta_internal),
	g,
	rdelta_internal(10,20,60,0),
	\+rdelta_internal(10,20,30,0).
	

*/