Listing of predicates in this library module

Is there a way to list all the predicates that are defined in a given library unit for SICStus Prolog?

eg. if i load the lists module:

| ?- use_module(library(lists)).

      

is there any other predicate I can run from a hint to tell me which predicates have just been imported?

+3


source to share


1 answer


This works with SWI-Prolog, but the predicate is current_predicate/1

marked "ISO", so at least try it in SICSTUS.This is what I get:

? - use_module (library (lists)).
true.

? - current_predicate (lists: P).
P = max_list / 3;
P = flatten / 2;
% and so on

Or maybe:



? - findall (P, current_predicate (lists: P), Ps).
Ps = [max_list / 3, flatten / 2, nth1 / 4, reverse / 4, must_be / 2, min_member_ / 3, reverse / 2, transpose_pairs / 2, ... / ... | ...].

You should be able to do this in any Prolog that implements current_predicate/1

.

+4


source







All Articles