for review: rename base_type_* to type_ctor_* (part 2/2)

Tyson Dowd trd at cs.mu.OZ.AU
Wed Mar 17 14:42:11 AEDT 1999


Index: library/std_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/std_util.m,v
retrieving revision 1.141
diff -u -r1.141 std_util.m
--- std_util.m	1999/02/07 14:07:24	1.141
+++ std_util.m	1999/03/16 05:27:53
@@ -1063,35 +1063,35 @@
 #ifdef  USE_TYPE_LAYOUT
 
 MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data_std_util__base_type_layout_univ_0_struct {
+const struct mercury_data_std_util__type_ctor_layout_univ_0_struct {
 	TYPE_LAYOUT_FIELDS
-} mercury_data_std_util__base_type_layout_univ_0 = {
-	make_typelayout_for_all_tags(TYPELAYOUT_CONST_TAG, 
-		mkbody(TYPELAYOUT_UNIV_VALUE))
+} mercury_data_std_util__type_ctor_layout_univ_0 = {
+	make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG, 
+		mkbody(TYPE_CTOR_LAYOUT_UNIV_VALUE))
 };
 
 MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data_std_util__base_type_functors_univ_0_struct {
+const struct mercury_data_std_util__type_ctor_functors_univ_0_struct {
 	Integer f1;
-} mercury_data_std_util__base_type_functors_univ_0 = {
-	MR_TYPEFUNCTORS_UNIV
+} mercury_data_std_util__type_ctor_functors_univ_0 = {
+	MR_TYPE_CTOR_FUNCTORS_UNIV
 };
 
 MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data_std_util__base_type_layout_type_info_0_struct
+const struct mercury_data_std_util__type_ctor_layout_type_info_0_struct
 {
 	TYPE_LAYOUT_FIELDS
-} mercury_data_std_util__base_type_layout_type_info_0 = {
-	make_typelayout_for_all_tags(TYPELAYOUT_CONST_TAG, 
-		mkbody(TYPELAYOUT_TYPEINFO_VALUE))
+} mercury_data_std_util__type_ctor_layout_type_info_0 = {
+	make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG, 
+		mkbody(TYPE_CTOR_LAYOUT_TYPEINFO_VALUE))
 };
 
 MR_MODULE_STATIC_OR_EXTERN
 const struct
-mercury_data_std_util__base_type_functors_type_info_0_struct {
+mercury_data_std_util__type_ctor_functors_type_info_0_struct {
 	Integer f1;
-} mercury_data_std_util__base_type_functors_type_info_0 = {
-	MR_TYPEFUNCTORS_SPECIAL
+} mercury_data_std_util__type_ctor_functors_type_info_0 = {
+	MR_TYPE_CTOR_FUNCTORS_SPECIAL
 };
 
 #endif
@@ -1320,12 +1320,12 @@
 				Word term_vector);
 bool	ML_typecheck_arguments(Word type_info, int arity, 
 				Word arg_list, Word* arg_vector);
-Word 	ML_make_type(int arity, Word *base_type_info, Word arg_type_list);
+Word 	ML_make_type(int arity, Word *type_ctor_info, Word arg_type_list);
 
 ").
 
 
-	% A type_ctor_info is represented as a pointer to a base_type_info,
+	% A type_ctor_info is represented as a pointer to a type_ctor_info,
 	% except for higher-order types, which are represented using
 	% small integers.  See runtime/type_info.h.
 :- type type_ctor_info == c_pointer.  
@@ -1433,28 +1433,28 @@
 :- pragma c_code(type_ctor(TypeInfo::in) = (TypeCtor::out), 
 	will_not_call_mercury, "
 {
-	Word *type_info, *base_type_info;
+	Word *type_info, *type_ctor_info;
 
 	save_transient_registers();
 	type_info = (Word *) MR_collapse_equivalences(TypeInfo);
 	restore_transient_registers();
 
-	base_type_info = (Word *) MR_TYPEINFO_GET_BASE_TYPEINFO(type_info);
+	type_ctor_info = (Word *) MR_TYPEINFO_GET_TYPE_CTOR_INFO(type_info);
 
-	TypeCtor = ML_make_ctor_info(type_info, base_type_info);
+	TypeCtor = ML_make_ctor_info(type_info, type_ctor_info);
 }
 ").
 
 :- pragma c_header_code("
 
-Word ML_make_ctor_info(Word *type_info, Word *base_type_info);
+Word ML_make_ctor_info(Word *type_info, Word *type_ctor_info);
 
 	/*
-	** Several predicates use these (the MR_BASE_TYPEINFO_IS_HO_*
+	** Several predicates use these (the MR_TYPE_CTOR_INFO_IS_HO_*
 	** macros need access to these addresses).
 	*/
-MR_DECLARE_STRUCT(mercury_data___base_type_info_pred_0);
-MR_DECLARE_STRUCT(mercury_data___base_type_info_func_0);
+MR_DECLARE_STRUCT(mercury_data___type_ctor_info_pred_0);
+MR_DECLARE_STRUCT(mercury_data___type_ctor_info_func_0);
 
 
 ").
@@ -1462,18 +1462,18 @@
 :- pragma c_code("
 
 
-Word ML_make_ctor_info(Word *type_info, Word *base_type_info)
+Word ML_make_ctor_info(Word *type_info, Word *type_ctor_info)
 {
-	Word ctor_info = (Word) base_type_info;
+	Word ctor_info = (Word) type_ctor_info;
 
-	if (MR_BASE_TYPEINFO_IS_HO_PRED(base_type_info)) {
+	if (MR_TYPE_CTOR_INFO_IS_HO_PRED(type_ctor_info)) {
 		ctor_info = MR_TYPECTOR_MAKE_PRED(
 			MR_TYPEINFO_GET_HIGHER_ARITY(type_info));
 		if (!MR_TYPECTOR_IS_HIGHER_ORDER(ctor_info)) {
 			fatal_error(""std_util:ML_make_ctor_info""
 				""- arity out of range."");
 		}
-	} else if (MR_BASE_TYPEINFO_IS_HO_FUNC(base_type_info)) {
+	} else if (MR_TYPE_CTOR_INFO_IS_HO_FUNC(type_ctor_info)) {
 		ctor_info = MR_TYPECTOR_MAKE_FUNC(
 			MR_TYPEINFO_GET_HIGHER_ARITY(type_info));
 		if (!MR_TYPECTOR_IS_HIGHER_ORDER(ctor_info)) {
@@ -1490,20 +1490,20 @@
 :- pragma c_code(type_ctor_and_args(TypeInfo::in,
 		TypeCtor::out, TypeArgs::out), will_not_call_mercury, "
 {
-	Word *type_info, *base_type_info;
+	Word *type_info, *type_ctor_info;
 	Integer arity;
 
 	save_transient_registers();
 	type_info = (Word *) MR_collapse_equivalences(TypeInfo);
-	base_type_info = MR_TYPEINFO_GET_BASE_TYPEINFO(type_info);
-	TypeCtor = ML_make_ctor_info(type_info, base_type_info);
+	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO(type_info);
+	TypeCtor = ML_make_ctor_info(type_info, type_ctor_info);
 
 	if (MR_TYPECTOR_IS_HIGHER_ORDER(TypeCtor)) {
 		arity = MR_TYPECTOR_GET_HOT_ARITY(TypeCtor);
 		TypeArgs = ML_copy_argument_typeinfos(arity, 0,
 			type_info + TYPEINFO_OFFSET_FOR_PRED_ARGS);
 	} else {
-		arity = MR_BASE_TYPEINFO_GET_TYPE_ARITY(base_type_info);
+		arity = MR_TYPE_CTOR_INFO_GET_TYPE_ARITY(type_ctor_info);
 		TypeArgs = ML_copy_argument_typeinfos(arity, 0,
 			type_info + OFFSET_FOR_ARG_TYPE_INFOS);
 	}
@@ -1526,14 +1526,14 @@
 {
 	int list_length, arity;
 	Word arg_type;
-	Word *base_type_info;
+	Word *type_ctor_info;
 	
-	base_type_info = (Word *) TypeCtor;
+	type_ctor_info = (Word *) TypeCtor;
 
-	if (MR_TYPECTOR_IS_HIGHER_ORDER(base_type_info)) {
-		arity = MR_TYPECTOR_GET_HOT_ARITY(base_type_info);
+	if (MR_TYPECTOR_IS_HIGHER_ORDER(type_ctor_info)) {
+		arity = MR_TYPECTOR_GET_HOT_ARITY(type_ctor_info);
 	} else {
-		arity = MR_BASE_TYPEINFO_GET_TYPE_ARITY(base_type_info);
+		arity = MR_TYPE_CTOR_INFO_GET_TYPE_ARITY(type_ctor_info);
 	}
 
 	arg_type = ArgTypes; 
@@ -1545,7 +1545,7 @@
 		SUCCESS_INDICATOR = FALSE;
 	} else {
 		save_transient_registers();
-		Type = ML_make_type(arity, base_type_info, ArgTypes);
+		Type = ML_make_type(arity, type_ctor_info, ArgTypes);
 		restore_transient_registers();
 		SUCCESS_INDICATOR = TRUE;
 	}
@@ -1562,18 +1562,18 @@
 		will_not_call_mercury, "
 {
 	Word *type_info = (Word *) TypeInfo;
-	Word *base_type_info = MR_TYPEINFO_GET_BASE_TYPEINFO(type_info);
+	Word *type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO(type_info);
 	Integer arity;
 
-	TypeCtor = ML_make_ctor_info(type_info, base_type_info);
+	TypeCtor = ML_make_ctor_info(type_info, type_ctor_info);
 	if (MR_TYPECTOR_IS_HIGHER_ORDER(TypeCtor)) {
-		arity = MR_TYPECTOR_GET_HOT_ARITY(base_type_info);
+		arity = MR_TYPECTOR_GET_HOT_ARITY(type_ctor_info);
 		save_transient_registers();
 		ArgTypes = ML_copy_argument_typeinfos(arity, 0,
 			type_info + TYPEINFO_OFFSET_FOR_PRED_ARGS);
 		restore_transient_registers();
 	} else {
-		arity = MR_BASE_TYPEINFO_GET_TYPE_ARITY(base_type_info);
+		arity = MR_TYPE_CTOR_INFO_GET_TYPE_ARITY(type_ctor_info);
 		save_transient_registers();
 		ArgTypes = ML_copy_argument_typeinfos(arity, 0,
 			type_info + OFFSET_FOR_ARG_TYPE_INFOS);
@@ -1595,10 +1595,10 @@
 			MR_TYPECTOR_GET_HOT_MODULE_NAME(type_ctor);
 		TypeCtorArity = MR_TYPECTOR_GET_HOT_ARITY(type_ctor);
 	} else {
-		TypeCtorName = MR_BASE_TYPEINFO_GET_TYPE_NAME(type_ctor);
-		TypeCtorArity = MR_BASE_TYPEINFO_GET_TYPE_ARITY(type_ctor);
+		TypeCtorName = MR_TYPE_CTOR_INFO_GET_TYPE_NAME(type_ctor);
+		TypeCtorArity = MR_TYPE_CTOR_INFO_GET_TYPE_ARITY(type_ctor);
 		TypeCtorModuleName = 
-			MR_BASE_TYPEINFO_GET_TYPE_MODULE_NAME(type_ctor);
+			MR_TYPE_CTOR_INFO_GET_TYPE_MODULE_NAME(type_ctor);
 	}
 }
 ").
@@ -1675,11 +1675,11 @@
 		*/
 	if (success) {
 
-		layout_entry = MR_BASE_TYPEINFO_GET_TYPELAYOUT_ENTRY(
-			MR_TYPEINFO_GET_BASE_TYPEINFO((Word *) TypeInfo), 
+		layout_entry = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_LAYOUT_ENTRY(
+			MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) TypeInfo), 
 				info.primary_tag);
 
-		if (info.vector_type == MR_TYPEFUNCTORS_ENUM) {
+		if (info.vector_type == MR_TYPE_CTOR_FUNCTORS_ENUM) {
 			/*
 			** Enumeratiors don't have tags or arguments,
 			** just the enumeration value.
@@ -1690,7 +1690,7 @@
 			** It must be some sort of tagged functor.
 			*/
 
-			if (info.vector_type == MR_TYPEFUNCTORS_NO_TAG) {
+			if (info.vector_type == MR_TYPE_CTOR_FUNCTORS_NO_TAG) {
 
 				/*
 				** We set term_vector to point to
@@ -1701,7 +1701,7 @@
 				term_vector = (Word) &new_data;
 
 			} else if (tag(layout_entry) == 
-					TYPELAYOUT_COMPLICATED_TAG) {
+					TYPE_CTOR_LAYOUT_COMPLICATED_TAG) {
 
 				/*
 				** Create arity + 1 words, fill in the
@@ -1712,7 +1712,7 @@
 				field(0, new_data, 0) = info.secondary_tag;
 				term_vector = (Word) (new_data + sizeof(Word));
 
-			} else if (tag(layout_entry) == TYPELAYOUT_CONST_TAG) {
+			} else if (tag(layout_entry) == TYPE_CTOR_LAYOUT_CONST_TAG) {
 
 				/* 
 				** If it's a du, and this tag is
@@ -1785,66 +1785,66 @@
 int 
 ML_get_functor_info(Word type_info, int functor_number, ML_Construct_Info *info)
 {
-	Word *base_type_functors;
+	Word *type_ctor_functors;
 
-	base_type_functors = MR_BASE_TYPEINFO_GET_TYPEFUNCTORS(
-		MR_TYPEINFO_GET_BASE_TYPEINFO((Word *) type_info));
+	type_ctor_functors = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_FUNCTORS(
+		MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) type_info));
 
-	info->vector_type = MR_TYPEFUNCTORS_INDICATOR(base_type_functors);
+	info->vector_type = MR_TYPE_CTOR_FUNCTORS_INDICATOR(type_ctor_functors);
 
 	switch (info->vector_type) {
 
-	case MR_TYPEFUNCTORS_ENUM:
-		info->functors_vector = MR_TYPEFUNCTORS_ENUM_FUNCTORS(
-				base_type_functors);
+	case MR_TYPE_CTOR_FUNCTORS_ENUM:
+		info->functors_vector = MR_TYPE_CTOR_FUNCTORS_ENUM_FUNCTORS(
+				type_ctor_functors);
 		info->arity = 0;
 		info->argument_vector = NULL;
 		info->primary_tag = 0;
 		info->secondary_tag = functor_number;
-		info->functor_name = MR_TYPELAYOUT_ENUM_VECTOR_FUNCTOR_NAME(
+		info->functor_name = MR_TYPE_CTOR_LAYOUT_ENUM_VECTOR_FUNCTOR_NAME(
 				info->functors_vector, functor_number);
 		break; 
 
-	case MR_TYPEFUNCTORS_DU:
-		info->functors_vector = MR_TYPEFUNCTORS_DU_FUNCTOR_N(
-				base_type_functors, functor_number);
-		info->arity = MR_TYPELAYOUT_SIMPLE_VECTOR_ARITY(
+	case MR_TYPE_CTOR_FUNCTORS_DU:
+		info->functors_vector = MR_TYPE_CTOR_FUNCTORS_DU_FUNCTOR_N(
+				type_ctor_functors, functor_number);
+		info->arity = MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_ARITY(
 			info->functors_vector);
-		info->argument_vector = MR_TYPELAYOUT_SIMPLE_VECTOR_ARGS(
+		info->argument_vector = MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_ARGS(
 				info->functors_vector);
-		info->primary_tag = tag(MR_TYPELAYOUT_SIMPLE_VECTOR_TAG(
+		info->primary_tag = tag(MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_TAG(
 			info->functors_vector));
 		info->secondary_tag = unmkbody(
-			body(MR_TYPELAYOUT_SIMPLE_VECTOR_TAG(
+			body(MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_TAG(
 				info->functors_vector), info->primary_tag));
-		info->functor_name = MR_TYPELAYOUT_SIMPLE_VECTOR_FUNCTOR_NAME(
+		info->functor_name = MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_FUNCTOR_NAME(
 				info->functors_vector);
 		break; 
 
-	case MR_TYPEFUNCTORS_NO_TAG:
-		info->functors_vector = MR_TYPEFUNCTORS_NO_TAG_FUNCTOR(
-				base_type_functors);
+	case MR_TYPE_CTOR_FUNCTORS_NO_TAG:
+		info->functors_vector = MR_TYPE_CTOR_FUNCTORS_NO_TAG_FUNCTOR(
+				type_ctor_functors);
 		info->arity = 1;
-		info->argument_vector = MR_TYPELAYOUT_NO_TAG_VECTOR_ARGS(
+		info->argument_vector = MR_TYPE_CTOR_LAYOUT_NO_TAG_VECTOR_ARGS(
 				info->functors_vector);
 		info->primary_tag = 0;
 		info->secondary_tag = 0;
-		info->functor_name = MR_TYPELAYOUT_NO_TAG_VECTOR_FUNCTOR_NAME(
+		info->functor_name = MR_TYPE_CTOR_LAYOUT_NO_TAG_VECTOR_FUNCTOR_NAME(
 				info->functors_vector);
 		break; 
 
-	case MR_TYPEFUNCTORS_EQUIV: {
+	case MR_TYPE_CTOR_FUNCTORS_EQUIV: {
 		Word *equiv_type;
-		equiv_type = (Word *) MR_TYPEFUNCTORS_EQUIV_TYPE(
-				base_type_functors);
+		equiv_type = (Word *) MR_TYPE_CTOR_FUNCTORS_EQUIV_TYPE(
+				type_ctor_functors);
 		return ML_get_functor_info((Word)
 				MR_create_type_info((Word *) type_info, 
 						equiv_type),
 				functor_number, info);
 	}
-	case MR_TYPEFUNCTORS_SPECIAL:
+	case MR_TYPE_CTOR_FUNCTORS_SPECIAL:
 		return FALSE;
-	case MR_TYPEFUNCTORS_UNIV:
+	case MR_TYPE_CTOR_FUNCTORS_UNIV:
 		return FALSE;
 	default:
 		fatal_error(""std_util:construct - unexpected type."");
@@ -1923,7 +1923,7 @@
 
 
 	/*
-	** ML_make_type(arity, base_type_info, arg_types_list):
+	** ML_make_type(arity, type_ctor_info, arg_types_list):
 	**
 	** Construct and return a type_info for a type using the
 	** specified type_ctor for the type constructor,
@@ -1931,7 +1931,7 @@
 	** for the type arguments (if any).
 	**
 	** Assumes that the arity of the type constructor represented
-	** by base_type_info and the length of the arg_types_list 
+	** by type_ctor_info and the length of the arg_types_list 
 	** are both equal to `arity'.
 	**
 	** You need to save and restore transient registers around
@@ -1942,21 +1942,21 @@
 ML_make_type(int arity, Word *type_ctor, Word arg_types_list) 
 {
 	int i, extra_args;
-	Word base_type_info;
+	Word type_ctor_info;
 
 	/*
 	** We need to treat higher-order predicates as a special case here.
 	*/
 	if (MR_TYPECTOR_IS_HIGHER_ORDER(type_ctor)) {
-		base_type_info = MR_TYPECTOR_GET_HOT_BASE_TYPE_INFO(type_ctor);
+		type_ctor_info = MR_TYPECTOR_GET_HOT_TYPE_CTOR_INFO(type_ctor);
 		extra_args = 2;
 	} else {
-		base_type_info = (Word) type_ctor;
+		type_ctor_info = (Word) type_ctor;
 		extra_args = 1;
 	}
 
 	if (arity == 0) {
-		return base_type_info;
+		return type_ctor_info;
 	} else {
 		Word *type_info;
 
@@ -1964,7 +1964,7 @@
 		incr_hp(LVALUE_CAST(Word, type_info), arity + extra_args);
 		save_transient_registers();
 		
-		field(mktag(0), type_info, 0) = base_type_info;
+		field(mktag(0), type_info, 0) = type_ctor_info;
 		if (MR_TYPECTOR_IS_HIGHER_ORDER(type_ctor)) {
 			field(mktag(0), type_info, 1) = (Word) arity;
 		}
@@ -2061,44 +2061,44 @@
 int 
 ML_get_num_functors(Word type_info)
 {
-	Word *base_type_functors;
+	Word *type_ctor_functors;
 	int Functors;
 
-	base_type_functors = MR_BASE_TYPEINFO_GET_TYPEFUNCTORS(
-		MR_TYPEINFO_GET_BASE_TYPEINFO((Word *) type_info));
+	type_ctor_functors = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_FUNCTORS(
+		MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) type_info));
 
-	switch ((int) MR_TYPEFUNCTORS_INDICATOR(base_type_functors)) {
+	switch ((int) MR_TYPE_CTOR_FUNCTORS_INDICATOR(type_ctor_functors)) {
 
-		case MR_TYPEFUNCTORS_DU:
-			Functors = MR_TYPEFUNCTORS_DU_NUM_FUNCTORS(
-					base_type_functors);
+		case MR_TYPE_CTOR_FUNCTORS_DU:
+			Functors = MR_TYPE_CTOR_FUNCTORS_DU_NUM_FUNCTORS(
+					type_ctor_functors);
 			break;
 
-		case MR_TYPEFUNCTORS_ENUM:
-			Functors = MR_TYPEFUNCTORS_ENUM_NUM_FUNCTORS(
-					base_type_functors);
+		case MR_TYPE_CTOR_FUNCTORS_ENUM:
+			Functors = MR_TYPE_CTOR_FUNCTORS_ENUM_NUM_FUNCTORS(
+					type_ctor_functors);
 			break;
 
-		case MR_TYPEFUNCTORS_EQUIV: {
+		case MR_TYPE_CTOR_FUNCTORS_EQUIV: {
 			Word *equiv_type;
 			equiv_type = (Word *) 
-				MR_TYPEFUNCTORS_EQUIV_TYPE(
-					base_type_functors);
+				MR_TYPE_CTOR_FUNCTORS_EQUIV_TYPE(
+					type_ctor_functors);
 			Functors = ML_get_num_functors((Word)
 					MR_create_type_info((Word *) 
 						type_info, equiv_type));
 			break;
 		}
 
-		case MR_TYPEFUNCTORS_SPECIAL:
+		case MR_TYPE_CTOR_FUNCTORS_SPECIAL:
 			Functors = -1;
 			break;
 
-		case MR_TYPEFUNCTORS_NO_TAG:
+		case MR_TYPE_CTOR_FUNCTORS_NO_TAG:
 			Functors = 1;
 			break;
 
-		case MR_TYPEFUNCTORS_UNIV:
+		case MR_TYPE_CTOR_FUNCTORS_UNIV:
 			Functors = -1;
 			break;
 
@@ -2184,7 +2184,7 @@
 ** the Mercury heap. The type_infos that the elements of
 ** this vector point to are either
 ** 	- already allocated on the heap.
-** 	- constants (eg base_type_infos)
+** 	- constants (eg type_ctor_infos)
 **
 ** Please note: 
 **	ML_expand increments the heap pointer, however, on
@@ -2207,15 +2207,15 @@
 ML_expand(Word* type_info, Word *data_word_ptr, ML_Expand_Info *info)
 {
     Code *compare_pred;
-    Word *base_type_info, *base_type_functors;
-    Word data_value, entry_value, base_type_layout_entry, functors_indicator;
+    Word *type_ctor_info, *type_ctor_functors;
+    Word data_value, entry_value, type_ctor_layout_entry, functors_indicator;
     int data_tag, entry_tag; 
     Word data_word;
     enum MR_DataRepresentation data_rep;
 
-    base_type_info = MR_TYPEINFO_GET_BASE_TYPEINFO(type_info);
+    type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO(type_info);
 
-    compare_pred = (Code *) base_type_info[OFFSET_FOR_COMPARE_PRED];
+    compare_pred = (Code *) type_ctor_info[OFFSET_FOR_COMPARE_PRED];
     info->non_canonical_type = ( compare_pred ==
         ENTRY(mercury__builtin_compare_non_canonical_type_3_0) );
 
@@ -2223,20 +2223,20 @@
     data_tag = tag(data_word);
     data_value = body(data_word, data_tag);
 	
-    base_type_layout_entry = MR_BASE_TYPEINFO_GET_TYPELAYOUT_ENTRY(
-        base_type_info, data_tag);
-    base_type_functors = MR_BASE_TYPEINFO_GET_TYPEFUNCTORS(base_type_info);
-    functors_indicator = MR_TYPEFUNCTORS_INDICATOR(base_type_functors);
+    type_ctor_layout_entry = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_LAYOUT_ENTRY(
+        type_ctor_info, data_tag);
+    type_ctor_functors = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_FUNCTORS(type_ctor_info);
+    functors_indicator = MR_TYPE_CTOR_FUNCTORS_INDICATOR(type_ctor_functors);
 
 
-    data_rep = MR_categorize_data(functors_indicator, base_type_layout_entry);
+    data_rep = MR_categorize_data(functors_indicator, type_ctor_layout_entry);
 
-    entry_value = strip_tag(base_type_layout_entry);
+    entry_value = strip_tag(type_ctor_layout_entry);
 
     switch(data_rep) {
 
         case MR_DATAREP_ENUM:
-            info->functor = MR_TYPELAYOUT_ENUM_VECTOR_FUNCTOR_NAME(
+            info->functor = MR_TYPE_CTOR_LAYOUT_ENUM_VECTOR_FUNCTOR_NAME(
                 entry_value, data_word);
             info->arity = 0;
             info->argument_vector = NULL;
@@ -2245,7 +2245,7 @@
 
         case MR_DATAREP_COMPLICATED_CONST:
             data_value = unmkbody(data_value);
-            info->functor = MR_TYPELAYOUT_ENUM_VECTOR_FUNCTOR_NAME(
+            info->functor = MR_TYPE_CTOR_LAYOUT_ENUM_VECTOR_FUNCTOR_NAME(
                 entry_value, data_value);
             info->arity = 0;
             info->argument_vector = NULL;
@@ -2263,7 +2263,7 @@
                  */
             data_value = (Word) ((Word *) data_value + 1);
             entry_value = (Word)
-	    	MR_TYPELAYOUT_COMPLICATED_VECTOR_GET_SIMPLE_VECTOR(
+	    	MR_TYPE_CTOR_LAYOUT_COMPLICATED_VECTOR_GET_SIMPLE_VECTOR(
 		    entry_value, secondary_tag);
             entry_value = strip_tag(entry_value);
         }   /* fallthru */
@@ -2274,11 +2274,11 @@
 	    Word * simple_vector = (Word *) entry_value;
 
             info->arity =
-	    MR_TYPELAYOUT_SIMPLE_VECTOR_ARITY(simple_vector);
+	    MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_ARITY(simple_vector);
 	
             if (info->need_functor) {
                 make_aligned_string(info->functor, 
-                    MR_TYPELAYOUT_SIMPLE_VECTOR_FUNCTOR_NAME(
+                    MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_FUNCTOR_NAME(
                     simple_vector));
             }
 
@@ -2291,7 +2291,7 @@
                     Word *arg_pseudo_type_info;
 
                     arg_pseudo_type_info = (Word *)
-                        MR_TYPELAYOUT_SIMPLE_VECTOR_ARGS(simple_vector)[i];
+                        MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_ARGS(simple_vector)[i];
                     info->type_info_vector[i] = (Word) MR_create_type_info(
                         type_info, arg_pseudo_type_info);
                 }
@@ -2306,11 +2306,11 @@
 
             data_value = (Word) data_word_ptr;
 
-            info->arity = MR_TYPELAYOUT_SIMPLE_VECTOR_ARITY(simple_vector);
+            info->arity = MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_ARITY(simple_vector);
 	
             if (info->need_functor) {
                 make_aligned_string(info->functor, 
-                    MR_TYPELAYOUT_SIMPLE_VECTOR_FUNCTOR_NAME(
+                    MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_FUNCTOR_NAME(
                     simple_vector));
             }
 
@@ -2328,7 +2328,7 @@
                     Word *arg_pseudo_type_info;
 
                     arg_pseudo_type_info = (Word *)
-                        MR_TYPELAYOUT_SIMPLE_VECTOR_ARGS(simple_vector)[i];
+                        MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_ARGS(simple_vector)[i];
                     info->type_info_vector[i] = (Word) MR_create_type_info(
                         type_info, arg_pseudo_type_info);
                 }
@@ -2339,7 +2339,7 @@
             Word *equiv_type_info;
 
 			equiv_type_info = MR_create_type_info(type_info, 
-				(Word *) MR_TYPELAYOUT_EQUIV_TYPE(
+				(Word *) MR_TYPE_CTOR_LAYOUT_EQUIV_TYPE(
 					entry_value));
 			ML_expand(equiv_type_info, data_word_ptr, info);
             break;
Index: runtime/mercury_bootstrap.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_bootstrap.c,v
retrieving revision 1.6
diff -u -r1.6 mercury_bootstrap.c
--- mercury_bootstrap.c	1998/11/05 03:53:30	1.6
+++ mercury_bootstrap.c	1999/03/16 05:28:10
@@ -33,14 +33,14 @@
 Define_extern_entry(mercury____Compare___private_builtin__typeclass_info_1_0);
 
 extern const struct
-	mercury_data_private_builtin__base_type_layout_typeclass_info_1_struct 
-	mercury_data_private_builtin__base_type_layout_typeclass_info_1;
+	mercury_data_private_builtin__type_ctor_layout_typeclass_info_1_struct 
+	mercury_data_private_builtin__type_ctor_layout_typeclass_info_1;
 extern const struct
-	mercury_data_private_builtin__base_type_functors_typeclass_info_1_struct
-	mercury_data_private_builtin__base_type_functors_typeclass_info_1;
+	mercury_data_private_builtin__type_ctor_functors_typeclass_info_1_struct
+	mercury_data_private_builtin__type_ctor_functors_typeclass_info_1;
 
 MR_STATIC_CODE_CONST struct
-mercury_data_private_builtin__base_type_info_base_typeclass_info_1_struct {
+mercury_data_private_builtin__type_ctor_info_base_typeclass_info_1_struct {
 	Integer f1;
 	Code *f2;
 	Code *f3;
@@ -49,7 +49,7 @@
 	const Word *f6;
 	const Word *f7;
 	const Word *f8;
-} mercury_data_private_builtin__base_type_info_base_typeclass_info_1 = {
+} mercury_data_private_builtin__type_ctor_info_base_typeclass_info_1 = {
 	((Integer) 1),
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Unify___private_builtin__typeclass_info_1_0)),
@@ -58,15 +58,15 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Compare___private_builtin__typeclass_info_1_0)),
 	(const Word *) &
-	    mercury_data_private_builtin__base_type_layout_typeclass_info_1,
+	    mercury_data_private_builtin__type_ctor_layout_typeclass_info_1,
 	(const Word *) &
-	    mercury_data_private_builtin__base_type_functors_typeclass_info_1,
+	    mercury_data_private_builtin__type_ctor_functors_typeclass_info_1,
 	(const Word *) string_const("private_builtin", 15),
 	(const Word *) string_const("base_typeclass_info", 19)
 };
 
 MR_STATIC_CODE_CONST struct
-mercury_data_private_builtin__base_type_info_typeclass_info_1_struct {
+mercury_data_private_builtin__type_ctor_info_typeclass_info_1_struct {
 	Integer f1;
 	Code *f2;
 	Code *f3;
@@ -75,7 +75,7 @@
 	const Word *f6;
 	const Word *f7;
 	const Word *f8;
-} mercury_data_private_builtin__base_type_info_typeclass_info_1 = {
+} mercury_data_private_builtin__type_ctor_info_typeclass_info_1 = {
 	((Integer) 1),
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Unify___private_builtin__typeclass_info_1_0)),
@@ -84,25 +84,25 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Compare___private_builtin__typeclass_info_1_0)),
 	(const Word *) &
-	    mercury_data_private_builtin__base_type_layout_typeclass_info_1,
+	    mercury_data_private_builtin__type_ctor_layout_typeclass_info_1,
 	(const Word *) &
-	    mercury_data_private_builtin__base_type_functors_typeclass_info_1,
+	    mercury_data_private_builtin__type_ctor_functors_typeclass_info_1,
 	(const Word *) string_const("private_builtin", 15),
 	(const Word *) string_const("typeclass_info", 14)
 };
 
 const struct
-mercury_data_private_builtin__base_type_layout_typeclass_info_1_struct {
+mercury_data_private_builtin__type_ctor_layout_typeclass_info_1_struct {
 	TYPE_LAYOUT_FIELDS
-} mercury_data_private_builtin__base_type_layout_typeclass_info_1 = {
-	make_typelayout_for_all_tags(TYPELAYOUT_CONST_TAG, 
-		mkbody(MR_TYPELAYOUT_TYPECLASSINFO_VALUE))
+} mercury_data_private_builtin__type_ctor_layout_typeclass_info_1 = {
+	make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG, 
+		mkbody(MR_TYPE_CTOR_LAYOUT_TYPECLASSINFO_VALUE))
 };
 
-const struct mercury_data_private_builtin__base_type_functors_typeclass_info_1_struct {
+const struct mercury_data_private_builtin__type_ctor_functors_typeclass_info_1_struct {
 	Integer f1;
-} mercury_data_private_builtin__base_type_functors_typeclass_info_1 = {
-	MR_TYPEFUNCTORS_SPECIAL
+} mercury_data_private_builtin__type_ctor_functors_typeclass_info_1 = {
+	MR_TYPE_CTOR_FUNCTORS_SPECIAL
 };
 
 BEGIN_MODULE(typeclass_info_module)
Index: runtime/mercury_bootstrap.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_bootstrap.h,v
retrieving revision 1.4
diff -u -r1.4 mercury_bootstrap.h
--- mercury_bootstrap.h	1998/12/16 16:35:38	1.4
+++ mercury_bootstrap.h	1999/03/17 01:36:24
@@ -50,23 +50,121 @@
 			} while (0)
 
 
-#define TYPELAYOUT_UNASSIGNED_VALUE	(MR_TYPELAYOUT_UNASSIGNED_VALUE)
-#define TYPELAYOUT_UNUSED_VALUE		(MR_TYPELAYOUT_UNUSED_VALUE)
-#define TYPELAYOUT_STRING_VALUE		(MR_TYPELAYOUT_STRING_VALUE)
-#define TYPELAYOUT_FLOAT_VALUE		(MR_TYPELAYOUT_FLOAT_VALUE)
-#define TYPELAYOUT_INT_VALUE		(MR_TYPELAYOUT_INT_VALUE)
-#define TYPELAYOUT_CHARACTER_VALUE	(MR_TYPELAYOUT_CHARACTER_VALUE)
-#define TYPELAYOUT_UNIV_VALUE		(MR_TYPELAYOUT_UNIV_VALUE)
-#define TYPELAYOUT_PREDICATE_VALUE	(MR_TYPELAYOUT_PREDICATE_VALUE)
-#define TYPELAYOUT_VOID_VALUE		(MR_TYPELAYOUT_VOID_VALUE)
-#define TYPELAYOUT_ARRAY_VALUE		(MR_TYPELAYOUT_ARRAY_VALUE)
-#define TYPELAYOUT_TYPEINFO_VALUE	(MR_TYPELAYOUT_TYPEINFO_VALUE)
-#define TYPELAYOUT_C_POINTER_VALUE	(MR_TYPELAYOUT_C_POINTER_VALUE)
+#define TYPE_CTOR_LAYOUT_UNASSIGNED_VALUE	(MR_TYPE_CTOR_LAYOUT_UNASSIGNED_VALUE)
+#define TYPE_CTOR_LAYOUT_UNUSED_VALUE		(MR_TYPE_CTOR_LAYOUT_UNUSED_VALUE)
+#define TYPE_CTOR_LAYOUT_STRING_VALUE		(MR_TYPE_CTOR_LAYOUT_STRING_VALUE)
+#define TYPE_CTOR_LAYOUT_FLOAT_VALUE		(MR_TYPE_CTOR_LAYOUT_FLOAT_VALUE)
+#define TYPE_CTOR_LAYOUT_INT_VALUE		(MR_TYPE_CTOR_LAYOUT_INT_VALUE)
+#define TYPE_CTOR_LAYOUT_CHARACTER_VALUE	(MR_TYPE_CTOR_LAYOUT_CHARACTER_VALUE)
+#define TYPE_CTOR_LAYOUT_UNIV_VALUE		(MR_TYPE_CTOR_LAYOUT_UNIV_VALUE)
+#define TYPE_CTOR_LAYOUT_PREDICATE_VALUE	(MR_TYPE_CTOR_LAYOUT_PREDICATE_VALUE)
+#define TYPE_CTOR_LAYOUT_VOID_VALUE		(MR_TYPE_CTOR_LAYOUT_VOID_VALUE)
+#define TYPE_CTOR_LAYOUT_ARRAY_VALUE		(MR_TYPE_CTOR_LAYOUT_ARRAY_VALUE)
+#define TYPE_CTOR_LAYOUT_TYPEINFO_VALUE	(MR_TYPE_CTOR_LAYOUT_TYPEINFO_VALUE)
+#define TYPE_CTOR_LAYOUT_C_POINTER_VALUE	(MR_TYPE_CTOR_LAYOUT_C_POINTER_VALUE)
 
 /*
 ** The code generated by Mercury 0.8 includes references to these macros.
 */
 #define MR_OBTAIN_GLOBAL_C_LOCK()	MR_OBTAIN_GLOBAL_LOCK("pragma c code")
 #define MR_RELEASE_GLOBAL_C_LOCK()	MR_RELEASE_GLOBAL_LOCK("pragma c code")
+
+
+/*
+** Generated code will create references to base_type_* which has been
+** renamed.  Builtin types use hand-defined type_ctor_*, so we need to
+** #define the old names for these structures so the stage 1 compiler
+** will link.  The stage 2 compiler will just generate type_ctor_*
+** references anyway, so then these #defines are not needed.
+*/
+#define MR_INIT_BASE_TYPE_INFO		MR_INIT_TYPE_CTOR_INFO
+
+#define mercury_data_array__base_type_functors_array_1 \
+	mercury_data_array__type_ctor_functors_array_1 
+
+#define mercury_data_array__base_type_functors_array_1_struct \
+	mercury_data_array__type_ctor_functors_array_1_struct
+
+#define mercury_data_array__base_type_layout_array_1 \
+	mercury_data_array__type_ctor_layout_array_1 
+
+#define mercury_data_array__base_type_layout_array_1_struct \
+	mercury_data_array__type_ctor_layout_array_1_struct
+
+
+#define mercury_data_builtin__base_type_functors_c_pointer_0 \
+	mercury_data_builtin__type_ctor_functors_c_pointer_0 
+
+#define mercury_data_builtin__base_type_functors_c_pointer_0_struct \
+	mercury_data_builtin__type_ctor_functors_c_pointer_0_struct
+
+#define mercury_data_builtin__base_type_layout_c_pointer_0 \
+	mercury_data_builtin__type_ctor_layout_c_pointer_0 
+
+#define mercury_data_builtin__base_type_layout_c_pointer_0_struct \
+	mercury_data_builtin__type_ctor_layout_c_pointer_0_struct
+
+
+#define mercury_data_std_util__base_type_functors_type_info_0 \
+	mercury_data_std_util__type_ctor_functors_type_info_0 
+
+#define mercury_data_std_util__base_type_functors_type_info_0_struct \
+	mercury_data_std_util__type_ctor_functors_type_info_0_struct
+
+#define mercury_data_std_util__base_type_layout_type_info_0 \
+	mercury_data_std_util__type_ctor_layout_type_info_0 
+
+#define mercury_data_std_util__base_type_layout_type_info_0_struct \
+	mercury_data_std_util__type_ctor_layout_type_info_0_struct
+
+
+#define mercury_data_std_util__base_type_functors_univ_0 \
+	mercury_data_std_util__type_ctor_functors_univ_0 
+
+#define mercury_data_std_util__base_type_functors_univ_0_struct \
+	mercury_data_std_util__type_ctor_functors_univ_0_struct
+
+#define mercury_data_std_util__base_type_layout_univ_0 \
+	mercury_data_std_util__type_ctor_layout_univ_0 
+
+#define mercury_data_std_util__base_type_layout_univ_0_struct \
+	mercury_data_std_util__type_ctor_layout_univ_0_struct
+
+#define mercury_data___base_type_info_int_0_struct \
+	mercury_data___type_ctor_info_int_0_struct
+
+#define mercury_data___base_type_info_int_0 \
+	mercury_data___type_ctor_info_int_0
+
+#define mercury_data___base_type_info_string_0_struct \
+	mercury_data___type_ctor_info_string_0_struct
+
+#define mercury_data___base_type_info_string_0 \
+	mercury_data___type_ctor_info_string_0
+
+#define mercury_data___base_type_info_character_0 \
+	mercury_data___type_ctor_info_character_0
+
+#define mercury_data___base_type_info_character_0_struct \
+	mercury_data___type_ctor_info_character_0_struct
+
+#define mercury_data___base_type_info_float_0 \
+	mercury_data___type_ctor_info_float_0
+
+#define mercury_data___base_type_info_float_0_struct \
+	mercury_data___type_ctor_info_float_0_struct
+
+#define mercury_data___base_type_info_pred_0 \
+	mercury_data___type_ctor_info_pred_0
+
+#define mercury_data___base_type_info_pred_0_struct \
+	mercury_data___type_ctor_info_pred_0_struct
+
+#define mercury_data_private_builtin__base_type_info_type_info_1 \
+	mercury_data_private_builtin__type_ctor_info_type_info_1
+
+#define mercury_data_private_builtin__base_type_info_type_info_1_struct \
+	mercury_data_private_builtin__type_ctor_info_type_info_1_struct
+
 
 #endif	/* MERCURY_BOOTSTRAP_H */
Index: runtime/mercury_deep_copy.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_deep_copy.c,v
retrieving revision 1.11
diff -u -r1.11 mercury_deep_copy.c
--- mercury_deep_copy.c	1998/07/22 07:52:30	1.11
+++ mercury_deep_copy.c	1999/03/16 05:28:10
@@ -18,8 +18,8 @@
 #include "mercury_memory.h"
 
 
-MR_DECLARE_STRUCT(mercury_data___base_type_info_pred_0);
-MR_DECLARE_STRUCT(mercury_data___base_type_info_func_0);
+MR_DECLARE_STRUCT(mercury_data___type_ctor_info_pred_0);
+MR_DECLARE_STRUCT(mercury_data___type_ctor_info_func_0);
 
 /*
 ** deep_copy(): see mercury_deep_copy.h for documentation.
Index: runtime/mercury_deep_copy_body.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_deep_copy_body.h,v
retrieving revision 1.5
diff -u -r1.5 mercury_deep_copy_body.h
--- mercury_deep_copy_body.h	1999/03/02 09:46:10	1.5
+++ mercury_deep_copy_body.h	1999/03/16 05:28:10
@@ -26,7 +26,7 @@
 copy(maybeconst Word *data_ptr, const Word *type_info, 
          const Word *lower_limit, const Word *upper_limit)
 {
-    Word *base_type_info, *base_type_layout, *base_type_functors;
+    Word *type_ctor_info, *type_ctor_layout, *type_ctor_functors;
     Word functors_indicator;
     Word layout_entry, *entry_value, *data_value;
     enum MR_DataRepresentation data_rep;
@@ -38,12 +38,12 @@
     data_tag = tag(data);
     data_value = (Word *) body(data, data_tag);
 
-    base_type_info = MR_TYPEINFO_GET_BASE_TYPEINFO(type_info);
-    base_type_layout = MR_BASE_TYPEINFO_GET_TYPELAYOUT(base_type_info);
-    layout_entry = base_type_layout[data_tag];
+    type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO(type_info);
+    type_ctor_layout = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_LAYOUT(type_ctor_info);
+    layout_entry = type_ctor_layout[data_tag];
 
-    base_type_functors = MR_BASE_TYPEINFO_GET_TYPEFUNCTORS(base_type_info);
-    functors_indicator = MR_TYPEFUNCTORS_INDICATOR(base_type_functors);
+    type_ctor_functors = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_FUNCTORS(type_ctor_info);
+    functors_indicator = MR_TYPE_CTOR_FUNCTORS_INDICATOR(type_ctor_functors);
 
     entry_value = (Word *) strip_tag(layout_entry);
 
@@ -69,10 +69,10 @@
                 secondary_tag = *data_value;
                 argument_vector = data_value + 1;
 
-                new_entry = MR_TYPELAYOUT_COMPLICATED_VECTOR_GET_SIMPLE_VECTOR(
+                new_entry = MR_TYPE_CTOR_LAYOUT_COMPLICATED_VECTOR_GET_SIMPLE_VECTOR(
 			entry_value, secondary_tag);
-                arity = new_entry[TYPELAYOUT_SIMPLE_ARITY_OFFSET];
-                type_info_vector = new_entry + TYPELAYOUT_SIMPLE_ARGS_OFFSET;
+                arity = new_entry[TYPE_CTOR_LAYOUT_SIMPLE_ARITY_OFFSET];
+                type_info_vector = new_entry + TYPE_CTOR_LAYOUT_SIMPLE_ARGS_OFFSET;
 
                 /* allocate space for new args, and secondary tag */
                 incr_saved_hp(new_data, arity + 1);
@@ -105,8 +105,8 @@
 
             /* If the argument vector is in range, copy the arguments */
             if (in_range(argument_vector)) {
-                arity = entry_value[TYPELAYOUT_SIMPLE_ARITY_OFFSET];
-                type_info_vector = entry_value + TYPELAYOUT_SIMPLE_ARGS_OFFSET;
+                arity = entry_value[TYPE_CTOR_LAYOUT_SIMPLE_ARITY_OFFSET];
+                type_info_vector = entry_value + TYPE_CTOR_LAYOUT_SIMPLE_ARGS_OFFSET;
 
                 /* allocate space for new args. */
                 incr_saved_hp(new_data, arity);
@@ -129,13 +129,13 @@
 
         case MR_DATAREP_NOTAG:
             new_data = copy_arg(data_ptr, type_info, 
-                    (Word *) *MR_TYPELAYOUT_NO_TAG_VECTOR_ARGS(entry_value),
+                    (Word *) *MR_TYPE_CTOR_LAYOUT_NO_TAG_VECTOR_ARGS(entry_value),
                     lower_limit, upper_limit);
             break;
 
         case MR_DATAREP_EQUIV: 
             new_data = copy_arg(data_ptr, type_info, 
-                (const Word *) MR_TYPELAYOUT_EQUIV_TYPE((Word *)
+                (const Word *) MR_TYPE_CTOR_LAYOUT_EQUIV_TYPE((Word *)
                         entry_value), lower_limit, upper_limit);
             break;
 
@@ -183,7 +183,7 @@
             ** as their first argument, the Code * as their second, and
             ** then the arguments
             **
-            ** Their type-infos have a pointer to base_type_info for
+            ** Their type-infos have a pointer to type_ctor_info for
             ** pred/0, arity, and then argument typeinfos.
             */
             if (in_range(data_value)) {
@@ -348,37 +348,37 @@
 	Word *type_info = (Word *) *type_info_ptr;
 
 	if (in_range(type_info)) {
-		Word *base_type_info;
+		Word *type_ctor_info;
 		Word *new_type_info;
 		Integer arity, offset, i;
 
 		/*
-		** Note that we assume base_type_infos will always be
+		** Note that we assume type_ctor_infos will always be
 		** allocated statically, so we never copy them.
 		*/
 
-		base_type_info = MR_TYPEINFO_GET_BASE_TYPEINFO((Word *)
+		type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *)
 			type_info);
 		/*
 		** optimize special case: if there's no arguments,
 		** we don't need to construct a type_info; instead,
-		** we can just return the base_type_info.
+		** we can just return the type_ctor_info.
 		*/
-		if (type_info == base_type_info) {
-			return base_type_info;
+		if (type_info == type_ctor_info) {
+			return type_ctor_info;
 		}
-		if (MR_BASE_TYPEINFO_IS_HO(base_type_info)) {
+		if (MR_TYPE_CTOR_INFO_IS_HO(type_ctor_info)) {
 			arity = MR_TYPEINFO_GET_HIGHER_ARITY(type_info);
 			incr_saved_hp(LVALUE_CAST(Word, new_type_info),
 				arity + 2);
-			new_type_info[0] = (Word) base_type_info;
+			new_type_info[0] = (Word) type_ctor_info;
 			new_type_info[1] = arity;
 			offset = 2;
 		} else {
-			arity = MR_BASE_TYPEINFO_GET_TYPE_ARITY(base_type_info);
+			arity = MR_TYPE_CTOR_INFO_GET_TYPE_ARITY(type_ctor_info);
 			incr_saved_hp(LVALUE_CAST(Word, new_type_info),
 				arity + 1);
-			new_type_info[0] = (Word) base_type_info;
+			new_type_info[0] = (Word) type_ctor_info;
 			offset = 1;
 		}
 		for (i = offset; i < arity + offset; i++) {
Index: runtime/mercury_ho_call.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_ho_call.c,v
retrieving revision 1.14
diff -u -r1.14 mercury_ho_call.c
--- mercury_ho_call.c	1998/11/09 05:20:42	1.14
+++ mercury_ho_call.c	1999/03/16 05:28:10
@@ -359,20 +359,20 @@
 	Word	x, y;
 	int	i;
 
-	Word	base_type_info;
+	Word	type_ctor_info;
 
 	x = mercury__unify__x;
 	y = mercury__unify__y;
 
-	base_type_info = field(0, mercury__unify__typeinfo, 0);
-	if (base_type_info == 0) {
+	type_ctor_info = field(0, mercury__unify__typeinfo, 0);
+	if (type_ctor_info == 0) {
 		type_arity = 0;
 		unify_pred = (Code *) field(0, mercury__unify__typeinfo,
 				OFFSET_FOR_UNIFY_PRED);
 		/* args_base will not be needed */
 	} else {
-		type_arity = field(0, base_type_info, OFFSET_FOR_COUNT);
-		unify_pred = (Code *) field(0, base_type_info,
+		type_arity = field(0, type_ctor_info, OFFSET_FOR_COUNT);
+		unify_pred = (Code *) field(0, type_ctor_info,
 				OFFSET_FOR_UNIFY_PRED);
 		args_base = mercury__unify__typeinfo;
 	}
@@ -420,17 +420,17 @@
 	Word	x;
 	int	i;
 
-	Word	base_type_info;
+	Word	type_ctor_info;
 
 	x = r2;
-	base_type_info = field(0, r1, 0);
-	if (base_type_info == 0) {
+	type_ctor_info = field(0, r1, 0);
+	if (type_ctor_info == 0) {
 		type_arity = 0;
 		index_pred = (Code *) field(0, r1, OFFSET_FOR_INDEX_PRED);
 		/* args_base will not be needed */
 	} else {
-		type_arity = field(0, base_type_info, OFFSET_FOR_COUNT);
-		index_pred = (Code *) field(0, base_type_info,
+		type_arity = field(0, type_ctor_info, OFFSET_FOR_COUNT);
+		index_pred = (Code *) field(0, type_ctor_info,
 				OFFSET_FOR_INDEX_PRED);
 		args_base = r1;
 	}
@@ -516,20 +516,20 @@
 	Word	x, y;
 	int	i;
 
-	Word	base_type_info;
+	Word	type_ctor_info;
 
 	x = mercury__compare__x;
 	y = mercury__compare__y;
 
-	base_type_info = field(0, mercury__compare__typeinfo, 0);
-	if (base_type_info == 0) {
+	type_ctor_info = field(0, mercury__compare__typeinfo, 0);
+	if (type_ctor_info == 0) {
 		type_arity = 0;
 		compare_pred = (Code *) field(0, mercury__compare__typeinfo,
 				OFFSET_FOR_COMPARE_PRED);
 		/* args_base will not be needed */
 	} else {
-		type_arity = field(0, base_type_info, OFFSET_FOR_COUNT);
-		compare_pred = (Code *) field(0, base_type_info,
+		type_arity = field(0, type_ctor_info, OFFSET_FOR_COUNT);
+		compare_pred = (Code *) field(0, type_ctor_info,
 				OFFSET_FOR_COMPARE_PRED);
 		args_base = mercury__compare__typeinfo;
 	}
Index: runtime/mercury_stack_layout.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_stack_layout.h,v
retrieving revision 1.18
diff -u -r1.18 mercury_stack_layout.h
--- mercury_stack_layout.h	1999/02/19 16:17:50	1.18
+++ mercury_stack_layout.h	1999/03/16 05:28:10
@@ -156,7 +156,7 @@
 ** 	  mercury data values (vars).
 **
 ** The data is encoded such that low values (less than
-** TYPELAYOUT_MAX_VARINT) represent succip, hp, etc.  Higher values
+** TYPE_CTOR_LAYOUT_MAX_VARINT) represent succip, hp, etc.  Higher values
 ** represent data variables, and are pointers to a 2 word cell,
 ** containing a pseudo type_info and an instantiation represention.
 **
@@ -180,7 +180,7 @@
 	Word	inst;	/* not yet used; currently always -1 */
 } MR_Var_Shape_Info;
 
-#define MR_LIVE_TYPE_IS_VAR(T)         ( (Word) T > TYPELAYOUT_MAX_VARINT )
+#define MR_LIVE_TYPE_IS_VAR(T)         ( (Word) T > TYPE_CTOR_LAYOUT_MAX_VARINT )
 
 #define MR_LIVE_TYPE_GET_NONVAR(T)			\
 		((MR_Lval_NonVar) T)
Index: runtime/mercury_tabling.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_tabling.c,v
retrieving revision 1.1
diff -u -r1.1 mercury_tabling.c
--- mercury_tabling.c	1998/11/09 10:24:46	1.1
+++ mercury_tabling.c	1999/03/16 05:28:10
@@ -448,8 +448,8 @@
 ** This part defines the MR_table_type() function.
 */
 
-MR_DECLARE_STRUCT(mercury_data___base_type_info_pred_0);
-MR_DECLARE_STRUCT(mercury_data___base_type_info_func_0);
+MR_DECLARE_STRUCT(mercury_data___type_ctor_info_pred_0);
+MR_DECLARE_STRUCT(mercury_data___type_ctor_info_func_0);
 
 /*
 ** Due to the depth of the control here, we'll use 4 space indentation.
@@ -461,7 +461,7 @@
 TrieNode
 MR_table_type(TrieNode table, Word *type_info, Word data)
 {
-    Word *base_type_info, *base_type_layout, *base_type_functors;
+    Word *type_ctor_info, *type_ctor_layout, *type_ctor_functors;
     Word layout_for_tag, *layout_vector_for_tag, *data_value;
     enum MR_DataRepresentation data_rep;
     int data_tag, entry_tag;
@@ -471,14 +471,14 @@
     data_tag = tag(data);
     data_value = (Word *) body(data, data_tag);
 
-    base_type_info = MR_TYPEINFO_GET_BASE_TYPEINFO(type_info);
-    base_type_layout = MR_BASE_TYPEINFO_GET_TYPELAYOUT(base_type_info);
-    base_type_functors = MR_BASE_TYPEINFO_GET_TYPEFUNCTORS(base_type_info);
+    type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO(type_info);
+    type_ctor_layout = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_LAYOUT(type_ctor_info);
+    type_ctor_functors = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_FUNCTORS(type_ctor_info);
 
-    layout_for_tag = base_type_layout[data_tag];
+    layout_for_tag = type_ctor_layout[data_tag];
     layout_vector_for_tag = (Word *) strip_tag(layout_for_tag);
 
-    data_rep = MR_categorize_data(MR_TYPEFUNCTORS_INDICATOR(base_type_functors),
+    data_rep = MR_categorize_data(MR_TYPE_CTOR_FUNCTORS_INDICATOR(type_ctor_functors),
 		    layout_for_tag);
 
 #ifdef	MR_TABLE_DEBUG
@@ -489,13 +489,13 @@
 
     switch (data_rep) {
         case MR_DATAREP_ENUM: {
-	    int functors = MR_TYPELAYOUT_ENUM_VECTOR_NUM_FUNCTORS(
+	    int functors = MR_TYPE_CTOR_LAYOUT_ENUM_VECTOR_NUM_FUNCTORS(
 				layout_vector_for_tag);
 	    MR_DEBUG_TABLE_ENUM(table, functors, data);
             break;
         }
         case MR_DATAREP_COMPLICATED_CONST: {
-	    int functors = MR_TYPELAYOUT_ENUM_VECTOR_NUM_FUNCTORS(
+	    int functors = MR_TYPE_CTOR_LAYOUT_ENUM_VECTOR_NUM_FUNCTORS(
 				layout_vector_for_tag);
 	    MR_DEBUG_TABLE_TAG(table, data_tag);
 	    MR_DEBUG_TABLE_ENUM(table, functors, unmkbody(data));
@@ -507,9 +507,9 @@
 
             argument_vector = data_value;
 
-            arity = layout_vector_for_tag[TYPELAYOUT_SIMPLE_ARITY_OFFSET];
+            arity = layout_vector_for_tag[TYPE_CTOR_LAYOUT_SIMPLE_ARITY_OFFSET];
             type_info_vector = &layout_vector_for_tag[
-		    		TYPELAYOUT_SIMPLE_ARGS_OFFSET];
+		    		TYPE_CTOR_LAYOUT_SIMPLE_ARGS_OFFSET];
 
 	    MR_DEBUG_TABLE_TAG(table, data_tag);
 
@@ -530,14 +530,14 @@
             secondary_tag = *data_value;
             argument_vector = data_value + 1;
 
-            num_sharers = MR_TYPELAYOUT_COMPLICATED_VECTOR_NUM_SHARERS(
+            num_sharers = MR_TYPE_CTOR_LAYOUT_COMPLICATED_VECTOR_NUM_SHARERS(
             			layout_vector_for_tag);
             new_layout_vector =
-                MR_TYPELAYOUT_COMPLICATED_VECTOR_GET_SIMPLE_VECTOR(
+                MR_TYPE_CTOR_LAYOUT_COMPLICATED_VECTOR_GET_SIMPLE_VECTOR(
                     layout_vector_for_tag, secondary_tag);
-            arity = new_layout_vector[TYPELAYOUT_SIMPLE_ARITY_OFFSET];
+            arity = new_layout_vector[TYPE_CTOR_LAYOUT_SIMPLE_ARITY_OFFSET];
             type_info_vector =
-		    &new_layout_vector[TYPELAYOUT_SIMPLE_ARGS_OFFSET];
+		    &new_layout_vector[TYPE_CTOR_LAYOUT_SIMPLE_ARGS_OFFSET];
 
 	    MR_DEBUG_TABLE_TAG(table, data_tag);
 	    MR_DEBUG_TABLE_ENUM(table, num_sharers, secondary_tag);
@@ -553,7 +553,7 @@
         case MR_DATAREP_NOTAG: {
             Word *new_type_info;
             new_type_info = MR_make_type_info(type_info,
-                (Word *) *MR_TYPELAYOUT_NO_TAG_VECTOR_ARGS(
+                (Word *) *MR_TYPE_CTOR_LAYOUT_NO_TAG_VECTOR_ARGS(
 		    layout_vector_for_tag),
                 &allocated_memory_cells);
             MR_DEBUG_TABLE_ANY(table, new_type_info, data);
@@ -562,7 +562,7 @@
         case MR_DATAREP_EQUIV: {
             Word *new_type_info;
             new_type_info = MR_make_type_info(type_info,
-                (Word *) MR_TYPELAYOUT_EQUIV_TYPE(layout_vector_for_tag),
+                (Word *) MR_TYPE_CTOR_LAYOUT_EQUIV_TYPE(layout_vector_for_tag),
                 &allocated_memory_cells);
             MR_DEBUG_TABLE_ANY(table, new_type_info, data);
             break;
Index: runtime/mercury_type_info.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_info.c,v
retrieving revision 1.15
diff -u -r1.15 mercury_type_info.c
--- mercury_type_info.c	1999/01/28 11:46:29	1.15
+++ mercury_type_info.c	1999/03/16 05:28:10
@@ -19,28 +19,28 @@
 
 /*---------------------------------------------------------------------------*/
 
-	/* base_type_layout for `pred' */
+	/* type_ctor_layout for `pred' */
 	/* (this is used for all higher-order types) */
 
-const struct mercury_data___base_type_layout_pred_0_struct {
+const struct mercury_data___type_ctor_layout_pred_0_struct {
 	TYPE_LAYOUT_FIELDS
-} mercury_data___base_type_layout_pred_0 = {
-	make_typelayout_for_all_tags(TYPELAYOUT_CONST_TAG, 
-		mkbody(MR_TYPELAYOUT_PREDICATE_VALUE))
+} mercury_data___type_ctor_layout_pred_0 = {
+	make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG, 
+		mkbody(MR_TYPE_CTOR_LAYOUT_PREDICATE_VALUE))
 };
 
-	/* base_type_functors for `pred' */
+	/* type_ctor_functors for `pred' */
 	/* (this is used for all higher-order types) */
 
-const struct mercury_data___base_type_functors_pred_0_struct {
+const struct mercury_data___type_ctor_functors_pred_0_struct {
 	Integer f1;
-} mercury_data___base_type_functors_pred_0 = {
-	MR_TYPEFUNCTORS_SPECIAL
+} mercury_data___type_ctor_functors_pred_0 = {
+	MR_TYPE_CTOR_FUNCTORS_SPECIAL
 };
 
 
 	/* 
-	** base_type_info for `func' 
+	** type_ctor_info for `func' 
 	** (this is used for all higher-order func types) 
 	**
 	** Note: we use the special predicates, functors and layout for
@@ -50,7 +50,7 @@
 Declare_entry(mercury__builtin_unify_pred_2_0);
 Declare_entry(mercury__builtin_index_pred_2_0);
 Declare_entry(mercury__builtin_compare_pred_3_0);
-MR_STATIC_CODE_CONST struct mercury_data___base_type_info_func_0_struct {
+MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_func_0_struct {
 	Integer f1;
 	Code *f2;
 	Code *f3;
@@ -64,27 +64,27 @@
 	const Word *f8;
 	const Word *f9;
 #endif
-} mercury_data___base_type_info_func_0 = {
+} mercury_data___type_ctor_info_func_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_pred_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_pred_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_pred_3_0)),
 #ifdef  USE_TYPE_LAYOUT
-	(const Word *) & mercury_data___base_type_layout_pred_0,
-	(const Word *) & mercury_data___base_type_functors_pred_0,
+	(const Word *) & mercury_data___type_ctor_layout_pred_0,
+	(const Word *) & mercury_data___type_ctor_functors_pred_0,
 	(const Word *) string_const("func", 4)
 #endif
 };
 
 	/*
-	** base_type_info for `pred' 
+	** type_ctor_info for `pred' 
 	** (this is used for all higher-order pred types) 
 	*/
 
 Declare_entry(mercury__builtin_unify_pred_2_0);
 Declare_entry(mercury__builtin_index_pred_2_0);
 Declare_entry(mercury__builtin_compare_pred_3_0);
-MR_STATIC_CODE_CONST struct mercury_data___base_type_info_pred_0_struct {
+MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_pred_0_struct {
 	Integer f1;
 	Code *f2;
 	Code *f3;
@@ -98,14 +98,14 @@
 	const Word *f8;
 	const Word *f9;
 #endif
-} mercury_data___base_type_info_pred_0 = {
+} mercury_data___type_ctor_info_pred_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_pred_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_pred_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_pred_3_0)),
 #ifdef  USE_TYPE_LAYOUT
-	(const Word *) & mercury_data___base_type_layout_pred_0,
-	(const Word *) & mercury_data___base_type_functors_pred_0,
+	(const Word *) & mercury_data___type_ctor_layout_pred_0,
+	(const Word *) & mercury_data___type_ctor_functors_pred_0,
 	(const Word *) string_const("pred", 4)
 #endif
 };
@@ -147,10 +147,10 @@
 
 	/* 
 	** Given a type_info (term_type_info) which contains a
-	** base_type_info pointer and possibly other type_infos
+	** type_ctor_info pointer and possibly other type_infos
 	** giving the values of the type parameters of this type,
 	** and a pseudo-type_info (arg_pseudo_type_info), which contains a
-	** base_type_info pointer and possibly other type_infos
+	** type_ctor_info pointer and possibly other type_infos
 	** giving EITHER
 	** 	- the values of the type parameters of this type,
 	** or	- an indication of the type parameter of the
@@ -164,11 +164,11 @@
 	** new type_info. 
 	**
 	** In the case where the argument's pseudo_type_info is a
-	** base_type_info with no arguments, we don't copy the
-	** base_type_info - we just return a pointer to it - no memory
+	** type_ctor_info with no arguments, we don't copy the
+	** type_ctor_info - we just return a pointer to it - no memory
 	** is allocated. The caller can check this by looking at the
 	** first cell of the returned pointer - if it is zero, this is a
-	** base_type_info. Otherwise, it is an allocated copy of a
+	** type_ctor_info. Otherwise, it is an allocated copy of a
 	** type_info.
 	**
 	** NOTE: If you are changing this code, you might also need
@@ -181,7 +181,7 @@
 MR_create_type_info(Word *term_type_info, Word *arg_pseudo_type_info)
 {
 	int i, arity, extra_args;
-	Word *base_type_info;
+	Word *type_ctor_info;
 	Word *arg_type_info;
 	Word *type_info;
 
@@ -201,18 +201,18 @@
 		return arg_type_info;
 	}
 
-	base_type_info = MR_TYPEINFO_GET_BASE_TYPEINFO(arg_pseudo_type_info);
+	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO(arg_pseudo_type_info);
 
 	/* no arguments - optimise common case */
-	if (base_type_info == arg_pseudo_type_info) {
+	if (type_ctor_info == arg_pseudo_type_info) {
 		return arg_pseudo_type_info;
 	}
 
-	if (MR_BASE_TYPEINFO_IS_HO(base_type_info)) {
+	if (MR_TYPE_CTOR_INFO_IS_HO(type_ctor_info)) {
 		arity = MR_TYPEINFO_GET_HIGHER_ARITY(arg_pseudo_type_info);
 		extra_args = 2;
 	} else {
-		arity = MR_BASE_TYPEINFO_GET_TYPE_ARITY(base_type_info);
+		arity = MR_TYPE_CTOR_INFO_GET_TYPE_ARITY(type_ctor_info);
 		extra_args = 1;
 	}
 
@@ -256,7 +256,7 @@
 ** MR_compare_type_info(type_info_1, type_info_2):
 **
 ** Compare two type_info structures, using an arbitrary ordering
-** (based on the addresses of the base_type_infos, or in
+** (based on the addresses of the type_ctor_infos, or in
 ** the case of higher order types, the arity).
 **
 ** You need to save and restore transient registers around
@@ -267,7 +267,7 @@
 MR_compare_type_info(Word t1, Word t2)
 {
 	Word	*type_info_1, *type_info_2;
-	Word	*base_type_info_1, *base_type_info_2;
+	Word	*type_ctor_info_1, *type_ctor_info_2;
 	int	num_arg_types;
 	int	i;
 
@@ -294,7 +294,7 @@
 	}
 
 	/*
-	** Otherwise find the addresses of the base_type_infos,
+	** Otherwise find the addresses of the type_ctor_infos,
 	** and compare those.
 	**
 	** Note: this is an arbitrary ordering. It doesn't matter
@@ -305,24 +305,24 @@
 	** The casts to (Word) here are in the hope of increasing
 	** the chance that this will work on a segmented architecture.
 	*/
-	base_type_info_1 = MR_TYPEINFO_GET_BASE_TYPEINFO(type_info_1);
-	base_type_info_2 = MR_TYPEINFO_GET_BASE_TYPEINFO(type_info_2);
-	if ((Word) base_type_info_1 < (Word) base_type_info_2) {
+	type_ctor_info_1 = MR_TYPEINFO_GET_TYPE_CTOR_INFO(type_info_1);
+	type_ctor_info_2 = MR_TYPEINFO_GET_TYPE_CTOR_INFO(type_info_2);
+	if ((Word) type_ctor_info_1 < (Word) type_ctor_info_2) {
 		return COMPARE_LESS;
 	}
-	if ((Word) base_type_info_1 > (Word) base_type_info_2) {
+	if ((Word) type_ctor_info_1 > (Word) type_ctor_info_2) {
 		return COMPARE_GREATER;
 	}
 
 	/*
-	** If the base_type_info addresses are equal, we don't need to
+	** If the type_ctor_info addresses are equal, we don't need to
 	** compare the arity of the types - they must be the same -
 	** unless they are higher-order (which are all mapped to
 	** pred/0). 
 	** But we need to recursively compare the argument types, if any.
 	*/
 		/* Check for higher order */
-	if (MR_BASE_TYPEINFO_IS_HO(base_type_info_1)) 
+	if (MR_TYPE_CTOR_INFO_IS_HO(type_ctor_info_1)) 
 	{
 		int num_arg_types_2;
 
@@ -348,7 +348,7 @@
 		type_info_1++;
 		type_info_2++;
 	} else {
-		num_arg_types = field(mktag(0), base_type_info_1,
+		num_arg_types = field(mktag(0), type_ctor_info_1,
 				OFFSET_FOR_COUNT);
 	}
 		/* compare the argument types */
@@ -381,18 +381,18 @@
 {
 	Word *functors, equiv_type_info;
 	
-	functors = MR_BASE_TYPEINFO_GET_TYPEFUNCTORS(
-			MR_TYPEINFO_GET_BASE_TYPEINFO((Word *) 
+	functors = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_FUNCTORS(
+			MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) 
 					maybe_equiv_type_info));
 
 		/* Look past equivalences */
-	while (MR_TYPEFUNCTORS_INDICATOR(functors) == MR_TYPEFUNCTORS_EQUIV) {
-		equiv_type_info = (Word) MR_TYPEFUNCTORS_EQUIV_TYPE(functors);
+	while (MR_TYPE_CTOR_FUNCTORS_INDICATOR(functors) == MR_TYPE_CTOR_FUNCTORS_EQUIV) {
+		equiv_type_info = (Word) MR_TYPE_CTOR_FUNCTORS_EQUIV_TYPE(functors);
 		equiv_type_info = (Word) MR_create_type_info(
 				(Word *) maybe_equiv_type_info, 
 				(Word *) equiv_type_info);
-		functors = MR_BASE_TYPEINFO_GET_TYPEFUNCTORS(
-			MR_TYPEINFO_GET_BASE_TYPEINFO((Word *) 
+		functors = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_FUNCTORS(
+			MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) 
 				equiv_type_info));
 		maybe_equiv_type_info = equiv_type_info;
 	}
@@ -417,10 +417,10 @@
 
 	/* 
 	** Given a type_info (term_type_info) which contains a
-	** base_type_info pointer and possibly other type_infos
+	** type_ctor_info pointer and possibly other type_infos
 	** giving the values of the type parameters of this type,
 	** and a pseudo-type_info (arg_pseudo_type_info), which contains a
-	** base_type_info pointer and possibly other type_infos
+	** type_ctor_info pointer and possibly other type_infos
 	** giving EITHER
 	** 	- the values of the type parameters of this type,
 	** or	- an indication of the type parameter of the
@@ -453,7 +453,7 @@
 	MR_MemoryList *allocated) 
 {
 	int i, arity, extra_args;
-	Word *base_type_info;
+	Word *type_ctor_info;
 	Word *arg_type_info;
 	Word *type_info;
 
@@ -471,18 +471,18 @@
 		return arg_type_info;
 	}
 
-	base_type_info = MR_TYPEINFO_GET_BASE_TYPEINFO(arg_pseudo_type_info);
+	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO(arg_pseudo_type_info);
 
 	/* no arguments - optimise common case */
-	if (base_type_info == arg_pseudo_type_info) {
-		return base_type_info;
+	if (type_ctor_info == arg_pseudo_type_info) {
+		return type_ctor_info;
 	} 
 
-	if (MR_BASE_TYPEINFO_IS_HO(base_type_info)) {
+	if (MR_TYPE_CTOR_INFO_IS_HO(type_ctor_info)) {
 		arity = MR_TYPEINFO_GET_HIGHER_ARITY(arg_pseudo_type_info);
 			extra_args = 2;
 	} else {
-		arity = MR_BASE_TYPEINFO_GET_TYPE_ARITY(base_type_info);
+		arity = MR_TYPE_CTOR_INFO_GET_TYPE_ARITY(type_ctor_info);
 			extra_args = 1;
 	}
 
@@ -543,61 +543,61 @@
 MR_categorize_data(Word functors_indicator, Word layout_entry)
 {
 	switch ((int) functors_indicator) { 
-		case MR_TYPEFUNCTORS_ENUM: 
+		case MR_TYPE_CTOR_FUNCTORS_ENUM: 
 			return MR_DATAREP_ENUM;
-		case MR_TYPEFUNCTORS_DU: 
+		case MR_TYPE_CTOR_FUNCTORS_DU: 
 			switch ((int) tag(layout_entry)) {
-				case TYPELAYOUT_SIMPLE_TAG:
+				case TYPE_CTOR_LAYOUT_SIMPLE_TAG:
 					return MR_DATAREP_SIMPLE;
-				case TYPELAYOUT_COMPLICATED_TAG:
+				case TYPE_CTOR_LAYOUT_COMPLICATED_TAG:
 					return MR_DATAREP_COMPLICATED;
-				case TYPELAYOUT_CONST_TAG:
+				case TYPE_CTOR_LAYOUT_CONST_TAG:
 					return MR_DATAREP_COMPLICATED_CONST;
 				default:
 					return MR_DATAREP_UNKNOWN;
 			}
-		case MR_TYPEFUNCTORS_NO_TAG:
+		case MR_TYPE_CTOR_FUNCTORS_NO_TAG:
 			return MR_DATAREP_NOTAG;
-		case MR_TYPEFUNCTORS_EQUIV:
+		case MR_TYPE_CTOR_FUNCTORS_EQUIV:
 			if (TYPEINFO_IS_VARIABLE(strip_tag(layout_entry))) {
 				return MR_DATAREP_EQUIV_VAR;
 			} else {
 				return MR_DATAREP_EQUIV;
 			}
-		case MR_TYPEFUNCTORS_SPECIAL:
+		case MR_TYPE_CTOR_FUNCTORS_SPECIAL:
 		{
 			int builtin_type = unmkbody(strip_tag(layout_entry));
 
 			switch (builtin_type) {
-				case MR_TYPELAYOUT_UNASSIGNED_VALUE:
+				case MR_TYPE_CTOR_LAYOUT_UNASSIGNED_VALUE:
 					return MR_DATAREP_UNKNOWN;
-				case MR_TYPELAYOUT_UNUSED_VALUE:
+				case MR_TYPE_CTOR_LAYOUT_UNUSED_VALUE:
 					return MR_DATAREP_UNKNOWN;
-				case MR_TYPELAYOUT_STRING_VALUE:
+				case MR_TYPE_CTOR_LAYOUT_STRING_VALUE:
 					return MR_DATAREP_STRING;
-				case MR_TYPELAYOUT_FLOAT_VALUE:
+				case MR_TYPE_CTOR_LAYOUT_FLOAT_VALUE:
 					return MR_DATAREP_FLOAT;
-				case MR_TYPELAYOUT_INT_VALUE:
+				case MR_TYPE_CTOR_LAYOUT_INT_VALUE:
 					return MR_DATAREP_INT;
-				case MR_TYPELAYOUT_CHARACTER_VALUE:
+				case MR_TYPE_CTOR_LAYOUT_CHARACTER_VALUE:
 					return MR_DATAREP_CHAR;
-				case MR_TYPELAYOUT_PREDICATE_VALUE:
+				case MR_TYPE_CTOR_LAYOUT_PREDICATE_VALUE:
 					return MR_DATAREP_PRED;
-				case MR_TYPELAYOUT_VOID_VALUE:
+				case MR_TYPE_CTOR_LAYOUT_VOID_VALUE:
 					return MR_DATAREP_VOID;
-				case MR_TYPELAYOUT_ARRAY_VALUE:
+				case MR_TYPE_CTOR_LAYOUT_ARRAY_VALUE:
 					return MR_DATAREP_ARRAY;
-				case MR_TYPELAYOUT_TYPEINFO_VALUE:
+				case MR_TYPE_CTOR_LAYOUT_TYPEINFO_VALUE:
 					return MR_DATAREP_TYPEINFO;
-				case MR_TYPELAYOUT_C_POINTER_VALUE:
+				case MR_TYPE_CTOR_LAYOUT_C_POINTER_VALUE:
 					return MR_DATAREP_C_POINTER;
-				case MR_TYPELAYOUT_TYPECLASSINFO_VALUE:
+				case MR_TYPE_CTOR_LAYOUT_TYPECLASSINFO_VALUE:
 					return MR_DATAREP_TYPECLASSINFO;
 				default: 
 					return MR_DATAREP_UNKNOWN;
 			}
 		}
-		case MR_TYPEFUNCTORS_UNIV:
+		case MR_TYPE_CTOR_FUNCTORS_UNIV:
 			return MR_DATAREP_UNIV;
 		default:
 			return MR_DATAREP_UNKNOWN;
@@ -614,7 +614,7 @@
 	mercury__builtin_index_pred_module();
 	mercury__builtin_compare_pred_module();
 
-	MR_INIT_BUILTIN_BASE_TYPE_INFO(
-		mercury_data___base_type_info_pred_0, _pred_);
+	MR_INIT_BUILTIN_TYPE_CTOR_INFO(
+		mercury_data___type_ctor_info_pred_0, _pred_);
 }
 
Index: runtime/mercury_type_info.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_info.h,v
retrieving revision 1.15
diff -u -r1.15 mercury_type_info.h
--- mercury_type_info.h	1998/11/09 14:35:39	1.15
+++ mercury_type_info.h	1999/03/16 05:28:10
@@ -22,9 +22,9 @@
 /*---------------------------------------------------------------------------*/
 
 /*
-** Define offsets of fields in the base_type_info or type_info structure.
+** Define offsets of fields in the type_ctor_info or type_info structure.
 ** See polymorphism.m for explanation of these offsets and how the
-** type_info and base_type_info structures are laid out.
+** type_info and type_ctor_info structures are laid out.
 **
 ** ANY CHANGES HERE MUST BE MATCHED BY CORRESPONDING CHANGES
 ** TO THE DOCUMENTATION IN compiler/polymorphism.m.
@@ -49,9 +49,9 @@
 
 /*
 ** Where the predicate arity and args are stored in the type_info.
-** They are stored in the type_info (*not* the base_type_info).
+** They are stored in the type_info (*not* the type_ctor_info).
 ** This is brought about by higher-order predicates all using the
-** same base_type_info - pred/0.
+** same type_ctor_info - pred/0.
 */
 
 #define TYPEINFO_OFFSET_FOR_PRED_ARITY 1
@@ -114,9 +114,9 @@
 /*---------------------------------------------------------------------------*/
 
 /*
-** Definitions and macros for base_type_layout definition.
+** Definitions and macros for type_ctor_layout definition.
 **
-** See compiler/base_type_layout.m for more information.
+** See compiler/type_ctor_layout.m for more information.
 **
 ** If we don't have enough tags, we have to encode layouts
 ** less densely. The make_typelayout macro does this, and
@@ -213,12 +213,12 @@
 ** Some of the type-layout tags are shared.
 */
 
-#define TYPELAYOUT_CONST_TAG		0
-#define TYPELAYOUT_COMP_CONST_TAG	0 
-#define TYPELAYOUT_SIMPLE_TAG		1
-#define TYPELAYOUT_COMPLICATED_TAG	2
-#define TYPELAYOUT_EQUIV_TAG		3
-#define TYPELAYOUT_NO_TAG		3 
+#define TYPE_CTOR_LAYOUT_CONST_TAG		0
+#define TYPE_CTOR_LAYOUT_COMP_CONST_TAG	0 
+#define TYPE_CTOR_LAYOUT_SIMPLE_TAG		1
+#define TYPE_CTOR_LAYOUT_COMPLICATED_TAG	2
+#define TYPE_CTOR_LAYOUT_EQUIV_TAG		3
+#define TYPE_CTOR_LAYOUT_NO_TAG		3 
 
 /* 
 ** Values in type_layout structures,
@@ -226,28 +226,28 @@
 **
 ** Also intended for use in handwritten C code.
 **
-** Note that MR_TYPELAYOUT_UNASSIGNED_VALUE is not yet
+** Note that MR_TYPE_CTOR_LAYOUT_UNASSIGNED_VALUE is not yet
 ** used for anything.
 **
 ** Changes in this type may need to be reflected in
-** compiler/base_type_layout.m.
+** compiler/type_ctor_layout.m.
 **
 */
 
 enum MR_TypeLayoutValue {
-	MR_TYPELAYOUT_UNASSIGNED_VALUE,
-	MR_TYPELAYOUT_UNUSED_VALUE,
-	MR_TYPELAYOUT_STRING_VALUE,
-	MR_TYPELAYOUT_FLOAT_VALUE,
-	MR_TYPELAYOUT_INT_VALUE,
-	MR_TYPELAYOUT_CHARACTER_VALUE,
-	MR_TYPELAYOUT_UNIV_VALUE,
-	MR_TYPELAYOUT_PREDICATE_VALUE,
-	MR_TYPELAYOUT_VOID_VALUE,
-	MR_TYPELAYOUT_ARRAY_VALUE,
-	MR_TYPELAYOUT_TYPEINFO_VALUE,
-	MR_TYPELAYOUT_C_POINTER_VALUE,
-	MR_TYPELAYOUT_TYPECLASSINFO_VALUE
+	MR_TYPE_CTOR_LAYOUT_UNASSIGNED_VALUE,
+	MR_TYPE_CTOR_LAYOUT_UNUSED_VALUE,
+	MR_TYPE_CTOR_LAYOUT_STRING_VALUE,
+	MR_TYPE_CTOR_LAYOUT_FLOAT_VALUE,
+	MR_TYPE_CTOR_LAYOUT_INT_VALUE,
+	MR_TYPE_CTOR_LAYOUT_CHARACTER_VALUE,
+	MR_TYPE_CTOR_LAYOUT_UNIV_VALUE,
+	MR_TYPE_CTOR_LAYOUT_PREDICATE_VALUE,
+	MR_TYPE_CTOR_LAYOUT_VOID_VALUE,
+	MR_TYPE_CTOR_LAYOUT_ARRAY_VALUE,
+	MR_TYPE_CTOR_LAYOUT_TYPEINFO_VALUE,
+	MR_TYPE_CTOR_LAYOUT_C_POINTER_VALUE,
+	MR_TYPE_CTOR_LAYOUT_TYPECLASSINFO_VALUE
 };
 
 /* 
@@ -255,9 +255,9 @@
 ** (corresponds with argument number of type parameter).
 */
 
-#define TYPELAYOUT_MAX_VARINT		1024
+#define TYPE_CTOR_LAYOUT_MAX_VARINT		1024
 
-#define TYPEINFO_IS_VARIABLE(T)		( (Word) T <= TYPELAYOUT_MAX_VARINT )
+#define TYPEINFO_IS_VARIABLE(T)		( (Word) T <= TYPE_CTOR_LAYOUT_MAX_VARINT )
 
 /*
 ** This constant is also used for other information - for
@@ -267,19 +267,19 @@
 ** two (integer division).
 */
 
-#define MR_BASE_TYPEINFO_HO_PRED				\
-	((const Word *) &mercury_data___base_type_info_pred_0)
-#define MR_BASE_TYPEINFO_HO_FUNC				\
-	((const Word *) &mercury_data___base_type_info_func_0)
-#define MR_BASE_TYPEINFO_IS_HO_PRED(T)				\
-	(T == MR_BASE_TYPEINFO_HO_PRED)
-#define MR_BASE_TYPEINFO_IS_HO_FUNC(T)				\
-	(T == MR_BASE_TYPEINFO_HO_FUNC)
-#define MR_BASE_TYPEINFO_IS_HO(T)				\
-	(T == MR_BASE_TYPEINFO_HO_FUNC || T == MR_BASE_TYPEINFO_HO_PRED)
+#define MR_TYPE_CTOR_INFO_HO_PRED				\
+	((const Word *) &mercury_data___type_ctor_info_pred_0)
+#define MR_TYPE_CTOR_INFO_HO_FUNC				\
+	((const Word *) &mercury_data___type_ctor_info_func_0)
+#define MR_TYPE_CTOR_INFO_IS_HO_PRED(T)				\
+	(T == MR_TYPE_CTOR_INFO_HO_PRED)
+#define MR_TYPE_CTOR_INFO_IS_HO_FUNC(T)				\
+	(T == MR_TYPE_CTOR_INFO_HO_FUNC)
+#define MR_TYPE_CTOR_INFO_IS_HO(T)				\
+	(T == MR_TYPE_CTOR_INFO_HO_FUNC || T == MR_TYPE_CTOR_INFO_HO_PRED)
 
 #define MR_TYPECTOR_IS_HIGHER_ORDER(T)				\
-	( (Word) T <= TYPELAYOUT_MAX_VARINT )
+	( (Word) T <= TYPE_CTOR_LAYOUT_MAX_VARINT )
 #define MR_TYPECTOR_MAKE_PRED(Arity)				\
 	( (Word) ((Integer) (Arity) * 2) )
 #define MR_TYPECTOR_MAKE_FUNC(Arity)				\
@@ -290,10 +290,10 @@
 	((ConstString) ( ( ((Integer) (T)) % 2 ) ? "func" : "pred" ))
 #define MR_TYPECTOR_GET_HOT_MODULE_NAME(T)				\
 	((ConstString) "builtin")
-#define MR_TYPECTOR_GET_HOT_BASE_TYPE_INFO(T)			\
+#define MR_TYPECTOR_GET_HOT_TYPE_CTOR_INFO(T)			\
 	((Word) ( ( ((Integer) (T)) % 2 ) ?		\
-		(const Word *) &mercury_data___base_type_info_func_0 :	\
-		(const Word *) &mercury_data___base_type_info_pred_0 ))
+		(const Word *) &mercury_data___type_ctor_info_func_0 :	\
+		(const Word *) &mercury_data___type_ctor_info_pred_0 ))
 
 /*
 ** Offsets into the type_layout structure for functors and arities.
@@ -306,12 +306,12 @@
 **
 */
 
-#define TYPELAYOUT_CONST_FUNCTOR_OFFSET		2
-#define TYPELAYOUT_ENUM_FUNCTOR_OFFSET		2
-#define TYPELAYOUT_SIMPLE_FUNCTOR_OFFSET	1
+#define TYPE_CTOR_LAYOUT_CONST_FUNCTOR_OFFSET		2
+#define TYPE_CTOR_LAYOUT_ENUM_FUNCTOR_OFFSET		2
+#define TYPE_CTOR_LAYOUT_SIMPLE_FUNCTOR_OFFSET	1
 
-#define TYPELAYOUT_SIMPLE_ARITY_OFFSET  	0
-#define TYPELAYOUT_SIMPLE_ARGS_OFFSET       	1
+#define TYPE_CTOR_LAYOUT_SIMPLE_ARITY_OFFSET  	0
+#define TYPE_CTOR_LAYOUT_SIMPLE_ARGS_OFFSET       	1
 
 /*---------------------------------------------------------------------------*/
 
@@ -330,13 +330,13 @@
 
 /*
 ** Code for dealing with the static code addresses stored in
-** base_type_infos. 
+** type_ctor_infos. 
 */
 
 /*
-** Definitions for initialization of base_type_infos. If
+** Definitions for initialization of type_ctor_infos. If
 ** MR_STATIC_CODE_ADDRESSES are not available, we need to initialize
-** the special predicates in the base_type_infos.
+** the special predicates in the type_ctor_infos.
 */
 
 /*
@@ -354,25 +354,25 @@
 	MR_INIT_CODE_ADDR(Base, mercury____##Pred##___##TypeId, Offset)
 
 /*
-** Macros are provided here to initialize base_type_infos, both for
+** Macros are provided here to initialize type_ctor_infos, both for
 ** builtin types (such as in library/builtin.m) and user
 ** defined C types (like library/array.m). Also, the automatically
 ** generated code uses these initializers.
 **
 ** Examples of use:
 **
-** MR_INIT_BUILTIN_BASE_TYPE_INFO(
-** 	mercury_data__base_type_info_string_0, _string_);
+** MR_INIT_BUILTIN_TYPE_CTOR_INFO(
+** 	mercury_data__type_ctor_info_string_0, _string_);
 **
 ** note we use _string_ to avoid the redefinition of string via #define
 **
-** MR_INIT_BASE_TYPE_INFO(
-** 	mercury_data_group__base_type_info_group_1, group__group_1_0);
+** MR_INIT_TYPE_CTOR_INFO(
+** 	mercury_data_group__type_ctor_info_group_1, group__group_1_0);
 ** 
-** MR_INIT_BASE_TYPE_INFO_WITH_PRED(
-** 	mercury_date__base_type_info_void_0, mercury__unused_0_0);
+** MR_INIT_TYPE_CTOR_INFO_WITH_PRED(
+** 	mercury_date__type_ctor_info_void_0, mercury__unused_0_0);
 **
-** This will initialize a base_type_info with a single code address.
+** This will initialize a type_ctor_info with a single code address.
 **
 **
 */
@@ -385,7 +385,7 @@
 
   #ifdef USE_TYPE_TO_TERM
 
-    #define	MR_INIT_BUILTIN_BASE_TYPE_INFO(B, T) \
+    #define	MR_INIT_BUILTIN_TYPE_CTOR_INFO(B, T) \
     do {								\
 	MR_INIT_CODE_ADDR(B, mercury__builtin_unify##T##2_0, 		\
 		OFFSET_FOR_UNIFY_PRED);					\
@@ -399,7 +399,7 @@
 		OFFSET_FOR_TERM_TO_TYPE_PRED);				\
     } while (0)
 
-    #define	MR_INIT_BASE_TYPE_INFO_WITH_PRED(B, P)			\
+    #define	MR_INIT_TYPE_CTOR_INFO_WITH_PRED(B, P)			\
     do {								\
 	MR_INIT_CODE_ADDR(B, P, OFFSET_FOR_UNIFY_PRED);			\
 	MR_INIT_CODE_ADDR(B, P, OFFSET_FOR_INDEX_PRED);			\
@@ -408,7 +408,7 @@
 	MR_INIT_CODE_ADDR(B, P, OFFSET_FOR_TERM_TO_TYPE_PRED);		\
     } while (0)
 
-    #define	MR_INIT_BASE_TYPE_INFO(B, T) \
+    #define	MR_INIT_TYPE_CTOR_INFO(B, T) \
     do {								\
 	MR_SPECIAL_PRED_INIT(B, T, OFFSET_FOR_UNIFY_PRED, Unify);	\
 	MR_SPECIAL_PRED_INIT(B, T, OFFSET_FOR_INDEX_PRED, Index);	\
@@ -419,7 +419,7 @@
 
   #else /* not USE_TYPE_TO_TERM */ 
 
-    #define	MR_INIT_BUILTIN_BASE_TYPE_INFO(B, T) \
+    #define	MR_INIT_BUILTIN_TYPE_CTOR_INFO(B, T) \
     do {								\
 	MR_INIT_CODE_ADDR(B, mercury__builtin_unify##T##2_0, 	\
 		OFFSET_FOR_UNIFY_PRED);					\
@@ -429,14 +429,14 @@
 		OFFSET_FOR_COMPARE_PRED);				\
     } while (0)
 
-    #define	MR_INIT_BASE_TYPE_INFO_WITH_PRED(B, P)			\
+    #define	MR_INIT_TYPE_CTOR_INFO_WITH_PRED(B, P)			\
     do {								\
 	MR_INIT_CODE_ADDR(B, P, OFFSET_FOR_UNIFY_PRED);			\
 	MR_INIT_CODE_ADDR(B, P, OFFSET_FOR_INDEX_PRED);			\
 	MR_INIT_CODE_ADDR(B, P, OFFSET_FOR_COMPARE_PRED);		\
     } while (0)
 
-    #define	MR_INIT_BASE_TYPE_INFO(B, T) \
+    #define	MR_INIT_TYPE_CTOR_INFO(B, T) \
     do {	\
 	MR_SPECIAL_PRED_INIT(B, T, OFFSET_FOR_UNIFY_PRED, Unify);     \
 	MR_SPECIAL_PRED_INIT(B, T, OFFSET_FOR_INDEX_PRED, Index);     \
@@ -451,13 +451,13 @@
 
   #define MR_STATIC_CODE_CONST const
 
-  #define MR_INIT_BUILTIN_BASE_TYPE_INFO(B, T) \
+  #define MR_INIT_BUILTIN_TYPE_CTOR_INFO(B, T) \
 	do { } while (0)
 
-  #define MR_INIT_BASE_TYPE_INFO_WITH_PRED(B, P) \
+  #define MR_INIT_TYPE_CTOR_INFO_WITH_PRED(B, P) \
 	do { } while (0)
 
-  #define MR_INIT_BASE_TYPE_INFO(B, T) \
+  #define MR_INIT_TYPE_CTOR_INFO(B, T) \
 	do { } while (0)
 
 #endif /* MR_STATIC_CODE_ADDRESSES */
@@ -466,29 +466,29 @@
 
 /*
 ** Macros and defintions for defining and dealing with
-** base_type_functors.
+** type_ctor_functors.
 */
 
 /*
 ** All type_functors have an indicator.
 */
 
-#define MR_TYPEFUNCTORS_OFFSET_FOR_INDICATOR	((Integer) 0)
+#define MR_TYPE_CTOR_FUNCTORS_OFFSET_FOR_INDICATOR	((Integer) 0)
 
-#define MR_TYPEFUNCTORS_INDICATOR(Functors)				\
-	((Functors)[MR_TYPEFUNCTORS_OFFSET_FOR_INDICATOR])
+#define MR_TYPE_CTOR_FUNCTORS_INDICATOR(Functors)				\
+	((Functors)[MR_TYPE_CTOR_FUNCTORS_OFFSET_FOR_INDICATOR])
 
 
 /*
 ** Values that the indicator can take.
 */
 
-#define MR_TYPEFUNCTORS_DU	((Integer) 0)
-#define MR_TYPEFUNCTORS_ENUM	((Integer) 1)
-#define MR_TYPEFUNCTORS_EQUIV	((Integer) 2)
-#define MR_TYPEFUNCTORS_SPECIAL	((Integer) 3)
-#define MR_TYPEFUNCTORS_NO_TAG	((Integer) 4)
-#define MR_TYPEFUNCTORS_UNIV	((Integer) 5)
+#define MR_TYPE_CTOR_FUNCTORS_DU	((Integer) 0)
+#define MR_TYPE_CTOR_FUNCTORS_ENUM	((Integer) 1)
+#define MR_TYPE_CTOR_FUNCTORS_EQUIV	((Integer) 2)
+#define MR_TYPE_CTOR_FUNCTORS_SPECIAL	((Integer) 3)
+#define MR_TYPE_CTOR_FUNCTORS_NO_TAG	((Integer) 4)
+#define MR_TYPE_CTOR_FUNCTORS_UNIV	((Integer) 5)
 
 
 	/*
@@ -497,29 +497,29 @@
 	** for functor number N (where N starts at 1). 
 	*/
 
-#define MR_TYPEFUNCTORS_DU_OFFSET_FOR_NUM_FUNCTORS	((Integer) 1)
-#define MR_TYPEFUNCTORS_DU_OFFSET_FOR_FUNCTORS_VECTOR	((Integer) 2)
+#define MR_TYPE_CTOR_FUNCTORS_DU_OFFSET_FOR_NUM_FUNCTORS	((Integer) 1)
+#define MR_TYPE_CTOR_FUNCTORS_DU_OFFSET_FOR_FUNCTORS_VECTOR	((Integer) 2)
 
-#define MR_TYPEFUNCTORS_DU_NUM_FUNCTORS(Functors)			\
-	((Functors)[MR_TYPEFUNCTORS_DU_OFFSET_FOR_NUM_FUNCTORS])
+#define MR_TYPE_CTOR_FUNCTORS_DU_NUM_FUNCTORS(Functors)			\
+	((Functors)[MR_TYPE_CTOR_FUNCTORS_DU_OFFSET_FOR_NUM_FUNCTORS])
 
-#define MR_TYPEFUNCTORS_DU_FUNCTOR_N(Functor, N)			\
+#define MR_TYPE_CTOR_FUNCTORS_DU_FUNCTOR_N(Functor, N)			\
 	((Word *) ((Functor)[						\
-		MR_TYPEFUNCTORS_DU_OFFSET_FOR_FUNCTORS_VECTOR + N]))
+		MR_TYPE_CTOR_FUNCTORS_DU_OFFSET_FOR_FUNCTORS_VECTOR + N]))
 
 	/*
 	** Macros to access the data in a enumeration type_functors, the
 	** number of functors, and the enumeration vector.
 	*/
 
-#define MR_TYPEFUNCTORS_ENUM_OFFSET_FOR_FUNCTORS_VECTOR		((Integer) 1)
+#define MR_TYPE_CTOR_FUNCTORS_ENUM_OFFSET_FOR_FUNCTORS_VECTOR		((Integer) 1)
 
-#define MR_TYPEFUNCTORS_ENUM_NUM_FUNCTORS(Functors)			\
-	MR_TYPELAYOUT_ENUM_VECTOR_NUM_FUNCTORS(			\
-		MR_TYPEFUNCTORS_ENUM_FUNCTORS((Functors)))
+#define MR_TYPE_CTOR_FUNCTORS_ENUM_NUM_FUNCTORS(Functors)			\
+	MR_TYPE_CTOR_LAYOUT_ENUM_VECTOR_NUM_FUNCTORS(			\
+		MR_TYPE_CTOR_FUNCTORS_ENUM_FUNCTORS((Functors)))
 
-#define MR_TYPEFUNCTORS_ENUM_FUNCTORS(Functor)				\
-	((Word *) ((Functor)[MR_TYPEFUNCTORS_ENUM_OFFSET_FOR_FUNCTORS_VECTOR]))
+#define MR_TYPE_CTOR_FUNCTORS_ENUM_FUNCTORS(Functor)				\
+	((Word *) ((Functor)[MR_TYPE_CTOR_FUNCTORS_ENUM_OFFSET_FOR_FUNCTORS_VECTOR]))
 
 	/*
 	** Macros to access the data in a no_tag type_functors, the
@@ -527,28 +527,28 @@
 	** with no_tags).
 	*/
 
-#define MR_TYPEFUNCTORS_NO_TAG_OFFSET_FOR_FUNCTORS_VECTOR	((Integer) 1)
+#define MR_TYPE_CTOR_FUNCTORS_NO_TAG_OFFSET_FOR_FUNCTORS_VECTOR	((Integer) 1)
 
-#define MR_TYPEFUNCTORS_NO_TAG_FUNCTOR(Functors)			\
+#define MR_TYPE_CTOR_FUNCTORS_NO_TAG_FUNCTOR(Functors)			\
 	((Word *) ((Functors)						\
-		[MR_TYPEFUNCTORS_NO_TAG_OFFSET_FOR_FUNCTORS_VECTOR]))
+		[MR_TYPE_CTOR_FUNCTORS_NO_TAG_OFFSET_FOR_FUNCTORS_VECTOR]))
 
 	/*
 	** Macros to access the data in an equivalence type_functors,
 	** the equivalent type of this type.
 	*/
 
-#define MR_TYPEFUNCTORS_EQUIV_OFFSET_FOR_TYPE	((Integer) 1)
+#define MR_TYPE_CTOR_FUNCTORS_EQUIV_OFFSET_FOR_TYPE	((Integer) 1)
 
-#define MR_TYPEFUNCTORS_EQUIV_TYPE(Functors)				\
-	((Functors)[MR_TYPEFUNCTORS_EQUIV_OFFSET_FOR_TYPE])
+#define MR_TYPE_CTOR_FUNCTORS_EQUIV_TYPE(Functors)				\
+	((Functors)[MR_TYPE_CTOR_FUNCTORS_EQUIV_OFFSET_FOR_TYPE])
 
 /*---------------------------------------------------------------------------*/
 
 /*
 ** Macros and defintions for defining and dealing with the vectors
-** created by base_type_layouts (these are the same vectors referred to
-** by base_type_functors)
+** created by type_ctor_layouts (these are the same vectors referred to
+** by type_ctor_functors)
 ** 	- the simple_vector, describing a single functor
 ** 	- the enum_vector, describing an enumeration
 ** 	- the no_tag_vector, describing a single functor 
@@ -568,13 +568,13 @@
 */
 } MR_TypeLayout_EnumVector;
 
-#define MR_TYPELAYOUT_ENUM_VECTOR_IS_ENUM(Vector)			\
+#define MR_TYPE_CTOR_LAYOUT_ENUM_VECTOR_IS_ENUM(Vector)			\
 	((MR_TypeLayout_EnumVector *) (Vector))->enum_or_comp_const
 
-#define MR_TYPELAYOUT_ENUM_VECTOR_NUM_FUNCTORS(Vector)			\
+#define MR_TYPE_CTOR_LAYOUT_ENUM_VECTOR_NUM_FUNCTORS(Vector)			\
 	((MR_TypeLayout_EnumVector *) (Vector))->num_sharers
 
-#define MR_TYPELAYOUT_ENUM_VECTOR_FUNCTOR_NAME(Vector, N)		\
+#define MR_TYPE_CTOR_LAYOUT_ENUM_VECTOR_FUNCTOR_NAME(Vector, N)		\
 	( (&((MR_TypeLayout_EnumVector *)(Vector))->functor1) [N] )
 
 
@@ -582,25 +582,25 @@
 	** Macros for dealing with simple vectors.
 	*/
 
-#define MR_TYPELAYOUT_SIMPLE_VECTOR_OFFSET_FOR_ARITY		((Integer) 0)
-#define MR_TYPELAYOUT_SIMPLE_VECTOR_OFFSET_FOR_ARGS		((Integer) 1)
+#define MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_OFFSET_FOR_ARITY		((Integer) 0)
+#define MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_OFFSET_FOR_ARGS		((Integer) 1)
 	/* Note, these offsets are from the end of the args */
-#define MR_TYPELAYOUT_SIMPLE_VECTOR_OFFSET_FOR_FUNCTOR_NAME	((Integer) 1)
-#define MR_TYPELAYOUT_SIMPLE_VECTOR_OFFSET_FOR_FUNCTOR_TAG	((Integer) 2)
+#define MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_OFFSET_FOR_FUNCTOR_NAME	((Integer) 1)
+#define MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_OFFSET_FOR_FUNCTOR_TAG	((Integer) 2)
 
-#define MR_TYPELAYOUT_SIMPLE_VECTOR_ARITY(V)				\
-		((V)[MR_TYPELAYOUT_SIMPLE_VECTOR_OFFSET_FOR_ARITY])
+#define MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_ARITY(V)				\
+		((V)[MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_OFFSET_FOR_ARITY])
 
-#define MR_TYPELAYOUT_SIMPLE_VECTOR_ARGS(V)				\
-		(V + MR_TYPELAYOUT_SIMPLE_VECTOR_OFFSET_FOR_ARGS)
+#define MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_ARGS(V)				\
+		(V + MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_OFFSET_FOR_ARGS)
 
-#define MR_TYPELAYOUT_SIMPLE_VECTOR_FUNCTOR_NAME(V)			\
-		((String) ((V)[MR_TYPELAYOUT_SIMPLE_VECTOR_ARITY(V) +	\
-			MR_TYPELAYOUT_SIMPLE_VECTOR_OFFSET_FOR_FUNCTOR_NAME]))
-
-#define MR_TYPELAYOUT_SIMPLE_VECTOR_TAG(V)				\
-		((Word) ((V)[MR_TYPELAYOUT_SIMPLE_VECTOR_ARITY(V) +	\
-			MR_TYPELAYOUT_SIMPLE_VECTOR_OFFSET_FOR_FUNCTOR_TAG]))
+#define MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_FUNCTOR_NAME(V)			\
+		((String) ((V)[MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_ARITY(V) +	\
+			MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_OFFSET_FOR_FUNCTOR_NAME]))
+
+#define MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_TAG(V)				\
+		((Word) ((V)[MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_ARITY(V) +	\
+			MR_TYPE_CTOR_LAYOUT_SIMPLE_VECTOR_OFFSET_FOR_FUNCTOR_TAG]))
 
 	/*
 	** Macros for dealing with complicated vectors.
@@ -615,10 +615,10 @@
 */
 } MR_TypeLayout_ComplicatedVector;
 
-#define MR_TYPELAYOUT_COMPLICATED_VECTOR_NUM_SHARERS(Vector) 	\
+#define MR_TYPE_CTOR_LAYOUT_COMPLICATED_VECTOR_NUM_SHARERS(Vector) 	\
 	((MR_TypeLayout_ComplicatedVector *) (Vector))->num_sharers
 
-#define MR_TYPELAYOUT_COMPLICATED_VECTOR_GET_SIMPLE_VECTOR(Vector, N) 	\
+#define MR_TYPE_CTOR_LAYOUT_COMPLICATED_VECTOR_GET_SIMPLE_VECTOR(Vector, N) 	\
 	( (Word *) strip_tag((&((MR_TypeLayout_ComplicatedVector *)	\
 		(Vector))->simple_vector1) [N]) )
 		
@@ -634,16 +634,16 @@
 	ConstString name;
 } MR_TypeLayout_NoTagVector;
 
-#define MR_TYPELAYOUT_NO_TAG_VECTOR_IS_NO_TAG(Vector)			\
+#define MR_TYPE_CTOR_LAYOUT_NO_TAG_VECTOR_IS_NO_TAG(Vector)			\
 		((MR_TypeLayout_NoTagVector *) (Vector))->is_no_tag
 
-#define MR_TYPELAYOUT_NO_TAG_VECTOR_ARITY(Vector)			\
+#define MR_TYPE_CTOR_LAYOUT_NO_TAG_VECTOR_ARITY(Vector)			\
 		(1)
 
-#define MR_TYPELAYOUT_NO_TAG_VECTOR_ARGS(Vector)			\
+#define MR_TYPE_CTOR_LAYOUT_NO_TAG_VECTOR_ARGS(Vector)			\
 		&(((MR_TypeLayout_NoTagVector *) (Vector))->arg)
 		
-#define MR_TYPELAYOUT_NO_TAG_VECTOR_FUNCTOR_NAME(Vector)		\
+#define MR_TYPE_CTOR_LAYOUT_NO_TAG_VECTOR_FUNCTOR_NAME(Vector)		\
 		((MR_TypeLayout_NoTagVector *) (Vector))->name
 
 	/* 
@@ -655,43 +655,43 @@
 	Word equiv_type;
 } MR_TypeLayout_EquivVector;
 
-#define MR_TYPELAYOUT_EQUIV_OFFSET_FOR_TYPE	((Integer) 1)
+#define MR_TYPE_CTOR_LAYOUT_EQUIV_OFFSET_FOR_TYPE	((Integer) 1)
 
-#define MR_TYPELAYOUT_EQUIV_IS_EQUIV(Vector)				\
+#define MR_TYPE_CTOR_LAYOUT_EQUIV_IS_EQUIV(Vector)				\
 		(!((MR_TypeLayout_EquivVector *) (Vector))->is_no_tag)
 
-#define MR_TYPELAYOUT_EQUIV_TYPE(Vector)				\
+#define MR_TYPE_CTOR_LAYOUT_EQUIV_TYPE(Vector)				\
 		((MR_TypeLayout_EquivVector *) (Vector))->equiv_type
 
 /*---------------------------------------------------------------------------*/
 
 	/* 
 	** Macros for retreiving things from type_infos and
-	** base_type_infos
+	** type_ctor_infos
 	*/
 
-#define MR_TYPEINFO_GET_BASE_TYPEINFO(TypeInfo)				\
+#define MR_TYPEINFO_GET_TYPE_CTOR_INFO(TypeInfo)				\
 		((*TypeInfo) ? (Word *) *TypeInfo : (Word *) (Word) TypeInfo)
 
 #define MR_TYPEINFO_GET_HIGHER_ARITY(TypeInfo)				\
 		((Integer) (Word *) (TypeInfo)[TYPEINFO_OFFSET_FOR_PRED_ARITY]) 
 
-#define MR_BASE_TYPEINFO_GET_TYPEFUNCTORS(BaseTypeInfo)			\
+#define MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_FUNCTORS(BaseTypeInfo)			\
 		((Word *) (BaseTypeInfo)[OFFSET_FOR_BASE_TYPE_FUNCTORS])
 
-#define MR_BASE_TYPEINFO_GET_TYPELAYOUT(BaseTypeInfo)			\
+#define MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_LAYOUT(BaseTypeInfo)			\
 		((Word *) (BaseTypeInfo)[OFFSET_FOR_BASE_TYPE_LAYOUT])
 
-#define MR_BASE_TYPEINFO_GET_TYPELAYOUT_ENTRY(BaseTypeInfo, Tag)	\
-		(MR_BASE_TYPEINFO_GET_TYPELAYOUT(BaseTypeInfo)[(Tag)])
+#define MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_LAYOUT_ENTRY(BaseTypeInfo, Tag)	\
+		(MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_LAYOUT(BaseTypeInfo)[(Tag)])
 
-#define MR_BASE_TYPEINFO_GET_TYPE_ARITY(BaseTypeInfo)			\
+#define MR_TYPE_CTOR_INFO_GET_TYPE_ARITY(BaseTypeInfo)			\
 		(((Word *) (BaseTypeInfo))[OFFSET_FOR_COUNT])
 
-#define MR_BASE_TYPEINFO_GET_TYPE_NAME(BaseTypeInfo)			\
+#define MR_TYPE_CTOR_INFO_GET_TYPE_NAME(BaseTypeInfo)			\
 		(((String *) (BaseTypeInfo))[OFFSET_FOR_TYPE_NAME])
 
-#define MR_BASE_TYPEINFO_GET_TYPE_MODULE_NAME(BaseTypeInfo)		\
+#define MR_TYPE_CTOR_INFO_GET_TYPE_MODULE_NAME(BaseTypeInfo)		\
 		(((String *) (BaseTypeInfo))[OFFSET_FOR_TYPE_MODULE_NAME])
 
 /*---------------------------------------------------------------------------*/
@@ -833,8 +833,8 @@
 ** Return the data representation used by the data with the given
 ** functors_indicator and layout_entry.
 **
-** functors_indicator is part of the base_type_functors data structure.
-** layout_entry is the base_type_layout entry corresponding to the
+** functors_indicator is part of the type_ctor_functors data structure.
+** layout_entry is the type_ctor_layout entry corresponding to the
 ** primary tag of the data.
 **
 */

Tyson.



More information about the developers mailing list