I\'m doing a very simple exercise in Prolog and there\'s something I don\'t understand in the trace. The program is a \"greater than\" (>) on integers represente
OK, so it's a compiler optimization that a given compiler/version combination might or might not have.
Later versions of SWI do not have this problem. It is probably related to clause indexing. This behaviour would be seen on implementations without indexing, or such that index on the first argument only.
But apparently, "SWI-Prolog provides `just-in-time' indexing over multiple arguments". SWI 5.6.56 manual states that "at most 4 arguments can be indexed". So it probably indexes more than one.