Re: A strange way to crash eclipse

From: Joachim Schimpf <j.schimpf_at_icparc.ic.ac.uk>
Date: Thu 21 Jun 2001 09:43:18 AM GMT
Message-ID: <3B31C1B6.E3C58FF5@icparc.ic.ac.uk>
> > Olli Kamarainen wrote:
> > >
> > > Hello! I just realised that if I have an inconsistent tentative value
> > > for a variable, tkeclipse crashes when I try to save an lp_setup handle
> > > to a _global_ variable. You can try the following example:
> > >
> > > :-lib(eplex).
> > > :-lib(repair).
> > >
> > > crash:-
> > >         X $=< 10,
> > >         X $>= 1,
> > >         X tent_set 0,      % inconsistent value
> > >         Cost $= X * 10,
> > >         collect_lp_constraints_norm(NormCstrs),
> > >         lp_setup(NormCstrs, min(Cost), [integers(all)], Handle),
> > >
> > >         setval(lp_handle,Handle).  % eclipse crashes here!!
> > >
> > > I don't know if this is a feature or a bug, but it may cause some
> > > problems to me when using an lp-based neighbourhood operator in local
> > > search.
> > >
> > > Cheers,
> > > Olli


Hi Olli,

Indeed, untenable variables cause problems on copying.

However, in your code you anyway need to use a 'reference'
instead of a nonlogical 'variable' (otherwise getval returns
a handle with new variables rather than the ones you
setval'd before).

I.e add the declaration

:- local reference(lp_handle).

and it should work.


-- 
 Joachim Schimpf              /             phone: +44 20 7594 8187
 IC-Parc, Imperial College   /            mailto:J.Schimpf@ic.ac.uk
 London SW7 2AZ, UK         /    http://www.icparc.ic.ac.uk/eclipse
Received on Thu Jun 21 10:43:18 2001

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