How can extract the module's name and the optional predicates present in a file?
If I have a file.pl containing the call to one or more modules, how can I extract the name of these modules and the name of the predicates in the module declaration?
Example: if my file contains the call to module
:- use_module(library(lists), [ member/2,
append/2 as list_concat
]).
:- use_module(library(option).
I want to create an predicate extract(file.pl)
and output List=[[list,member,append],[option]]
Thanks.