[m-rev.] diff: always treat higher-order types as zero sized

Julien Fischer juliensf at cs.mu.OZ.AU
Fri Apr 8 09:35:01 AEST 2005


Estimated hours taken: 0.5
Branches: main

Standardise the sizes of higher-order types in the
termination analysers and the term-size profiler by
making term_norm.m treat higher-order types as zero sized.
This has always been the case in the termination analysers
and the term-size profiler, which are the only things that
use term_norm, anyway.

compiler/term_norm.m:
	Change the definition of zero size types so that
	higher-order types are always considered zero sized.

compiler/size_prof.m:
compiler/term_constr_util.m:
	Minor changes to conform to the above.

Julien.

Index: compiler/size_prof.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/size_prof.m,v
retrieving revision 1.17
diff -u -r1.17 size_prof.m
--- compiler/size_prof.m	24 Mar 2005 05:34:15 -0000	1.17
+++ compiler/size_prof.m	7 Apr 2005 06:44:04 -0000
@@ -799,14 +799,6 @@
 		ArgGoals = []
 	; zero_size_type(Type, !.Info ^ module_info) ->
 		ArgGoals = []
-	; type_is_higher_order(Type, _, _, _, _) ->
-		% Even if higher order types are not zero size for thes
-		% termination analyzer, they are zero size for us.
-		% If the type is a function type, then make_type_info below
-		% would in any case throw an exception, because it can't
-		% construct a function type with an empty list of arguments
-		% (since it has no return value type).
-		ArgGoals = []
 	;
 		make_type_info(Context, Type, TypeInfoVar, TypeInfoGoals,
 			!Info),
Index: compiler/term_constr_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/term_constr_util.m,v
retrieving revision 1.1
diff -u -r1.1 term_constr_util.m
--- compiler/term_constr_util.m	7 Apr 2005 06:32:16 -0000	1.1
+++ compiler/term_constr_util.m	7 Apr 2005 06:44:54 -0000
@@ -296,8 +296,6 @@
 		% in the constraints - they won't tell us anything
 		% useful.
 		type_util.is_dummy_argument_type(Type)
-	;
-		prog_type.type_is_higher_order(Type, _, _, _, _)
 	).

 add_context_to_constr_termination_info(no, _, no).
Index: compiler/term_norm.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/term_norm.m,v
retrieving revision 1.8
diff -u -r1.8 term_norm.m
--- compiler/term_norm.m	7 Apr 2005 06:32:16 -0000	1.8
+++ compiler/term_norm.m	7 Apr 2005 06:44:05 -0000
@@ -345,7 +345,7 @@
 zero_size_type_category(type_ctor_info_type, yes).
 zero_size_type_category(typeclass_info_type, yes).
 zero_size_type_category(base_typeclass_info_type, yes).
-zero_size_type_category(higher_order_type, no).
+zero_size_type_category(higher_order_type, yes).
 zero_size_type_category(tuple_type, no).
 zero_size_type_category(enum_type, yes).
 zero_size_type_category(variable_type, no).
--------------------------------------------------------------------------
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