72 '$current_predicate'/4,
77 '$unknown_warning'/1]).
79:-
'$check_head_and_body'/4
'$check_if_reconsulted'/2
'$head_and_body'/3
'$inform_as_reconsulted'/2
use_system_module(
'$_boot', [,
84:-
'$do_error'/2
use_system_module(
'$_errors', []).
86:-
'$do_log_upd_clause'/6
'$do_log_upd_clause0'/6
'$do_log_upd_clause_erase'/6
'$do_static_clause'/5
use_system_module(
'$_init', [,
91:-
'$imported_pred'/4
'$meta_predicate'/4
'$module_expansion'/5
use_system_module(
'$_modules', [,
95:-
'$check_multifile_pred'/3
'$dynamic'/2
use_system_module(
'$_preddecls', [,
98:-
'$check_iso_strict_clause'/1
use_system_module(
'$_strict_iso', []).
112 strip_module(
MC,
M,
C),
113 '$compile'(
C , assertz_static,
C,
M,
_ ).
123 strip_module(
MC,
M,
C),
124 '$compile'(
C , asserta_static,
C,
M,
_ ).
144 strip_module(
MC,
M,
C),
145 '$compile'(
C , assertz_static,
C,
M,
_ ).
161 '$yap_strip_module'(
V0,
M,
V),
162 must_be_of_type( callable,
V ),
163 '$predicate_type'(
V,
M,
Type),
164 '$clause'(
Type,
V,
M,
Q,
_R).
174 '$instance_module'(
R,
M0),
'$instance_module',
176 (
T0 = (
H :- B)
-> Q = B ; H=T0,
Q = true),
177 '$yap_strip_module'(
P,
M,
T),
178 '$yap_strip_module'(
M0:H,
M1,
H1),
187 '$yap_strip_module'(
V0,
M,
V),
188 '$follow_import_chain'(
M,
V,
ExportingMod,
V0),
189 must_be_of_type( callable,
V0 ),
190 '$predicate_type'(
V0,
ExportingMod,
Type),
191 '$clause'(
Type,
V0,
ExportingMod,
Q,
R).
193'$clause'(exo_procedure,
P,
M,
_Q,exo(
P))
:-
195'$clause'(mega_procedure,
P,
M,
_Q,mega(
P))
:-
197'$clause'(updatable_procedure,
P,
M,
Q,
R)
:-
198 '$log_update_clause'(
P,
M,
Q,
R).
199'$clause'(source_procedure,
P,
M,
Q,
R)
:-
200 '$static_clause'(
P,
M,
Q,
R).
201'$clause'(dynamic_procedure,
P,
M,
Q,
R)
:-
202 '$some_recordedp'(
M:P),
'$some_recordedp',
203 '$recordedp'(
M:P,(
P:-Q),
R).
204'$clause'(system_procedure,
P,
M,
Q,
R)
:-
205 \+ '$undefined'(
P,
M),
207 '$do_error'(permission_error(access,private_procedure,
Name/Arity),
209'$clause'(private_procedure,
P,
M,
Q,
R)
:-
211 '$do_error'(permission_error(access,private_procedure,
Name/Arity),
213'$clause'(static_procedure,
P,
M,
Q,
R)
:-
215 '$do_error'(permission_error(access,private_procedure,
Name/Arity),
217'$clause'(undefined,
P,
M,
Q,
R)
:-
219 '$do_error'(permission_error(access,private_procedure,
Name/Arity),
223 once(
'$do_static_clause'(
_,
_,
_,
_,
_)),
226 once(
'$do_log_upd_clause0'(
_,
_,
_,
_,
_,
_)),
229 once(
'$do_log_upd_clause'(
_,
_,
_,
_,
_,
_)),
232 once(
'$do_log_upd_clause_erase'(
_,
_,
_,
_,
_,
_)),
250 strip_module(
V,
M1,
P),
strip_module,
251 '$follow_import_chain'(
M1,
P,
M2,
P2),
252 '$nth_clause'(
P2,
M2,
I,
R).
255'$nth_clause'(
P,
M,
I,
R)
:-
257 '$clause'(
_,
P,
M,
_,
R),
258 '$fetch_nth_clause'(
P,
M,
I,
R).
259'$nth_clause'(
P,
M,
I,
R)
:-
260 '$fetch_nth_clause'(
P,
M,
I,
R).
270 strip_module(
N0,
Mod,
N),
strip_module,
273'$abolish'(
N,
A,
M)
:- var(
N),
var,
274 '$do_error'(instantiation_error,abolish(
M:N,
A)).
275'$abolish'(
N,
A,
M)
:- var(
A),
var,
276 '$do_error'(instantiation_error,abolish(
M:N,
A)).
278 (
recorded(
'$predicate_defs',
'$predicate_defs'(
N,
A,
M,
_),
R)
-> erase(
R) ),
280'$abolish'(
N,
A,
M)
:- functor(
T,
N,
A),
281 (
'$is_dynamic'(
T,
M)
-> '$abolishd'(
T,
M)
;
297 strip_module(
X0,
M,
X),
306'$new_abolish'(
V,
M)
:- var(
V),
var,
307 '$do_error'(instantiation_error,abolish(
M:V)).
308'$new_abolish'(
A/V,
M)
:- atom(
A),
var(
V),
var,
309 '$do_error'(instantiation_error,abolish(
M:A/V)).
310'$new_abolish'(
Na//Ar1,
M)
:-
314 '$new_abolish'(
Na//Ar,
M).
315'$new_abolish'(
Na/Ar,
M)
:-
317 '$is_dynamic'(
H,
M),
'$is_dynamic',
319'$new_abolish'(
Na/Ar,
M)
:-
321 '$undefined'(
T,
M),
'$undefined'.
322'$new_abolish'(
Na/Ar,
M)
:-
323 '$do_error'(permission_error(modify,static_procedure,
Na/Ar),abolish(
M:Na/Ar)).
324'$new_abolish'(
T,
M)
:-
325 '$do_error'(type_error(predicate_indicator,
T),abolish(
M:T)).
328 '$current_predicate'(
Na,
M,
S,
_),
330 '$new_abolish'(
Na/Ar,
M),
334'$abolish_all_atoms'(
Na,
M)
:-
335 '$current_predicate'(
Na,
M,
S,
_),
337 '$new_abolish'(
Na/Ar,
M),
339'$abolish_all_atoms'(
_,
_).
341'$check_error_in_predicate_indicator'(
V,
Msg)
:-
343 '$do_error'(instantiation_error,
Msg).
344'$check_error_in_predicate_indicator'(
M:S,
Msg)
:- '$check_error_in_predicate_indicator',
345 '$check_error_in_module'(
M,
Msg),
346 '$check_error_in_predicate_indicator'(
S,
Msg).
347'$check_error_in_predicate_indicator'(
S,
Msg)
:-
349 S \= _//_,
'$check_error_in_predicate_indicator',
350 '$do_error'(type_error(predicate_indicator,
S),
Msg).
351'$check_error_in_predicate_indicator'(
Na/_,
Msg)
:-
353 '$do_error'(instantiation_error,
Msg).
354'$check_error_in_predicate_indicator'(
Na/_,
Msg)
:-
356 '$do_error'(type_error(atom,
Na),
Msg).
357'$check_error_in_predicate_indicator'(
_/Ar,
Msg)
:-
359 '$do_error'(instantiation_error,
Msg).
360'$check_error_in_predicate_indicator'(
_/Ar,
Msg)
:-
362 '$do_error'(type_error(integer,
Ar),
Msg).
363'$check_error_in_predicate_indicator'(
_/Ar,
Msg)
:-
364 Ar < 0,
'$check_error_in_predicate_indicator',
365 '$do_error'(domain_error(not_less_than_zero,
Ar),
Msg).
371'$check_error_in_module'(
M,
Msg)
:-
373 '$do_error'(instantiation_error,
Msg).
374'$check_error_in_module'(
M,
Msg)
:-
376 '$do_error'(type_error(atom,
M),
Msg).
378'$old_abolish'(
V,
M)
:- var(
V),
var,
380 '$do_error'(instantiation_error,abolish(
M:V))
382 '$abolish_all_old'(
M)
384'$old_abolish'(
N/A,
M)
:- '$old_abolish',
386'$old_abolish'(
A,
M)
:- atom(
A),
atom,
388 '$do_error'(type_error(predicate_indicator,
A),abolish(
M:A))
390 '$abolish_all_atoms_old'(
A,
M)
392'$old_abolish'([],
_)
:- '$old_abolish'.
393'$old_abolish'([
H|T],
M)
:- '$old_abolish',
'$old_abolish'(
H,
M),
'$old_abolish'(
T,
M).
394'$old_abolish'(
T,
M)
:-
395 '$do_error'(type_error(predicate_indicator,
T),abolish(
M:T)).
397'$abolish_all_old'(
M)
:-
398 '$current_predicate'(
Na,
M,
S,
_),
400 '$abolish'(
Na,
Ar,
M),
402'$abolish_all_old'(
_).
404'$abolish_all_atoms_old'(
Na,
M)
:-
405 '$current_predicate'(
Na,
M,
S,
_),
407 '$abolish'(
Na,
Ar,
M),
409'$abolish_all_atoms_old'(
_,
_).
411'$abolishs'(
G,
M)
:- '$system_predicate'(
G,
M),
'$system_predicate',
413 '$do_error'(permission_error(modify,static_procedure,
Name/Arity),abolish(
M:G)).
414'$abolishs'(
G,
Module)
:-
416 '$undefined'(
G,
Module),
420 '$is_multifile'(
G,
M),
422 recorded(
'$mf',
'$mf_clause'(
_,
Name,
Arity,
M,
_Ref),
R),
427 recorded(
'$import',
'$import'(
_,
M,
_,
T,
_,
_),
R),
428 '$purge_clauses'(
T,
M),
432 '$purge_clauses'(
G,
M),
'$purge_clauses'.
441 strip_module(
P0,
M,
P),
442 '$stash_predicate2'(
P,
M).
444'$stash_predicate2'(
V,
M)
:- var(
V),
var,
445 '$do_error'(instantiation_error,stash_predicate(
M:V)).
446'$stash_predicate2'(
N/A,
M)
:- '$stash_predicate2',
448 '$stash_predicate'(
S,
M) .
449'$stash_predicate2'(
PredDesc,
M)
:-
450 '$do_error'(type_error(predicate_indicator,
PredDesc),stash_predicate(
M:PredDesc)).
504 strip_module(
Pred,
Mod,
TruePred),
506 '$predicate_property2'(
TruePred,
Prop0,
Mod),
509'$predicate_property2'(
Pred,
Prop,
Mod)
:-
511 '$all_current_modules'(
Mod),
512 '$predicate_property2'(
Pred,
Prop,
Mod).
513'$predicate_property2'(
Pred,
Prop,
M0)
:-
516 M0 \= prolog,
M = prolog
;
517 M0 \= user,
M = user),
518 '$generate_all_preds_from_mod'(
Pred,
SourceMod,
M),
519 '$predicate_property'(
Pred,
SourceMod,
M,
Prop).
520'$predicate_property2'(
M:Pred,
Prop,
_)
:- '$predicate_property2',
521 '$predicate_property2'(
Pred,
Prop,
M).
522'$predicate_property2'(
Pred,
Prop,
Mod)
:-
523 '$pred_exists'(
Pred,
Mod),
'$pred_exists',
524 '$predicate_property'(
Pred,
Mod,
Mod,
Prop).
525'$predicate_property2'(
Pred,
Prop,
Mod)
:-
526 '$import_chain'(
Mod,
Pred,
M,
NPred),
529 Prop = imported_from(
M)
531 '$predicate_property'(
NPred,
M,
Mod,
Prop),
532 Prop \= '$predicate_property'
535'$generate_all_preds_from_mod'(
Pred,
M,
M)
:-
536 '$current_predicate'(
_Na,
M,
Pred,
_).
538'$predicate_property'(
P,
M,
_,built_in)
:-
539 '$is_system_predicate'(
P,
M).
540'$predicate_property'(
P,
M,
_,source)
:-
541 '$predicate_flags'(
P,
M,
F,
F),
542 F /\ 0'$predicate_flags'
=\= 0.
543'$predicate_property'(
P,
M,
_,tabled)
:-
544 '$predicate_flags'(
P,
M,
F,
F),
545 F /\ 0'$predicate_flags'
=\= 0.
546'$predicate_property'(
P,
M,
_,
dynamic)
:-
548'$predicate_property'(
P,
M,
_,static)
:-
549 \+ '$is_dynamic'(
P,
M),
550 \+ '$undefined'(
P,
M).
551'$predicate_property'(
P,
M,
_,
meta_predicate(
Q))
:-
554 (
recorded(
'$m',
meta_predicate(
M,
Q),
_)
;recorded(
'$m',
meta_predicate(prolog,
Q),
_)).
556'$predicate_property'(
P,
M,
_,
multifile)
:-
557 '$is_multifile'(
P,
M).
558'$predicate_property'(
P,
M,
_,
public)
:-
560'$predicate_property'(
P,
M,
_,
thread_local)
:-
561 '$is_thread_local'(
P,
M).
562'$predicate_property'(
P,
M,
M,exported)
:-
564 once(recorded(
'$module',
'$module'(
_TFN,
M,
_S,
Publics,
_L),
_)),
566'$predicate_property'(
P,
Mod,
_,number_of_clauses(
NCl))
:-
567 '$number_of_clauses'(
P,
Mod,
569'$predicate_property'(
P,
ContextMod,
_,imported_from(
Mod))
:-
570 recorded(
'$import',
'$import'(
Mod,
ContextMod,
_G0,
P,
_N1,
_K),
_).
581 '$do_error'(instantiation_error,predicate_statistics(
V,
NCls,
Sz,
ISz)).
583 strip_module(
P0,
M,
P),
584 '$predicate_statistics'(
P,
M,
NCls,
Sz,
ISz).
586'$predicate_statistics'(
M:P,
_,
NCls,
Sz,
ISz)
:- '$predicate_statistics',
587 '$predicate_statistics'(
P,
M,
NCls,
Sz,
ISz).
588'$predicate_statistics'(
P,
M,
NCls,
Sz,
ISz)
:-
589 '$is_log_updatable'(
P,
M),
'$is_log_updatable',
590 '$lu_statistics'(
P,
NCls,
Sz,
ISz,
M).
591'$predicate_statistics'(
P,
M,
_,
_,
_)
:-
592 '$is_system_predicate'(
P,
M),
'$is_system_predicate',
'$is_system_predicate'.
593'$predicate_statistics'(
P,
M,
_,
_,
_)
:-
594 '$undefined'(
P,
M),
'$undefined',
'$undefined'.
595'$predicate_statistics'(
P,
M,
NCls,
Sz,
ISz)
:-
596 '$static_pred_statistics'(
P,
M,
NCls,
Sz,
ISz).
612 strip_module(
P0,
M,
P),
613 '$predicate_erased_statistics'(
M:P,
NCls,
Sz,
_,
ISz).
620 '$yap_strip_module'(
T0,
M,
T),
621 (
var(
M)
-> '$all_current_modules'(
M)
; '$all_current_modules' ),
623 '$current_predicate'(
A,
M,
T, user),
624 '$follow_import_chain'(
M,
T,
M00,
G00),
625 '$pred_exists'(
G00,
M00).
632 '$yap_strip_module'(
P0,
M0,
P),
633 (
M= M0 ; M0 \= user,
M = user
; M0 \= prolog,
M = prolog ),
638 '$current_predicate'(
A,
M,
T, system),
640 '$is_system_predicate'(
T,
M)
645 '$current_predicate'(
A,
M,
T, system),
646 '$is_system_predicate'(
T,
M)
652 '$current_predicate'(
A,
M,
T, system),
653 '$is_system_predicate'(
T,
M)
657 '$current_predicate'(
A,
M,
T, system),
658 '$is_system_predicate'(
T,
M),
663 '$current_predicate'(
A,
M,
T, system),
664 '$is_system_predicate'(
T,
M),
669 '$do_error'(type_error(predicate_indicator,
P),
670 system_predicate(
P0))
683 '$yap_strip_module'(
P0,
M,
P),
687 '$current_predicate'(
A,
M,
P, system),
688 '$is_system_predicate'(
P,
M)
690 '$current_predicate'(
A,
M,
P, system)
703 '$yap_strip_module'(
F0,
M,
F),
704 must_bind_to_type( predicate_indicator,
F ),
705 '$c_i_predicate'(
F,
M ).
707'$c_i_predicate'(
A/N,
M )
:-
719'$c_i_predicate'(
A//N,
M )
:-
741 '$current_predicate'(
A,idb,
K,user).
746'$ifunctor'(
Pred,
Na,
Ar)
:-
767 '$current_module'(
Mod),
768 '$compile_predicates'(
Ps,
Mod, compile_predicates(
Ps)).
770'$compile_predicates'(
V,
_,
Call)
:-
772 '$do_error'(instantiation_error,
Call).
773'$compile_predicates'(
M:Ps,
_,
Call)
:-
774 '$compile_predicates'(
Ps,
M,
Call).
775'$compile_predicates'([],
_,
_).
776'$compile_predicates'([
P|Ps],
M,
Call)
:-
777 '$compile_predicate'(
P,
M,
Call),
778 '$compile_predicates'(
Ps,
M,
Call).
780'$compile_predicate'(
P,
_M,
Call)
:-
782 '$do_error'(instantiation_error,
Call).
783'$compile_predicate'(
M:P,
_,
Call)
:-
784 '$compile_predicate'(
P,
M,
Call).
785'$compile_predicate'(
Na/Ar,
Mod,
_Call)
:-
787 findall([
G|B],clause(
Mod:G,
B),
Cls),
789 '$add_all'(
Cls,
Mod).
792'$add_all'([[
G|B]
|Cls],
Mod)
:-
794 '$add_all'(
Cls,
Mod).
797clause_property(
ClauseRef, file(
FileName))
:-
798 (
recorded(
'$mf',
'$mf_clause'(
FileName,
_Name,
_Arity,
_Module,
ClauseRef),
_R)
801 instance_property(
ClauseRef,
2,
FileName) ).
802clause_property(
ClauseRef, source(
FileName))
:-
803 (
recorded(
'$mf',
'$mf_clause'(
FileName,
_Name,
_Arity,
_Module,
ClauseRef),
_R)
806 instance_property(
ClauseRef,
2,
FileName) ).
807clause_property(
ClauseRef, line_count(
LineNumber))
:-
808 instance_property(
ClauseRef,
4,
LineNumber),
810clause_property(
ClauseRef, fact)
:-
811 instance_property(
ClauseRef,
3, true).
812clause_property(
ClauseRef, erased)
:-
813 instance_property(
ClauseRef,
0, true).
814clause_property(
ClauseRef, predicate(
PredicateIndicator))
:-
815 instance_property(
ClauseRef,
1,
PredicateIndicator).
817'$set_predicate_attribute'(
M:N/Ar,
Flag,
V)
:-
819 '$set_flag'(
P,
M,
Flag,
V).
824'$set_flag'(
P,
M, trace, off)
:-
825 '$predicate_flags'(
P,
M,
F,
F),
826 FN is F \/ 0'$predicate_flags',
827 '$predicate_flags'(
P,
M,
F,
FN).
832
compile_predicates(: ListOfNameArity)
predicate_erased_statistics( P, NCls, Sz, IndexSz)
predicate_property( P, Prop)
predicate_statistics( P, NCls, Sz, IndexSz)
system_predicate( ?A, ?P )
dynamic_predicate(+ P,+ Semantics)
no need for code at this point
current_prolog_flag(? Flag,- Value)
print_message(+ Severity, +Term)
memberchk(+ Element, + Set)