/* File:      trie_assert_attv.P
** Author(s): Baoqiu Cui
**
** $Id: trie_assert_attv.P,v 1.2 2004-11-17 21:43:37 tswift Exp $
*/

:- import put_attr/3, get_attr/3 from machine.

:- index(p/2, trie).

test :-
	put_attr(X, ta, v(1)),
	assert(p(X,X)),
	fail.
test :-
	p(X,Y),
	get_attr(X, ta, VX),
	nonvar(VX), VX = v(1), writeln(VX),
	% update the attribute of X (== Y)
	put_attr(X, ta, v(11)),
	get_attr(Y, ta,  VY),
	nonvar(VY), VY = v(11), writeln(VY),
	writeln('Passed trie_assert_attv!').
