Files
scryer-prolog/tests/scryer/cli/issues/issue_3048.in/compare_get_assoc.pl
2025-08-17 14:50:15 +02:00

13 lines
325 B
Prolog

get_assoc(Key, t(K,V,_,L,R), Val) :-
compare(Rel, Key, K),
get_assoc(Rel, Key, V, L, R, Val).
get_assoc(=, _, Val, _, _, Val).
get_assoc(>, Key, _, _, Tree, Val) :- get_assoc(Key, Tree, Val).
test :- get_assoc("1"-'0', t("0"-'2',_, _, t(_,_,_,t,t), t("1"-'0',_,_,t,t)), _).
?- test.
false, unexpected.
true.