The librowser library provides a set of predicates wich enable the user to interactively find Ciao libraries and/or any predicate exported by them.
This is a simple example:
?- apropos(aggregates:'.*find.*'). aggregates:findnsols/5 aggregates:findnsols/4 aggregates:findall/4 aggregates:findall/3 yes ?-
librowser is specially useful when inside GNU Emacs: just place the cursor over a librowser response and press C-cTAB in order to get help on the related predicate. Refer to the "Using Ciao inside GNU Emacs" chapter for further information.
Then, the library interface must be read. This is automatically done when calling any predicate at librowser, and the entire process will take a little moment.So, you should want to perform such a process after loading the Ciao toplevel:
?- use_module(library(librowser)). yes ?- update.
Whether you want this process to be automatically performed when loading ciaosh, you may include those lines in your .ciaorc personal initialization file.
update/0 will also be automatically called (once) when calling any other predicate at librowser.
Creates an internal database of modules at Ciao libraries.
?- browse(M,findall/A). A = 3, M = conc_aggregates ? ; A = 4, M = aggregates ? ; A = 3, M = aggregates ? ; no ?-
Asocciates the given Spec predicate specification with the Module which exports it.
?- where(findall/A). findall/3 exported at module conc_aggregates findall/4 exported at module aggregates findall/3 exported at module aggregates yes ?-
Display what module to load in order to import the given Spec.
?- describe(librowser). Predicates at library librowser : apropos/1 describe/1 where/1 browse/2 update/0 yes ?-
Display a list of exported predicates at the given Module
?- apropos('write.'). write:writeq/1 write:writeq/2 yes ?- apropos('write.*'/2). dht_misc:write_pr/2 profiler_auto_conf:write_cc_assertions/2 mtree:write_mforest/2 transaction_concurrency:write_lock/2 transaction_logging:write/2 provrml_io:write_vrml_file/2 provrml_io:write_terms_file/2 unittest_base:write_data/2 write:write_canonical/2 write:writeq/2 write:write/2 write:write_term/2 stream_utils:write_string/2 res_exectime_hlm_gen:write_hlm_indep_each/2 res_exectime_hlm_gen:write_hlm_indep_2/2 res_exectime_hlm_gen:write_hlm_dep/2 oracle_calibration:write_conf/2 bshare_utils:write_string/2 bshare_utils:write_string_list/2 bshare_utils:write_length/2 bshare_utils:write_neg_db_stream/2 bshare_utils:write_neg_db/2 bshare_utils:write_pos_db/2 yesWhen no predicates are found with the exact search, this predicate will perform a fuzzy search which will find predicates at a distance of one edit, swap, deletion or insertion.
?- apropos('wirte'). Predicate wirte not found. Similar predicates: transaction_logging:write/2 write:write/1 write:write/2 yes ?- apropos(apend). Predicate apend not found. Similar predicates: hprolog:append/2 lists:append/3 llists:append/2 yes ?-
This will search any predicate specification Spec which matches the given RegSpec incomplete predicate specification.
apropos_spec(Pattern) :- atm(Pattern). apropos_spec(Pattern/Arity) :- atm(Pattern), int(Arity). apropos_spec(Module:Pattern/Arity) :- atm(Pattern), atm(Module), int(Arity). apropos_spec(Module:Pattern) :- atm(Pattern), atm(Module).
S is a predicate specification Pattern, Pattern/Arity, Module:Pattern, Module:Pattern/Arity.