Search code examples
moduleprologsicstus-prolog

List all relations from a module in SICStus Prolog


Is there any way to get the list of all relations defined in a loaded module in SICStus Prolog interpreter?


Solution

  • You can use the current_predicate/1 built_in predicate:

    findall(Predicate, current_predicate(Module:Predicate), L)