[m-rev.] For review: new constraint based mode analysis

Richard James FOTHERGILL richardf at students.cs.mu.OZ.AU
Mon Feb 21 15:40:54 AEDT 2005



On Wed, 9 Feb 2005, Zoltan Somogyi wrote:

> On 08-Feb-2005, David Overton <dmo at cs.mu.OZ.AU> wrote:
>>> compiler/new_mode_constraints.m
>>
>> This is not a good name for the module, since it presumably won't be new
>> for long.
>
> How about prop_mode_constraints?
>

Sounds good. Changed it to that.


>> Please clarify what you mean here: is the user of this module not
>> permitted to use a conj constructor that is not a child of a disj?  If
>> so, you could enforce this through the type system, e.g:
>>
>> 	:- type constraint_formula
>> 		--->	atomic_constraint(var_constraint)
>> 		;	disj(list(conj_formula)).
>>
>> 	:- type conj_formula
>> 		--->	constraint_formula(constraint_formula)
>> 		;	conj(constraint_formulae).
>
> I second the request for a clarification, though the types proposed above
> aren't right.
>

I hope my reply to David (9/feb/05) has done something towards 
clarifying that. The comments now read:

 	% Represents conjunctions and disjunctions between atomic
 	% constraints on constraint variables.  The advantage of the
 	% constraints for this implementation of mode checking is that
 	% they can be expressed almost entirely as variable to variable
 	% constraints, with little use for the disj and conj functors of
 	% this structure.
 	%
:- type constraint_formulae == list(constraint_formula).
:- type constraint_formula
 	---> 
etc


>
>>> +		),	% XXX type_info args should be at the start and
>>> +			% should be 'in' so that is what this predicate adds
>>> +			% however, I am not happy with it.
>>
>> Why?
>
> Because it isn't a robust technique. However, for now, it is the best we can
> do.
>

Actually, I think we're OK now - I found where the type info argument mode 
information is stored. I've left the predicate for adding extra modes in 
all the same, just in case it's found to be needed later.



I think I'll commit on Tuesday evening, unless some more points come up 
that need my attention.


Thanks for having me on the team!
Richard.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list