22 '$assert'(
Clause, asserta,
_Ref).
36 '$assert'(
Clause, assertz,
_).
52 '$assert'(
Clause, assertz,
_).
54'$assert'(
Clause,
Where,
R)
:-
55 '$yap_strip_clause'(
Clause,
M,
MH,
H,
B),
59 '$compile'((
H :-MB),
Where, (
H :-MB),
MH,
R).
60'$assert'(
Clause,
Where,
R)
:-
61 '$expand_clause'(
Clause,
C,
C0),
62 '$$compile'(
C,
Where,
C0,
R).
74 '$assert'(
Clause, asserta,
Ref).
88assertz(
Clause,
Ref)
:-
89 '$assert'(
Clause, assertz,
Ref).
101assert(
Clause,
Ref)
:-
102 '$assert'(
Clause, assertz,
Ref).
105'$assertz_dynamic'(
X,
C,
C0,
Mod)
:-
108 '$head_and_body'(
C,
H,
B),
109 '$assertat_d'(assertz,
H,
B,
C0,
Mod,
_).
110'$assertz_dynamic'(
X,
C,
C0,
Mod)
:-
111 '$head_and_body'(
C,
H,
B),
113 (
'$check_if_reconsulted'(
N,
A)
->
114 '$check_if_reconsulted'
117 '$inform_as_reconsulted'(
N,
A),
118 '$remove_all_d_clauses'(
H,
Mod)
120 '$remove_all_d_clauses'
122 '$assertat_d'(assertz,
H,
B,
C0,
Mod,
_).
125'$remove_all_d_clauses'(
H,
M)
:-
126 '$is_multifile'(
H,
M),
'$is_multifile',
128 '$erase_all_mf_dynamic'(
Na,
A,
M).
129'$remove_all_d_clauses'(
H,
M)
:-
130 '$recordedp'(
M:H,
_,
R),
erase(
R),
erase.
131'$remove_all_d_clauses'(
_,
_).
133'$erase_all_mf_dynamic'(
Na,
A,
M)
:-
134 source_location(
F ,
_),
135 recorded(
'$multifile_dynamic'(
_,
_,
_),
'$mf'(
Na,
A,
M,
F,
R),
R1),
139'$erase_all_mf_dynamic'(
_,
_,
_).
141'$assertat_d'(asserta,
Head,
Body,
C0,
Mod,
R)
:- '$assertat_d',
142 '$compile_dynamic'((
Head:-Body), asserta,
C0,
Mod,
CR),
145 '$predicate_flags'(
Head,
Mod,
Fl,
Fl),
146 (
Fl /\ 0x20000000
=\= 0 -> '$check_multifile_pred'(
Head,
Mod,
Fl)
; '$check_multifile_pred' )
150 '$head_and_body'(
C0,
H0,
B0),
151 '$recordap'(
Mod:Head,(
H0 :- B0),
R,
CR),
152 (
'$is_multifile'(
Head,
Mod)
->
155 recorda(
'$multifile_dynamic'(
_,
_,
_),
'$mf'(
Na,
Ar,
Mod,
F,
R),
_)
159'$assertat_d'(assertz,
Head,
Body,
C0,
Mod,
R)
:-
160 '$compile_dynamic'((
Head:-Body), assertz,
C0,
Mod,
CR),
163 '$predicate_flags'(
Head,
Mod,
Fl,
Fl),
164 (
Fl /\ 0x20000000
=\= 0 -> '$check_multifile_pred'(
Head,
Mod,
Fl)
; '$check_multifile_pred' )
168 '$head_and_body'(
C0,
H0,
B0),
169 '$recordzp'(
Mod:Head,(
H0 :- B0),
R,
CR),
170 (
'$is_multifile'(
H0,
Mod)
->
171 source_location(
F,
_),
173 recordz(
'$multifile_dynamic'(
_,
_,
_),
'$mf'(
Na,
Ar,
Mod,
F,
R),
_)
189 strip_module(
C,
M,
C0),
190 '$check_head_and_body'(
M:C0,
M1,
H,
B,retract(
M:C)),
191 '$predicate_flags'(
H,
M1,
F,
F),
192 '$retract2'(
F,
H,
M1,
B,
_).
194'$retract2'(
F,
H,
M,
B,
R)
:-
195 F /\ 0'$retract2'
=:= 0'$retract2',
'$retract2',
198 '$log_update_clause'(
H,
M,
B,
R),
199 (
F /\ 0x20000000
=:= 0x20000000,
recorded(
'$mf',
'$mf_clause'(
_,
_,
_,
_,
R),
MR),
erase(
MR),
erase
; erase),
201'$retract2'(
F,
H,
M,
B,
R)
:-
203 F /\ 0'$retract2'
=:= 0'$retract2',
'$retract2',
204 '$recordedp'(
M:H,(
H:-B),
R),
205 (
F /\ 0x20000000
=:= 0x20000000,
recorded(
'$mf',
'$mf_clause'(
_,
_,
_,
_,
MRef),
MR),
erase(
MR),
erase(
MRef),
erase
; erase),
207'$retract2'(
_,
H,
M,
_,
_)
:-
208 '$undefined'(
H,
M),
'$undefined',
212'$retract2'(
_,
H,
M,
B,
_)
:-
214 \+ '$dynamic'(
Na/Ar,
M),
215 '$do_error'(permission_error(modify,static_procedure,
Na/Ar),retract(
M:(
H:-B))).
228 '$check_head_and_body'(
M0C,
M,
H,
B,retract(
M0C,
R)),
229 '$retract2'(
H,
M,
B,
R).
232 '$check_head_and_body'(
M0C,
M,
H,
B,retract(
M0C,
R)),
238 '$yap_strip_module'(
M0C,
M,
C),
239 '$fetch_predicate_indicator_from_clause'(
C,
M,
PI),
241 '$do_error'(permission_error(modify,static_procedure,
PI),retract(
M:C)).
243'$fetch_predicate_indicator_from_clause'((
C :- _),
M:Na/Ar)
:-
244'$fetch_predicate_indicator_from_clause',
245 '$yap_strip_module'(
C,
M,
C1),
247'$fetch_predicate_indicator_from_clause'(
C,
M:Na/Ar)
:-
248 '$yap_strip_module'(
C,
M,
C1),
260 '$yap_strip_module'(
MT,
M,
T),
264 '$is_log_updatable'(
T,
M)
->
265 (
'$is_multifile'(
T,
M)
->
266 '$retractall_lu_mf'(
T,
M,
Na,
Ar)
268 '$retractall_lu'(
T,
M)
272 '$dynamic'(
Na/Ar,
M),
'$dynamic'
274 '$is_dynamic'(
T,
M)
->
275 '$erase_all_clauses_for_dynamic'(
T,
M)
277 '$do_error'(permission_error(modify,static_procedure,
Na/Ar),retractall(
T))
280'$retractall_lu'(
T,
M)
:-
281 '$free_arguments'(
T),
'$free_arguments',
282 (
'$purge_clauses'(
T,
M),
'$purge_clauses'
; '$purge_clauses' ).
283'$retractall_lu'(
T,
M)
:-
284 '$log_update_clause'(
T,
M,
_,
R),
287'$retractall_lu'(
_,
_).
289'$retractall_lu_mf'(
T,
M,
Na,
Ar)
:-
290 '$log_update_clause'(
T,
M,
_,
R),
292 (
recorded(
'$mf',
'$mf_clause'(
_,
Na,
Ar,
M,
R),
MR),
erase(
MR),
erase
; erase),
295'$retractall_lu_mf'(
_,
_,
_,
_).
297'$erase_all_clauses_for_dynamic'(
T,
M)
:-
298 '$log_update_clause'(
T,
M,
_,
R),
300 (
recorded(
'$mf',
'$mf_clause'(
_,
Na,
Ar,
M,
R),
MR),
erase(
MR),
erase
; erase),
303'$erase_all_clauses_for_dynamic'(
_,
_).
307 '$is_multifile'(
T,
M),
309 recorded(
'$mf',
'$mf_clause'(
_,
Name,
Arity,
M,
Ref),
R),
314 recorded(
'$import',
'$import'(
_,
M,
_,
T,
_,
_),
R),
318 '$purge_clauses'(
T,
M),
'$purge_clauses'.
320 '$kill_dynamic'(
T,
M),
'$kill_dynamic'.
333dynamic_predicate(
P,
Sem)
:-
334 '$bad_if_is_semantics'(
Sem,
dynamic(
P,
Sem)).
335dynamic_predicate(
P,
Sem)
:-
337 (
Sem = logical
-> '$switch_log_upd'(
1)
; '$switch_log_upd'(
0) ),
338 '$current_module'(
M),
340 '$switch_log_upd'(
OldSem).
342'$bad_if_is_semantics'(
Sem,
Goal)
:-
344 '$do_error'(instantiation_error,
Goal).
345'$bad_if_is_semantics'(
Sem,
Goal)
:-
346 Sem \= '$bad_if_is_semantics',
Sem \= '$bad_if_is_semantics',
'$bad_if_is_semantics',
347 '$do_error'(domain_error(semantics_indicator,
Sem),
Goal).
must_be_callable( ?_Goal_ )
start input for a meta-clause