"circular" fd constraints and the soft cut conditional

From: Alexander Pretschner <pretschn_at_informatik.tu-muenchen.de>
Date: Tue 30 Oct 2001 03:05:22 PM GMT
Message-ID: <3BDEC1B2.E5B1CAC6@informatik.tu-muenchen.de>
Hi-
given the code below, Eclipse 5.3 (linux) crashes while executing
predicate query/0 (the code is generated automatically).

Tracking down the problem, there's two things:
(a) ?- X-Y #>=1, Y-X #>=0.
takes roughly 90 seconds to compute the correct answer "no" (while the
solution seems trivial to a human).
(b) If I replace the soft cut conditional (*->) from sepia_kernel by an
actual "hard" cut conditional (->), predicate "query" takes about 90
seconds to yield the (correct?) result "no" rather than a crash.
However, I do indeed need the "soft" semantics where all positive
answers are tried.

The question now is: 
1/ is (a) such a hard problem? 
2/ I guess *-> is an undocumented predicate - is there a documented one
I could/should use instead?

Thanks,
Alex





ECLiPSe Constraint Logic Programming System [kernel]
Copyright Imperial College London and ICL
Certain libraries copyright Parc Technologies Ltd
GMP library copyright Free Software Foundation
Version 5.3 #2, Wed Jun 27 02:14 2001
[eclipse 1]: [err],query.
fd_domain.eco loaded traceable 0 bytes in 0.01 seconds
fd_arith.eco loaded traceable 0 bytes in 0.02 seconds
fd_util.pl compiled traceable 2120 bytes in 0.00 seconds
fd_chip.pl compiled traceable 4712 bytes in 0.01 seconds
fd_elipsys.pl compiled traceable 11028 bytes in 0.00 seconds
fd.eco     loaded traceable 0 bytes in 0.05 seconds
err.pl     compiled traceable 2052 bytes in 0.05 seconds
Segmentation violation - possible reasons are:
- a faulty external C function
- certain operations on circular terms
- machine stack overflow
- an internal error in ECLiPSe
Aborting execution....
 
*** ECLiPSe fatal error: reset/0 called
ECLiPSe Constraint Logic Programming System [kernel]
Copyright Imperial College London and ICL
Certain libraries copyright Parc Technologies Ltd
GMP library copyright Free Software Foundation
Version 5.3 #2, Wed Jun 27 02:14 2001
[eclipse 1]:          



file err.pl:

:-lib(fd).
:-import (*->)/2 from sepia_kernel.
:- call(call_explicit(op(1050, xfy, *->), sepia_kernel)).	% local op
if(X,Y,Z):- X *-> Y;Z.

query:-
  isFunc(cgetBalance, (Laccs, LcurAcc), X5),
  isFunc(cwd, LcurReq1, X6), 
  X5#< X6,   
  isFunc(cgetBalance, (Laccs, LcurAcc), X_05),
  isFunc(cwd, LcurReq1, X_06), 
  X_05 #>= X_06.

isFunc(cgetBalance, (cAccs(Acc, Amt, Next), A), _X2):-
  if((
      isFunc(#=, (Acc, A), X0)
     ),
     (     % then
      if((
          X0 = true
         ),
         (     % then
          _X2 = Amt
         ),
         (     % else
          isFunc(cgetBalance, (Next, A), X1),
          _X2 = X1
         )
        )     % endif

     ),
     (     % else
      isFunc(cgetBalance, (Next, A), X1),
      _X2 = X1
     )
    ).     % endif

isFunc(cwd, cWithdraw(X0), _P):-  _P = X0.
isFunc(#=,(A,B),true):- fd:(A#=B).
isFunc(#=,(A,B),false):- fd:(A#\=B).
Received on Tue Oct 30 15:04:29 2001

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:11 PM GMT GMT