Re: bug in clp(q,r) library
- From: Andrey Rybalchenko <first.last@xxxxxxx>
- Date: Fri, 11 Aug 2006 18:50:35 +0200
Below is a witness program for sicstus. Its compiled version produces:
time ./test
hello world
start
CS injected
D injected
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0]
real 0m0.066s
user 0m0.044s
sys 0m0.013s
Running scale_query in tswi 5.6.17 interpreter does not terminate within tens of minutes. The same holds for sicstus 3.12.5 interpreter.
Best regards,
Andrey
user:runtime_entry(start) :-
scale_query.
scale_query :-
Cs = {(_226686>=0,_226684>=0,1=1),_226686*1+_226684*1=<_85353+(0*_85285+0*_85283+0*_85281+0*_85279),(0*_226686+0*_226684=1*_85285+0*_85283+0*_85281+0*_85279,0*_226686+0*_226684=0*_85285+0*_85283+0*_85281+0*_85279,0*_226686+0*_226684=0*_85285+0*_85283+1*_85281+0*_85279,0*_226686+0*_226684=0*_85285+0*_85283+0*_85281+1*_85279,1=1),(_226199>=0,_226197>=0,1=1),_226199*1+_226197*1=<_85351+(0*_85211+0*_85209+0*_85207+0*_85205),(0*_226199+0*_226197=1*_85211+0*_85209+0*_85207+0*_85205,0*_226199+0*_226197=0*_85211+0*_85209+0*_85207+0*_85205,0*_226199+0*_226197=0*_85211+0*_85209+1*_85207+0*_85205,0*_226199+0*_226197=0*_85211+0*_85209+0*_85207+1*_85205,1=1),(_212964>=0,_212962>=0,1=1),_212964*_85353+_212962*_85351=<_82959+(0*_82891+0*_82889+0*_82887+0*_82885),(_85285*_212964+_85211*_212962=1*_82891+0*_82889+0*_82887+0*_82885,_85283*_212964+_85209*_212962=0*_82891+1*_82889+0*_82887+0*_82885,_85281*_212964+_85207*_212962=0*_82891+0*_82889+1*_82887+0*_82885,_85279*_212964+_85205*_212962=0*_82891
+0*_82889+0*_82887+0*_82885,1=1),(_212489>=0,_212487>=0,1=1),_212489*_85353+_212487*_85351=<_82957+(0*_82817+0*_82815+0*_82813+0*_82811),(_85285*_212489+_85211*_212487=1*_82817+0*_82815+0*_82813+0*_82811,_85283*_212489+_85209*_212487=0*_82817+1*_82815+0*_82813+0*_82811,_85281*_212489+_85207*_212487=0*_82817+0*_82815+1*_82813+0*_82811,_85279*_212489+_85205*_212487=0*_82817+0*_82815+0*_82813+0*_82811,1=1),(_198338>=0,_198336>=0,_198334>=0,1=1),_198338* -1+_198336*_82959+_198334*_82957=<_83525+(0*_83457+0*_83455+0*_83453+0*_83451),( -1*_198338+_82891*_198336+_82817*_198334=1*_83457+0*_83455+0*_83453+0*_83451,0*_198338+_82889*_198336+_82815*_198334=0*_83457+1*_83455+0*_83453+0*_83451,0*_198338+_82887*_198336+_82813*_198334=0*_83457+0*_83455+1*_83453+0*_83451,1*_198338+_82885*_198336+_82811*_198334=0*_83457+0*_83455+0*_83453+1*_83451,1=1),(_197798>=0,_197796>=0,_197794>=0,1=1),_197798* -1+_197796*_82959+_197794*_82957=<_83523+(0*_83383+0*_83381+0*_83379+0*_83377),( -1*_197798+_82891*_197796+_82817*_197794=1*_83383+0*_83381+0*_83379+0*_83377,0*_197798+_82889*_197796+_82815*_197794=0*_83383+1*_83381+0*_83379+0*_83377,0*_197798+_82887*_197796+_82813*_197794=0*_83383+0*_83381+1*_83379+0*_83377,1*_197798+_82885*_197796+_82811*_197794=0*_83383+0*_83381+0*_83379+1*_83377,1=1),(_181754>=0,_181752>=0,_181750>=0,1=1),_181754*0+_181752*_82959+_181750*_82957=<_78904+(0*_78836+0*_78834+0*_78832+0*_78830),(1*_181754+_82891*_181752+_82817*_181750=1*_78836+0*_78834+0*_78832+0*_78830,0*_181754+_82889*_181752+_82815*_181750=0*_78836+1*_78834+0*_78832+0*_78830,0*_181754+_82887*_181752+_82813*_181750=0*_78836+0*_78834+1*_78832+0*_78830, -1*_181754+_82885*_181752+_82811*_181750=0*_78836+0*_78834+0*_78832+1*_78830,1=1),(_181217>=0,_181215>=0,_181213>=0,1=1),_181217*0+_181215*_82959+_181213*_82957=<_78902+(0*_78762+0*_78760+0*_78758+0*_78756),(1*_181217+_82891*_181215+_82817*_181213=1*_78762+0*_78760+0*_78758+0*_78756,0*_181217+_82889*_181215+_82815*_181213=0*_78762+1*_78760+0*_78758+0*_78756,0*_181217+_82887*_181215+_82813*_181213=0*_78762+0*_78760+1*_78758+0*_78756, -1*_181217+_82885*_181215+_82811*_181213=0*_78762+0*_78760+0*_78758+1*_78756,1=1),(_165382>=0,_165380>=0,1=1),_165382*_83525+_165380*_83523=<_82712+(0*_82644+ -1*_82642+0*_82640+0*_82638),(_83457*_165382+_83383*_165380=1*_82644+0*_82642+0*_82640+0*_82638,_83455*_165382+_83381*_165380=0*_82644+1*_82642+0*_82640+0*_82638,_83453*_165382+_83379*_165380=0*_82644+0*_82642+1*_82640+0*_82638,_83451*_165382+_83377*_165380=0*_82644+0*_82642+0*_82640+1*_82638,1=1),(_164895>=0,_164893>=0,1=1),_164895*_83525+_164893*_83523=<_82710+(0*_82570+ -1*_82568+0*_82566+0*_82564),(_83457*_164895+_83383*_164893=1*_82570+0*_82568+0*_82566+0*_82564,_83455*_164895+_83381*_164893=0*_82570+1*_82568+0*_82566+0*_82564,_83453*_164895+_83379*_164893=0*_82570+0*_82568+1*_82566+0*_82564,_83451*_164895+_83377*_164893=0*_82570+0*_82568+0*_82566+1*_82564,1=1),(_150038>=0,_150036>=0,1=1),_150038*_82712+_150036*_82710=<_82959+(0*_82891+0*_82889+0*_82887+ -1*_82885),(_82644*_150038+_82570*_150036=1*_82891+0*_82889+0*_82887+0*_82885,_82642*_150038+_82568*_150036=0*_82891+1*_82889+0*_82887+0*_82885,_82640*_150038+_82566*_150036=0*_82891+0*_82889+1*_82887+0*_82885,_82638*_150038+_82564*_150036=0*_82891+0*_82889+0*_82887+1*_82885,1=1),(_149563>=0,_149561>=0,1=1),_149563*_82712+_149561*_82710=<_82957+(0*_82817+0*_82815+0*_82813+ -1*_82811),(_82644*_149563+_82570*_149561=1*_82817+0*_82815+0*_82813+0*_82811,_82642*_149563+_82568*_149561=0*_82817+1*_82815+0*_82813+0*_82811,_82640*_149563+_82566*_149561=0*_82817+0*_82815+1*_82813+0*_82811,_82638*_149563+_82564*_149561=0*_82817+0*_82815+0*_82813+1*_82811,1=1),(_133830>=0,_133828>=0,1=1),_133830*_78904+_133828*_78902=<_80701+(0*_80633+0*_80631+0*_80629+0*_80627),(_78836*_133830+_78762*_133828=1*_80633+0*_80631+0*_80629+0*_80627,_78834*_133830+_78760*_133828=0*_80633+1*_80631+0*_80629+0*_80627,_78832*_133830+_78758*_133828=0*_80633+0*_80631+0*_80629+0*_80627,_78830*_133830+_78756*_133828=0*_80633+0*_80631+0*_80629+1*_80627,1=1),(_133355>=0,_133353>=0,1=1),_133355*_78904+_133353*_78902=<_80699+(0*_80559+0*_80557+0*_80555+0*_80553),(_78836*_133355+_78762*_133353=1*_80559+0*_80557+0*_80555+0*_80553,_78834*_133355+_78760*_133353=0*_80559+1*_80557+0*_80555+0*_80553,_78832*_133355+_78758*_133353=0*_80559+0*_80557+0*_80555+0*_80553,_78830*_133355+_78756*_133353=0*
_80559+0*_80557+0*_80555+1*_80553,1=1),(_119210>=0,_119208>=0,_119206>=0,1=1),_119210* -1+_119208*_80701+_119206*_80699=<_79683+(0*_79615+0*_79613+0*_79611+0*_79609),( -1*_119210+_80633*_119208+_80559*_119206=1*_79615+0*_79613+0*_79611+0*_79609,0*_119210+_80631*_119208+_80557*_119206=0*_79615+1*_79613+0*_79611+0*_79609,1*_119210+_80629*_119208+_80555*_119206=0*_79615+0*_79613+1*_79611+0*_79609,0*_119210+_80627*_119208+_80553*_119206=0*_79615+0*_79613+0*_79611+1*_79609,1=1),(_118688>=0,_118686>=0,_118684>=0,1=1),_118688* -1+_118686*_80701+_118684*_80699=<_79681+(0*_79541+0*_79539+0*_79537+0*_79535),( -1*_118688+_80633*_118686+_80559*_118684=1*_79541+0*_79539+0*_79537+0*_79535,0*_118688+_80631*_118686+_80557*_118684=0*_79541+1*_79539+0*_79537+0*_79535,1*_118688+_80629*_118686+_80555*_118684=0*_79541+0*_79539+1*_79537+0*_79535,0*_118688+_80627*_118686+_80553*_118684=0*_79541+0*_79539+0*_79537+1*_79535,1=1),(_102656>=0,_102654>=0,_102652>=0,1=1),_102656* -1+_102654*_79683+_102652*_79681=< -1+(0*0+0*0+0*0+0*0),(0*_102656+_79615*_102654+_79541*_102652=1*0+0*0+0*0+0*0,1*_102656+_79613*_102654+_79539*_102652=0*0+1*0+0*0+0*0,0*_102656+_79611*_102654+_79537*_102652=0*0+0*0+1*0+0*0,0*_102656+_79609*_102654+_79535*_102652=0*0+0*0+0*0+1*0,1=1),(_102143>=0,_102141>=0,_102139>=0,1=1),_102143* -1+_102141*_79683+_102139*_79681=< -1+(0*0+0*0+0*0+0*0),(0*_102143+_79615*_102141+_79541*_102139=1*0+0*0+0*0+0*0,1*_102143+_79613*_102141+_79539*_102139=0*0+1*0+0*0+0*0,0*_102143+_79611*_102141+_79537*_102139=0*0+0*0+1*0+0*0,0*_102143+_79609*_102141+_79535*_102139=0*0+0*0+0*0+1*0,1=1)},
D = {(_226686=1;_226686=0),(_226684=1;_226684=0),(_226199=1;_226199=0),(_226197=1;_226197=0),(_212964=1;_212964=0),(_212962=1;_212962=0),(_212489=1;_212489=0),(_212487=1;_212487=0),(_198338=1;_198338=0),(_198336=1;_198336=0),(_198334=1;_198334=0),(_197798=1;_197798=0),(_197796=1;_197796=0),(_197794=1;_197794=0),(_181754=1;_181754=0),(_181752=1;_181752=0),(_181750=1;_181750=0),(_181217=1;_181217=0),(_181215=1;_181215=0),(_181213=1;_181213=0),(_165382=1;_165382=0),(_165380=1;_165380=0),(_164895=1;_164895=0),(_164893=1;_164893=0),(_150038=1;_150038=0),(_150036=1;_150036=0),(_149563=1;_149563=0),(_149561=1;_149561=0),(_133830=1;_133830=0),(_133828=1;_133828=0),(_133355=1;_133355=0),(_133353=1;_133353=0),(_119210=1;_119210=0),(_119208=1;_119208=0),(_119206=1;_119206=0),(_118688=1;_118688=0),(_118686=1;_118686=0),(_118684=1;_118684=0),(_102656=1;_102656=0),(_102654=1;_102654=0),(_102652=1;_102652=0),(_102143=1;_102143=0),(_102141=1;_102141=0),(_102139=1;_102139=0),1=1},
print('start\n'),
term_variables(D, DVars),
Cs,
print('CS injected\n'),
D,
print('D injected\n'),
print(DVars), nl.
Tom Schrijvers wrote:
Andrey Rybalchenko wrote:.
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 ...).
Do you have any experimental evidence? Is there really a scaling issue or just some constant factors that are worse in SWI-Prolog?
Cheers,
Tom
- References:
- bug in clp(q,r) library
- From: Andrey Rybalchenko
- Re: bug in clp(q,r) library
- From: Tom Schrijvers
- Re: bug in clp(q,r) library
- From: Andrey Rybalchenko
- Re: bug in clp(q,r) library
- From: Tom Schrijvers
- bug in clp(q,r) library
- Prev by Date: Re: bug in clp(q,r) library
- Next by Date: Re: When to use facts instead of rules?
- Previous by thread: Re: bug in clp(q,r) library
- Next by thread: clp(q) interactive vs. stand-alone behaviour
- Index(es):