:- [rdelta].

go :-
	rdelta_open(temp(_X), DB, []),
	rdelta_update(DB, (insert(1,2,3,0))),
	rdelta_query(DB,  (match(_A,_B,_C,_D))),
	% format('got: ~q ~q ~q ~q  (db=~q)', [_A,_B,_C,_D,X]),
	G0 = (   insert(1,2,3),
		 insert(1,2,4),
		 insert(1,2,5)),
	rdelta_update(DB, anchor(G0, 9)),
	Patch=(delete(1, 2, 5), insert(1, 2, 6)),
	rdelta_update(DB, anchor(Patch, 9)),
	( 
	  rdelta_query(DB,  (match(_A1,_B1,_C1,9))),
	  % format('xxgot: ~q ~q ~q~n', [_A1,_B1,_C1]),
	  fail
	; true
	),
	rdelta_close(DB).


