[m-rev.] for review: Fix overly-conservative inst matching exposed by the previous change.

Peter Wang novalazy at gmail.com
Mon Aug 25 16:41:23 AEST 2014


On Tue, 19 Aug 2014 18:02:29 +1000, Peter Wang <novalazy at gmail.com> wrote:
> On Mon, 18 Aug 2014 16:06:37 +1000, Peter Wang <novalazy at gmail.com> wrote:
> > XXX contravariance_poly is broken but that may be due to a weakness
> > elsewhere
> 
> When matching a constrained inst variable A =< SubInstA on the LHS,
> we matched SubInstA with the inst on the RHS.  We can improve the
> precision by unifying the insts.
> 
> In contravariance_poly.m, in the term `q(p)' the final inst of the first
> argument of p must match_final the final inst of the first argument of
> the higher-order argument of q, where
> 
> :- mode p((list(I) >> nonempty(I)), (free >> nonempty(I))) is semidet.
> 
> :- mode q(pred((nonempty(bit) >> nonempty(bit)), (free >> list(bit)))
>     is semidet) is semidet.
> 
> We did not substitute I = bit so this rightfully fails:
> 
> 	nonempty(I =< ground) match_final nonempty(bit)

Ignore this patch for now.  I found more problems with constrained
polymorphic modes.

Peter



More information about the reviews mailing list