must be early for boot

This commit is contained in:
Vitor Santos Costa 2016-07-31 10:33:20 -05:00
parent 77335f2ea0
commit 5db8e25735
1 changed files with 36 additions and 0 deletions

36
pl/bootutils.yap Normal file
View File

@ -0,0 +1,36 @@
/** @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).