Re: bug in clp(q,r) library



Thanks for the pointer.

Unfortunately, swi's implementation of clp(q) does not scale as well as
the one in sicstus (when sicstus doesn't throw an exception ...).

Andrey

Tom Schrijvers wrote:
Andrey Rybalchenko wrote:

Dear group,

Any ideas why clp(q,r) throws an exception on this constraint?

% loaded /opt/lib/sicstus-3.12.5/library/clpq.po in module clpq, 30 msec 437256 bytes
yes
| ?- {_159544+_3520*_159542+_3443*_159540=0,_2586*_127665+_2509*_127663=_3520,_2586*_126412+_2509*_126410=_3443,_2586*_94624+_2509*_94622=_2586, -_94626+_2584*_94624+_2507*_94622=_2584,_93345>=0,-_93349+_93347*_2661+_93345*_2659=<_2659+_2509+_2507,_2586*_93347+_2509*_93345=_2509, -_93349+_2584*_93347+_2507*_93345=_2507,_159544=1,_159540=1,_127665=0,_126412=1,_94626=1,_94624=1,_94622=1,_93349=1}.

! Type error in argument 1 of user:'$get_attributes'/3
! variable expected, but 2 found
! goal: '$get_attributes'(2,_77,_78)
| ?-


For what it's worth, clp(q) seems to work for your query in SWI-Prolog:

$ pl
% /home/toms/.plrc compiled 0.00 sec, 1,240 bytes
Welcome to SWI-Prolog (Multi-threaded, Version 5.6.17)
Copyright (c) 1990-2006 University of Amsterdam.
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.

For help, use ?- help(Topic). or ?- apropos(Word).

?- use_module(library(clpq)).
% library(clpq) compiled into clpq 0.12 sec, 379,520 bytes

Yes
?- {_159544+_3520*_159542+_3443*_159540=0,_2586*_127665+_2509*_127663=_3520,_2586*_126412+_2509*_126410=_3443,_2586*_94624+_2509*_94622=_2586, -_94626+_2584*_94624+_2507*_94622=_2584,_93345>=0,-_93349+_93347*_2661+_93345*_2659=<_2659+_2509+_2507,_2586*_93347+_2509*_93345=_2509, -_93349+_2584*_93347+_2507*_93345=_2507,_159544=1,_159540=1,_127665=0,_126412=1,_94626=1,_94624=1,_94622=1,_93349=1}.


{_2659=<2}

_159544 = 1
_3520 = 0
_159542 = _G181{geler = ...}
_3443 = -1
_159540 = 1
_2586 = -1
_127665 = 0
_2509 = 0
_127663 = _G199{geler = ...}
_126412 = 1
_126410 = _G211{geler = ...}
_94624 = 1
_94622 = 1
_94626 = 1
_2584 = _G233{geler = ...}
_2507 = 1
_93345 = 2
_93349 = 1
_93347 = 0
_2661 = _G254{geler = ...}
_2659 = _G260{geler = ..., itf = ...}

Yes
?- Cheers,

Tom
.



Relevant Pages

  • Re: bug in clp(q,r) library
    ... Any ideas why clpthrows an exception on this constraint? ... Type error in argument 1 of user:'$get_attributes'/3 ... SWI-Prolog comes with ABSOLUTELY NO WARRANTY. ...
    (comp.lang.prolog)
  • Translate SWI Code Fragment to Sicstus
    ... from SWI-Prolog to Sictsus. ... The problem are these two lines when I try to load it in Sicstus 4.0.4: ... Syntax error ...
    (comp.lang.prolog)
  • Manipulating Strings in Sicstus Prolog
    ... does anybody know how I can convert a string to a list of chars in ... It is really easy in SWI-Prolog simply by using the predicate ... but in sicstus I am having problems working with ...
    (comp.lang.prolog)
  • Re: bug in clp(q,r) library
    ... Andrey Rybalchenko wrote: ... swi's implementation of clpdoes not scale as well as ... the one in sicstus (when sicstus doesn't throw an exception ...). ...
    (comp.lang.prolog)
  • Re: Translate SWI Code Fragment to Sicstus
    ... from SWI-Prolog to Sictsus. ... The problem are these two lines when I try to load it in Sicstus 4.0.4: ... This should run on any Prolog system: ...
    (comp.lang.prolog)