Careful with setof/3

Hi @jan, is the list of those predicates where SWI diverges from ISO documented? Ciao Prolog requires a precise definition of “output” in order to do correct static analysis and probably our assumptions for many predicates also diverges from ISO.

If there are good enough reasons to push a change into the standard, it would be worth it. In the worst case, even if it is never accepted, users of all Prolog systems may appreciate if there is a common text describing non-standard changes to ISO. Hopefully every Prolog dialect could be described as a delta w.r.t. ISO.

We could do ‘cross citations’ between Ciao and SWI documentation, but it would be a mess. I still believe that some common forum for implementors a-la “Bytecode Alliance” to share and review specifications may be positive, if there is room for both industrial and academic people (I think there is).

Some systems may decide to be “broad and generalist” and support many dialects (like SWI), others may decide to be more focused (e.g., in Ciao we traditionally have prioritized decisions that makes static analysis feasible, even though they break the compatibility with other traditional Prolog code), but at least there would be a way to understand what each system is doing and why.

This may also solve some of some ugly aspects (from my side) of the current Prolog ecosystem: academic systems look for solutions, which takes a lot of time, but do not always have the resources to push into industrial solutions. All good ideas of academic systems are adopted by industrial ones, which is really awesome, but unfortunately the origin of those ideas is often lost.

We’d not need to invent anything, just follow what https://peps.python.org/ does and try to involve as much implementors as possible (I’m aware that implementors of other Prolog systems also like PEPs). Using something like markdown would not be harder than typing messages here or in our documentation systems. Rather than saying “Ciao does feature X like SWI” we could say “Ciao implements PEP37” and point to a common place that describes (forever and for every other system) what PEP37 means. PEP37 can be open for everyone to contribute. It could cite research papers and research papers could cite them (rather than vague statements like “as implemented in Ciao or SWI…”). I could write in my CV: I designed PEP37 and showed that it worked, it was adopted by system X,Y,Z… It could also be possible to have completely incompatible proposals, each system is free to implement whatever is better for them. Some PEP may be trivial and others hard research problems.

If anyone likes the idea I can help implementing it and contacting other systems.