This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/pl/bootutils.yap

46 lines
907 B
Plaintext
Raw Normal View History

2017-10-27 13:50:40 +01:00
/**
2018-04-27 13:01:08 +01:00
@file bootutils.yap
2017-10-27 13:50:40 +01:00
@short utilities
@addtogroup Internal_Database
2018-06-05 11:20:39 +01:00
@{
2017-10-27 13:50:40 +01:00
*/
2016-07-31 16:33:20 +01:00
/** @pred recordaifnot(+ _K_, _T_,- _R_)
If a term equal to _T_ up to variable renaming is stored under key
_K_ fail. Otherwise, make term _T_ the first record under key
_K_ and unify _R_ with its reference.
*/
recordaifnot(K,T,R) :-
recorded(K,T,R), % force non-det binding to R.
'$still_variant'(R,T),
!,
fail.
recordaifnot(K,T,R) :-
recorda(K,T,R).
/** @pred recordzifnot(+ _K_, _T_,- _R_)
If a term equal to _T_ up to variable renaming is stored under key
_K_ fail. Otherwise, make term _T_ the first record under key
_K_ and unify _R_ with its reference.
This predicate is YAP specific.
*/
recordzifnot(K,T,R) :-
recorded(K,T,R),
'$still_variant'(R,T),
!,
fail.
recordzifnot(K,T,R) :-
recordz(K,T,R).
2018-06-05 11:20:39 +01:00
%% @}