[m-dev.] [reuse] diff: no termination info for reuse-predicates

Nancy Mazur Nancy.Mazur at cs.kuleuven.ac.be
Thu Nov 23 03:42:08 AEDT 2000


> On 21-Nov-2000, Nancy Mazur <Nancy.Mazur at cs.kuleuven.ac.be> wrote:
> > Make sure that no termination-info is written out for compiler
> > generated extra reuse-predicates ("reuse__...").
> 
> Why?

Due to the way the reuse-predicates are added. 

Here goes the description of the reuse-pragma's
	
:- pragma sr_reuse_info( PredNameModeDecl, Vars, YesNoReuse ). 

where 

* PredNameModeDecl obviously describes the predicate for which
the reuse-info is given
* Vars list the headvars on which the reuse-info is given
* YesNoReuse = 
	either `no' (no reuse ;-)
	or	`yes( Conditions, ReusePredName )'
If the reuse is conditional, a new predicate name is invented(*)
(with new pred_info, proc_info), and this yes/2 will in the same
time reveal the name to look for if there is a reuse-version.. 
(If Conditions = [], then the predicate has reuse, no matter
how it is going to be called.. no special reuse-version is needed, 
and so ReusePredName is the name of the predicate itself. 

The point is: these reuse-predicates are not explicitly declared
on themselves. They are implicitly declared by the declaration of
the predicate from which they are derived. Also, they inherit
all the characterics of the predicate of which they are derived, 
including for example aliasing information (though this should
be refined), and also termination... no separate termination-info
is required for them.. So let's not generate them.

The practical reason was: it wouldn't compile ;-) because it
then generates termination-info about things that are not 
explicitly declared and when processing that termination info, 
it tries to find the corresponding pred_info, which does not
exist (at that moment). 

Voila.. I fear the explanations are a bit, let's say, chaotic.. 
But I hope it'll do for now? 

Nancy

(*) The new name is simply derived from the initial name, e.g.:
:- pragma sr_reuse_info(list:append((builtin:di), (builtin:di), (builtin:uo)), vars(HeadVar__1, HeadVar__2, HeadVar__3), yes([condition([cel(HeadVar__1, [])], [HeadVar__2], bottom)], 'list:reuse__pred__append__0__0')).

--------------------------------------------------------------------------
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