Configuration of SWI-prolog.app on MacOS

Hi, having installed SWI prolog on MacOS Catalina (10.15.7) a few months ago (using MacPorts), but am only now trying to use it. I am quite impressed with ease of use of the (SWI-prolog) App - at least for someone familiar with MacOS apps, but there do seem to be configuration problems and gaps in the documentation.
Unlike the traditional Unix command-line installations, the MacOS one is installed under /Applications, which is the top-level directory where most Mac apps sit.
Prolog-like versions of the simple command-line operations work with slightly puzzling comment-style results (see ls/1) below, but the goal “manpce” brings up the expected XPCE Manual window.

However I cannot find documentation for app_config(1) in order to fix the strange interaction sequence below.
(The first queries correctly find the swi home directory, - “%YES” added
The answer to the second query may be correct, but is mysterious.
However the third answer is wrong -
/Users/rjc/.config/swi-prolog/ a directory for user- downloaded packs).
The helpful colour is missing from the extract below:

?- file_search_path(swi, Home), ls(Home). 
% LICENSE         boot/           doc/            swipl-win.rc     
% README.md       boot.prc        include/        swipl.home       
% SWI-Prolog.rc   customize/      lib/            swipl.rc         
% bin/            demo/           library/        xpce/           
Home = '/Applications/SWI-Prolog.app/Contents/swipl' .       %(YES)

?- file_search_path(library,X).  
X = app_config(lib) .                                                                 %(Maybe)

?- absolute_file_name(app_config(lib),X).  
X = '/Users/rjc/.config/swi-prolog/lib'.                                        %(Wrong)

?- ls('/Users/rjc/.config/swi-prolog/lib').  
Warning: "/Users/rjc/.config/swi-prolog/lib" does not exist 
false.  

There may be just an XML app_config file to fix, but where?

Can anyone help please. - rjc

absolute_file_name/2 is not defined to produce paths that exist. It just produces the consequences of the user:file_search_path/2 rules. If you want paths that satisfy some condition, use absolute_file_name/3 and add the condition you want.

Its all Prolog rules. A good way to get insight in multifile predicates is listing/2 using the source option:

?- listing(file_search_path/2, [source(true)]).
:- dynamic file_search_path/2.
:- multifile file_search_path/2.

% From /home/janw/src/swipl-devel/linux/home/boot/init.pl:991
user:(file_search_path(library, Dir) :-
        library_directory(Dir)).
user:file_search_path(swi, Home) :-
    current_prolog_flag(home, Home).
user:file_search_path(swi, Home) :-
    current_prolog_flag(shared_home, Home).
user:file_search_path(library, app_config(lib))
...

Jan, Thanks for the tip re listing/2,
no doubt more will be needed, so thanks in anticipation.
Regards Jim (rjc).
PS it was me perusing the ‘cut elimination’ discussion late one evening a couple of weeks ago or more, but I had not registered at the time.