From 91e5f03121e18ea86c3c1c44c69ff7eb433e2478 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 10 May 2016 09:25:52 +0100 Subject: [PATCH] Aleph uses system_predicate/2 --- pl/preds.yap | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pl/preds.yap b/pl/preds.yap index 0850c16cd..626d760d1 100644 --- a/pl/preds.yap +++ b/pl/preds.yap @@ -652,6 +652,26 @@ system_predicate(P0) :- system_predicate(P0)) ). +/** @pred system_predicate( ?A, ?P ) + + Succeeds if _A_ is the name of the system predicate _P_. It can be used to test and to enumerate all system predicates. + + YAP also supports the ISO standard built-in system_predicate/1, that + provides similar functionality and is compatible with most other Prolog + systems. + +*/ +system_predicate(A, P0) :- + '$yap_strip_module'(P0, M, P), + ( + nonvar(P) + -> + '$current_predicate'(A, M, P, system), + '$is_system_predicate'( P, M) + ; + '$current_predicate'(A, M, P, system) + ). + /** @pred current_predicate( _F_) is iso