[m-dev.] [reuse] diff: same size constraint

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Oct 12 01:13:59 AEDT 2000


On 11-Oct-2000, Peter Ross <petdr at miscrit.be> wrote:
> +		{ Constraint = same_size },
> +
> +			% XXX Are two cells with the same arity the same
> +			% contain existentially typed compenents which
> +			% require storage of the corresponding type
> +			% infos.
> +		{ P = (pred(Candidate::out) is nondet :- 
> +			list__member(Candidate, PossibleCandidates),
> +			CandidateVar = fst(Candidate),
> +			multi_map__search(Map, CandidateVar, ConsIds),
> +			cons_id_arity(ConsId, Arity),
> +			all [ReuseConsId] (
> +				list__member(ReuseConsId, ConsIds)
> +			=>
> +				(
> +					cons_id_arity(ReuseConsId, ReuseArity),
> +					ReuseArity = Arity

That XXX looks like bad news.  The ConsId arities *won't* include the
type_infos and/or type_class_infos added for existentially typed
constructors.

Probably the best fix is to record the real arity (i.e. the number of
argument variables in the construction/deconstruction unification)
along with the cons_id when you're doing structure reuse analysis.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- 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