trealla-prolog/trealla

CLPZ: Comparison

Closed this issue · 4 comments

$ scryer-prolog 
?- use_module(library(clpz)).
   true.
?- #X #= #X * #Y, #X #= -1 * #Y.  % Immediate answer
   clpz:(-1*Y#=X), clpz:(X*Y#=X).
?- halt.

$ tpl
?- use_module(library(clpz)).
   true.
?- #X #= #X * #Y, #X #= -1 * #Y. % Eats cpu/memory
^C
Action or (h)elp: a
  ... .
 false.
?- halt.

Diamond fetishism?
$ tpl
?- use_module(library(clpz)).
   true.
?- #X #= #X * #Y, #X #= #(-1) * #Y.
   clpz:(X*_A#=X), clpz:(_B*Y#=_B), clpz:(-1*Y#=_B), clpz:(-1*_A#=X).
?-

Don't know which behaviour is expected.

~/trealla ((no branch, bisect started on devel)) $ git bisect good
7c5aa7f is the first bad commit
commit 7c5aa7f
Author: Andrew Davison andrew.davison@gmail.com
Date: Fri Mar 15 08:27:30 2024 +1000

Trying sort_r_simple, re issue #509

Makefile | 2 +-
src/bif_sort.c | 24 +----
src/sort_r.h | 321 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 326 insertions(+), 21 deletions(-)
create mode 100644 src/sort_r.h
~/trealla ((no branch, bisect started on devel)) $

Trealla shows intermediate variables like _B which is unfortunate. Need to look at that.

And _A is a synonym for Y here. Also need to look at.

Somehow ok but the last test hangs here:
Android/Termux : ./tpl tests/issues/test523.pl
Neither sort_r nor sort_r_simple solves this hang.

v2.52.16
Intermediate variables and synonyms walked out.