Re: [eclipse-clp-users] timeout in bb_min/3

From: Amine Marref <cyborgamine_at_hotmail.com>
Date: Thu, 18 Feb 2010 14:53:39 +0000
Thanks Marco,

I have substituted ";" with "or" and it works. I thought that they are equivalent like "," and "and" are equivalent (I hope they are).

I always wondered what when to use ";", when to use "or", and when to use multiple definitions of a predicate e.g. "con(X):-X#>0. \n con(X):-X#<0."



> Date: Thu, 18 Feb 2010 15:40:54 +0100
> From: marco.gavanelli_at_unife.it
> To: cyborgamine_at_hotmail.com
> CC: eclipse-clp-users_at_lists.sourceforge.net
> Subject: Re: [eclipse-clp-users] timeout in bb_min/3
> 
> Amine Marref wrote:
> > Hello,
> > 
> > I am using Eclipse version 6.0#115 under Ubuntu 9.
> > 
> > I attach the predicate solve/1 which calls bb_min/3 at line 189. After about 1500 seconds, eclipse returns that the problem has no solution.
> > 
> > However, the timeout option in bb_min/3 in the attached file, should stop search after 10 seconds. It is not timing out.
> > 
> > What could be the reason?
> 
> Dear Amine,
> 
> I think that the reason is that you open a large number of choice points 
> with the ';' operator, and then you invoke bb_min. bb_min may fail, so 
> it will backtrack to the last choice point, and eventually re-execute 
> bb_min. So, for each execution of bb_min you have a 10s timeout, but 
> bb_min itself is called many times.
> 
> Anyway, it seems that you use ';' to impose a disjunction of 
> constraints, so I suggest to substitute each ';' with 'or', see the manual
> 
> http://87.230.22.228/doc/libman/libman018.html#toc20
> 
> Cheers,
> Marco
> 
> -- 
> Marco Gavanelli, Ph.D. in Computer Science
> Dept of Engineering
> University of Ferrara
> http://www.ing.unife.it/docenti/MarcoGavanelli/
 		 	   		  
Received on Thu Feb 18 2010 - 14:53:45 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET