[m-dev.] for review: fix existential types bug

Simon Taylor stayl at cs.mu.OZ.AU
Mon Oct 25 16:49:53 AEST 1999


> > Actually, no I won't. For that case there is a polymorphically typed
> > variable (X), so the quantification pass will by run by
> > polymorphism__fixup_quantification. The problem I fixed occurs for
> > existentially typed _constructions_. If the types are ground, the
> > type-infos are local to the conjunction. If the types are non-ground,
> > polymorphism__fixup_quantification will requantify the goal.
> > The case above is a deconstruction, which will always introduce a new
> > type variable, and quantification will be run.
> 
> OK, that is fine.
> But it might be a good idea to add a comment.
 

Index: polymorphism.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/polymorphism.m,v
retrieving revision 1.175
diff -u -u -r1.175 polymorphism.m
--- polymorphism.m	1999/10/25 03:49:29	1.175
+++ polymorphism.m	1999/10/25 06:37:09
@@ -1877,9 +1877,18 @@
 %
 % If the pred we are processing is a polymorphic predicate,
 % or contains polymorphically-typed goals, we
-% may need to fix up the quantification (non-local variables)
+% may need to fix up the quantification (non-local variables) of the goal
 % so that it includes the extra type-info variables and type-class-info
-% variables that we added to the headvars in the non-locals set.
+% variables that we added to the headvars or the arguments of 
+% existentially typed predicate calls, function calls and deconstruction
+% unifications.
+%
+% Type(class)-infos for ground types added to predicate calls, function calls
+% and existentially typed construction unifications do not require
+% requantification because they are local to the conjunction containing
+% the type(class)-info construction and the goal which uses the
+% type(class)-info. The non-locals for those goals are adjusted by
+% the code which creates/alters them.
 %
 
 polymorphism__fixup_quantification(HeadVars, ExistQVars, Goal0, Goal,
--------------------------------------------------------------------------
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