YAP 7.1.0
bootutils.yap
Go to the documentation of this file.
1/**
2 @file bootutils.yap
3 @short utilities
4
5 @addtogroup Internal_Database
6 */
7
8/** @pred recordaifnot(+ _K_, _T_,- _R_)
9
10
11If a term equal to _T_ up to variable renaming is stored under key
12 _K_ fail. Otherwise, make term _T_ the first record under key
13 _K_ and unify _R_ with its reference.
14
15
16*/
17recordaifnot(K,T,R) :-
18 recorded(K,T,R), % force non-det binding to R.
19 '$still_variant'(R,T),
20 '$still_variant',
21 '$still_variant'.
22recordaifnot(K,T,R) :-
23 recorda(K,T,R).
24
25/** @pred recordzifnot(+ _K_, _T_,- _R_)
26
27
28If a term equal to _T_ up to variable renaming is stored under key
29 _K_ fail. Otherwise, make term _T_ the first record under key
30 _K_ and unify _R_ with its reference.
31
32This predicate is YAP specific.
33
34
35*/
36recordzifnot(K,T,R) :-
37 recorded(K,T,R),
38 '$still_variant'(R,T),
39 '$still_variant',
40 '$still_variant'.
41recordzifnot(K,T,R) :-
42 recordz(K,T,R).
43
44
recordaifnot(+ K, T,- R)
recordzifnot(+ K, T,- R)
recordz(+ K, T,- R)