Attached are 3 versions of naive reverse that give different results with and without wait/2, and also different results depending on whether they are compiled or dynamically loaded.
These work with SWI-Prolog (outputs included) but fail in three different ways on XSB:
- sometimes throwing an error (calling a variable)
- wrong answer when compiled without the mytrue/1 predicate
- a different wrong answer when loaded dynamically
The theory (which is mentioned at the end of constraintLib.P) is that the compiler's optimization is removing a "local" variable. However, this seems contradicted by the observation that load_dyn gives a different result.
Also note that not all the tracebacks are the same -- in some cases, the t_append and t_reverse predicates show up and in some they don't.
[Minor note: there seems to be a line missing from the error description in constraintLib]
Attached are the programs and a lightly edited output (removing some of the banner and trace output).
Log in to post a comment.