Btw. I found 8 possibilities to concat atoms in Swi Prolog

Without exlplicitly loading any libraries:

test003_3 :- try_parameters_permuted( [[a,b,c],R], R==abc).
 file_base_name([a,b,c],_15090). file_base_name([a,b,c],abc).
 atomic_list_concat([a,b,c],_20378). atomic_list_concat([a,b,c],abc).
 atom_string(_1896,[a,b,c]). atom_string(abc,[a,b,c]).
 term_string(_6076,[a,b,c]). term_string(abc,[a,b,c]).
 term_to_atom(_6236,[a,b,c]). term_to_atom(abc,[a,b,c]).
 atom_codes(_4958,[a,b,c]). atom_codes(abc,[a,b,c]).
 atom_chars(_5038,[a,b,c]). atom_chars(abc,[a,b,c]).
 name(_5038,[a,b,c]). name(abc,[a,b,c]).

I am currently trying to find existing functionality by searching for what is it supposed to do. I know I can have some false positives but it looks promising.

But I encounter some problems. What I could need is information about the types. I try out all existing prolog predicates.

Do I have to do with streams? What are input and output parameters? Does the predicate make harmful operations? At least for this task I forbid the swipl program to use the net and to use the filesystem via firejail.

I would appreciate it if I coud figure out which meta information are available for a predicate.


Have you seen

Don’t forget to look at the code that implements it for other ideas.


List the properties for predicate(s)


Thanks. Through gxref I was also able to find all these xref predicates. But I didn’t find anything about the fontsize for gxref.

Some time ago I changed font.scale to 2 in ~/.xpce/Defaults. It worked for the old help browser but it don’t seem to have any effect to gxref.

Any hints are welcome.


Note that the story is different for atoms that have more than one character. Lists of one-character atoms are one of the forms of ISO Prolog strings. So, atom_string(X, [aa,bb]) does not work.

Unfortunately there is no machine readable type information about the built-ins. Would be great to have.

All meta information comes from predicate_property/2.

The location of this file has changed to comply with desktop file standards. Start ?- emacs. and use the Edit/Editor preferences menu option to edit/create the preferences file. All xpce based tools should listen to these settings. You have to restart Prolog after editing this file.

1 Like

Thanks. I think this gxref application provides currently the best documentation.

But the help, apropos and html documentation don’t seem to be in sync very well.

When I watch the F.2 Library predicates
site under file:///usr/local/lib/swipl/doc/Manual/library.html (version 8.4.1) then the part F.2.47 library(terms) shows no one predicate.

‘?- help(terms).’ shows more information.

But with help I am not able to search for the contents of specific sections.

To see all I would call help(A). So I see all which is available but unfortunately A don’t get bound. I think if there were sections available A could show me how it has to be named correctly.


When it comes to learning SWI-Prolog I don’t rely on the documentation much anymore. Since the documentation comes from doc comments in the source code and seeing examples of code from trusted source is better than reading about it, I just down load the trusted source code from places like GitHub and then use Notepad++ to find examples. Often when doing this some of the best examples are in the test cases.

This list shows many of the GitHub repositories I search regularly on my local copies. However if I can not find a good example I will search GitHub directly and if I find an example not in my local copies will pull that down for future searching. It is amazing some of the things others do with Prolog.

Also I don’t search just the Prolog code, often the C code and C structures give some very inciteful information.
See: A taste of Doxygen used to diagram the SWI-Prolog C structures relations


The intend is that the primary documentation is the website. That is designed to pick the “best” if there are multiple documentation sources for a library. It always runs the latest development release. That might point at functionality that does not exist or is different in the latest stable version. Ideally we’d be able to switch to versions between manual versions. The fully dynamic nature of the site makes it a bit hard to keep multiple copies.

Pushed some fixes for the library index.

I don’t see much in ?- help(A). It wouldn’t be particularly hard to implement, but there is so much that it is mostly useless.

If you want a version of the website that is specific to your version, clone the website source (GitHub - SWI-Prolog/plweb: SWI-Prolog web server sources for and follow the instructions to run it locally. Maybe that should be made easier …