[m-dev.] Re: Reminder: Mercury tests failing

Fergus Henderson fjh at cs.mu.OZ.AU
Fri May 30 19:37:41 AEST 2003


On 30-May-2003, David Overton <dmo at cs.mu.OZ.AU> wrote:
> On Fri, May 30, 2003 at 06:30:06AM +1000, Mercury wrote:
> > This is an automatic reminder.
> > Some of the tests in the Mercury test suite are failing,
> > apparently due to a change that you made (or approved).
> > The issue in question is this:
> > 
> > (currently there is no test in the test suite for this one,
> > but nevertheless it is a regression)
> > 
> > The following program seg faults, due to a problem with
> > co/contravariance in higher-order inst matching.
> > 
> > 	:- module bug.
> > 	:- interface.
> > 	:- import_module io.
> > 	 
> > 	:- pred main(io__state::di, io__state::uo) is det.
> > 	 
> > 	:- implementation.
> > 	:- import_module list, bool.
> > 	 
> > 	main -->
> > 		( { q(p) } ->
> > 			print("yes"), nl
> > 		;
> > 			print("no"), nl
> > 		).
> > 	 
> > 	:- type intlist == list(int).
> > 	:- inst nonempty ---> [ground|ground].
> > 	 
> > 	:- pred p(intlist, intlist).
> > 	:- mode p(in(nonempty), out(nonempty)) is det.
> > 	 
> > 	p([X], [X]).
> > 	p([X,Y|Zs], [Y,X|Zs]).
> > 	 
> > 	:- pred q(pred(intlist, intlist)).
> > 	:- mode q(pred(in, out) is det) is semidet.
> > 	 
> > 	q(P) :- P([], L), L \= [].
> > 
> > 
> > If you have any questions about this email,
> > please ask fjh at cs.mu.oz.au or mercury at cs.mu.oz.au.
> 
> I've had a look at this.  The problem is that
> inst_matches_final(ground, bound(...)) is unsafe.

I think you're wrong about that -- I think that issue is a separate issue.
The issue that I'm talking about is specifically in pred_inst_matches*.
You changed the way those predicates handle co/contra-variance,
and from looking at your source changes, I figured that it must be
broken, and came up with the above test case.
Perhaps the above test case isn't actually the right one to illustrate the
problem, but last time I looked I was pretty sure there was a bug
in your changes to pred_inst_matches*.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list