must be early for boot
This commit is contained in:
parent
77335f2ea0
commit
5db8e25735
36
pl/bootutils.yap
Normal file
36
pl/bootutils.yap
Normal 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).
|
||||||
|
|
Reference in New Issue
Block a user