[mercury-users] Structure reuse

Ralph Becket rafe at cs.mu.OZ.AU
Thu Jul 17 10:21:25 AEST 2003


Nancy Mazur, Wednesday, 16 July 2003:
> 
> Perhaps there is a need in such cases of a different annotation... if 
> the programmer is interested in seeing whether some predicate of his can 
> be optimised wrt memory usage, then he might try to declare that using 
> some other (new?) declaration?
> Using these 'hints for reuse', the compiler could try to focus on the 
> optimisation of these locations, and then only give feedback to the 
> programmer about these program points? In that case, the problem you 
> mention above of producing output for non-interesting places is also 
> solved....
> 
> Possible extension, like the pure, impure things:
> 
> p(X::in,...) :-
> 	...
> 	perhaps_unique X = f(... ),
> 	...
> 
> indicating that that deconstruction might, according to the programmer, 
> be the last use of the structure X is pointing to...

I'm currently writing up my uniqueness analysis ideas as a pseudo-
Mercury program (i.e. it gives the semantics, but not, at this point, a
terminating program).  The analysis should automatically detect reusable
cells from dead, unique local constructions.  However, I have not as yet
considered cross-procedure analysis or mode inference.

-- Ralph
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list