[m-rev.] for review: fix link error caused by abstract equivalent types

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Mar 23 19:25:41 AEDT 2004


I intend to commit this tomorrow. Simon is welcome to review it before or
after commit.

Zoltan.

Fix a bug introduced by Simon's changes to equivalence types, which prevented
the browser for compiling when the library was compiled without intermodule
optimization. The symptom was a link error caused by the unify and compare
predicates for io__stream being local to io.c. This is a problem because
even though io__stream is primate to io.m, the browser generates references
to its unify and compare predicates, because io__stream is on the right hand
side of private type equivalences for io__input_stream and io__output_stream,
which are exported by io.m, and we now expand those equivalences.

compiler/hlds_data.m:
	Add an extra field to type constructors' definitions, saying whether
	the type constructor occurs on the right hand side of an equivalence.

	Make the orders of some predicate declarations and definitions
	consistent.

compiler/make_hlds.m:
	Fill in this field with a placeholder value.

compiler/equiv_type_hlds.m:
	Set this field to true if it is appropriate.

compiler/type_ctor_info.m:
	Fill in this field for builtin types (for which its value is moot,
	since such types are always exported).

compiler/hlds_pred.m:
	Change the definition of procedure_is_exported to say that a procedure
	is exported if it is a declared mode (not a mode created on demand in
	the calling module) of a unify or compare predicate of a type
	constructor in which this flag is set. This required changing the
	interface of procedure_is_exported to include a module_info.

compiler/export.m:
compiler/ml_code_gen.m:
compiler/rtti.m:
	Pass the extra argument to procedure_is_exported.

tests/hard_coded/abstract_eqv.{m,exp}:
tests/hard_coded/abstract_eqv_1.m:
	A new test case to check for the bug fixed by this change.

tests/hard_coded/Mmakefile:
	Enable the new test case.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/equiv_type_hlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/equiv_type_hlds.m,v
retrieving revision 1.3
diff -u -b -r1.3 equiv_type_hlds.m
--- compiler/equiv_type_hlds.m	21 Dec 2003 05:04:32 -0000	1.3
+++ compiler/equiv_type_hlds.m	22 Mar 2004 01:51:06 -0000
@@ -37,16 +37,18 @@
 :- import_module parse_tree__prog_data.
 :- import_module recompilation.
 
-:- import_module bool, list, map, require, std_util, term, varset.
+:- import_module bool, list, set, map, require, std_util, term, varset.
 
 replace_in_hlds(!ModuleInfo) :-
 	module_info_types(!.ModuleInfo, Types0),
-	map__foldl(add_type_to_eqv_map, Types0, map__init, EqvMap),
+	map__foldl2(add_type_to_eqv_map, Types0, map__init, EqvMap,
+		set__init, EqvExportTypes),
+	set__fold(mark_eqv_exported_types, EqvExportTypes, Types0, Types1),
 
 	module_info_get_maybe_recompilation_info(!.ModuleInfo,
 		MaybeRecompInfo0),
 	module_info_name(!.ModuleInfo, ModuleName),
-	map__map_foldl(replace_in_type_defn(ModuleName, EqvMap), Types0, Types,
+	map__map_foldl(replace_in_type_defn(ModuleName, EqvMap), Types1, Types,
 		MaybeRecompInfo0, MaybeRecompInfo),
 	module_info_set_types(Types, !ModuleInfo),
 	module_info_set_maybe_recompilation_info(MaybeRecompInfo, !ModuleInfo),
@@ -62,19 +64,52 @@
 		InstCache1, _).
 
 :- pred add_type_to_eqv_map(type_ctor::in, hlds_type_defn::in,
-		eqv_map::in, eqv_map::out) is det.
+	eqv_map::in, eqv_map::out, set(type_ctor)::in, set(type_ctor)::out)
+	is det.
 
-add_type_to_eqv_map(TypeCtor, Defn, !EqvMap) :-
+add_type_to_eqv_map(TypeCtor, Defn, !EqvMap, !EqvExportTypes) :-
 	hlds_data__get_type_defn_body(Defn, Body),
 	( Body = eqv_type(EqvType) ->
 		hlds_data__get_type_defn_tvarset(Defn, TVarSet),
 		hlds_data__get_type_defn_tparams(Defn, Params),
+		hlds_data__get_type_defn_status(Defn, Status),
 		map__det_insert(!.EqvMap, TypeCtor,
-			eqv_type_body(TVarSet, Params, EqvType), !:EqvMap)
+			eqv_type_body(TVarSet, Params, EqvType), !:EqvMap),
+		( status_is_exported(Status, yes) ->
+			add_type_ctors_to_set(EqvType, !EqvExportTypes)
+		;
+			true
+		)
+	;
+		true
+	).
+
+:- pred add_type_ctors_to_set((type)::in,
+	set(type_ctor)::in, set(type_ctor)::out) is det.
+
+add_type_ctors_to_set(Type, !Set) :-
+	( type_to_ctor_and_args(Type, TypeCtor, Args) ->
+		set__insert(!.Set, TypeCtor, !:Set),
+		list__foldl(add_type_ctors_to_set, Args, !Set)
 	;
 		true
 	).
 
+:- pred mark_eqv_exported_types(type_ctor::in, type_table::in, type_table::out)
+	is det.
+
+mark_eqv_exported_types(TypeCtor, !TypeTable) :-
+	( map__search(!.TypeTable, TypeCtor, Defn0) ->
+		set_type_defn_in_exported_eqv(yes, Defn0, Defn),
+		map__det_update(!.TypeTable, TypeCtor, Defn, !:TypeTable)
+	;
+		% We can get here for builtin `types' such as func. Since
+		% their unify and compare preds are in the runtime system,
+		% not generated by the compiler, marking them as exported
+		% in the compiler is moot.
+		true
+	).
+
 :- pred replace_in_type_defn(module_name::in, eqv_map::in, type_ctor::in,
 	hlds_type_defn::in, hlds_type_defn::out,
 	maybe(recompilation_info)::in, maybe(recompilation_info)::out) is det.
@@ -106,8 +141,7 @@
 		TVarSet = TVarSet0
 	),
 	equiv_type__finish_recording_expanded_items(
-		item_id(type_body, TypeCtor), EquivTypeInfo,
-		!MaybeRecompInfo),
+		item_id(type_body, TypeCtor), EquivTypeInfo, !MaybeRecompInfo),
 	hlds_data__set_type_defn_body(Body, !Defn),
 	hlds_data__set_type_defn_tvarset(TVarSet, !Defn).
 
@@ -599,8 +633,7 @@
 		), InstMapDelta0, InstMapDelta,
 		{Changed0, TVarSet0, Cache0}, {Changed, TVarSet, Cache}),
 	( Changed = yes,
-		!:Info = (!.Info ^ tvarset := TVarSet)
-				^ inst_cache := Cache,
+		!:Info = (!.Info ^ tvarset := TVarSet) ^ inst_cache := Cache,
 		goal_info_set_instmap_delta(GoalInfo0, InstMapDelta, GoalInfo),
 		Goal = GoalExpr - GoalInfo
 	; Changed = no,
@@ -845,4 +878,3 @@
 	( Changed = yes, List = [H | T]
 	; Changed = no, List = List0
 	).
-
Index: compiler/export.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/export.m,v
retrieving revision 1.74
diff -u -b -r1.74 export.m
--- compiler/export.m	19 Mar 2004 10:19:19 -0000	1.74
+++ compiler/export.m	21 Mar 2004 14:55:50 -0000
@@ -321,7 +321,7 @@
 	map__lookup(Preds, PredId, PredInfo),
 	pred_info_import_status(PredInfo, Status),
 	(
-		( procedure_is_exported(PredInfo, ProcId)
+		( procedure_is_exported(Module, PredInfo, ProcId)
 		; status_defined_in_this_module(Status, no)
 		  % for --split-c-files, we need to treat
 		  % all procedures as if they were exported
Index: compiler/hlds_data.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_data.m,v
retrieving revision 1.82
diff -u -b -r1.82 hlds_data.m
--- compiler/hlds_data.m	21 Dec 2003 05:04:33 -0000	1.82
+++ compiler/hlds_data.m	23 Mar 2004 07:21:30 -0000
@@ -271,7 +271,7 @@
 :- type hlds_type_defn.
 
 :- pred hlds_data__set_type_defn(tvarset::in, list(type_param)::in,
-	hlds_type_body::in, import_status::in, need_qualifier::in,
+	hlds_type_body::in, import_status::in, bool::in, need_qualifier::in,
 	prog_context::in, hlds_type_defn::out) is det.
 
 :- pred get_type_defn_tvarset(hlds_type_defn::in, tvarset::out) is det.
@@ -279,16 +279,19 @@
 	is det.
 :- pred get_type_defn_body(hlds_type_defn::in, hlds_type_body::out) is det.
 :- pred get_type_defn_status(hlds_type_defn::in, import_status::out) is det.
+:- pred get_type_defn_in_exported_eqv(hlds_type_defn::in, bool::out) is det.
 :- pred get_type_defn_need_qualifier(hlds_type_defn::in, need_qualifier::out)
 	is det.
 :- pred get_type_defn_context(hlds_type_defn::in, prog_context::out) is det.
 
-:- pred set_type_defn_status(import_status::in,
-	hlds_type_defn::in, hlds_type_defn::out) is det.
 :- pred set_type_defn_body(hlds_type_body::in,
 	hlds_type_defn::in, hlds_type_defn::out) is det.
 :- pred set_type_defn_tvarset(tvarset::in,
 	hlds_type_defn::in, hlds_type_defn::out) is det.
+:- pred set_type_defn_status(import_status::in,
+	hlds_type_defn::in, hlds_type_defn::out) is det.
+:- pred set_type_defn_in_exported_eqv(bool::in,
+	hlds_type_defn::in, hlds_type_defn::out) is det.
 
 	% An `hlds_type_body' holds the body of a type definition:
 	% du = discriminated union, uu = undiscriminated union,
@@ -534,17 +537,31 @@
 :- type hlds_type_defn --->
 	hlds_type_defn(
 		type_defn_tvarset	:: tvarset,
-					% Names of type vars (empty
-					% except for polymorphic types)
+					% Names of the type variables, if any.
 		type_defn_params	:: list(type_param),
-					% Formal type parameters
+					% Formal type parameters.
 		type_defn_body		:: hlds_type_body,
-					% The definition of the type
+					% The definition of the type.
 
 		type_defn_import_status	:: import_status,
-					% Is the type defined in this
-					% module, and if yes, is it
-					% exported
+					% Is the type defined in this module,
+					% and if yes, is it exported.
+
+		type_defn_in_exported_eqv :: bool,
+					% Does the type constructor appear
+					% on the right hand side of a type
+					% equivalence defining a type that
+					% is visible from outside this module?
+					% If yes, equiv_type_hlds may generate
+					% references to this type constructor's
+					% unify and compare preds from other
+					% modules even if the type is otherwise
+					% local to the module, so we can't make
+					% their implementations private to the
+					% module.
+					%
+					% Meaningful only after the
+					% equiv_type_hlds pass.
 
 		type_defn_need_qualifier :: need_qualifier,
 					% Do uses of the type and
@@ -566,22 +583,25 @@
 	).
 
 hlds_data__set_type_defn(Tvarset, Params, Body, Status,
-		NeedQual, Context, Defn) :-
-	Defn = hlds_type_defn(Tvarset, Params, Body,
-			Status, NeedQual, Context).
-
-hlds_data__get_type_defn_tvarset(Defn, Defn ^ type_defn_tvarset).
-hlds_data__get_type_defn_tparams(Defn, Defn ^ type_defn_params).
-hlds_data__get_type_defn_body(Defn, Defn ^ type_defn_body).
-hlds_data__get_type_defn_status(Defn, Defn ^ type_defn_import_status).
-hlds_data__get_type_defn_need_qualifier(Defn, Defn ^ type_defn_need_qualifier).
-hlds_data__get_type_defn_context(Defn, Defn ^ type_defn_context).
+		InExportedEqv, NeedQual, Context, Defn) :-
+	Defn = hlds_type_defn(Tvarset, Params, Body, Status, InExportedEqv,
+		NeedQual, Context).
+
+get_type_defn_tvarset(Defn, Defn ^ type_defn_tvarset).
+get_type_defn_tparams(Defn, Defn ^ type_defn_params).
+get_type_defn_body(Defn, Defn ^ type_defn_body).
+get_type_defn_status(Defn, Defn ^ type_defn_import_status).
+get_type_defn_in_exported_eqv(Defn, Defn ^ type_defn_in_exported_eqv).
+get_type_defn_need_qualifier(Defn, Defn ^ type_defn_need_qualifier).
+get_type_defn_context(Defn, Defn ^ type_defn_context).
 
-hlds_data__set_type_defn_body(Body, Defn, Defn ^ type_defn_body := Body).
-hlds_data__set_type_defn_tvarset(TVarSet, Defn,
+set_type_defn_body(Body, Defn, Defn ^ type_defn_body := Body).
+set_type_defn_tvarset(TVarSet, Defn,
 		Defn ^ type_defn_tvarset := TVarSet).
-hlds_data__set_type_defn_status(Status, Defn,
+set_type_defn_status(Status, Defn,
 		Defn ^ type_defn_import_status := Status).
+set_type_defn_in_exported_eqv(InExportedEqv, Defn,
+		Defn ^ type_defn_in_exported_eqv := InExportedEqv).
 
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
Index: compiler/hlds_pred.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.139
diff -u -b -r1.139 hlds_pred.m
--- compiler/hlds_pred.m	12 Feb 2004 03:36:14 -0000	1.139
+++ compiler/hlds_pred.m	22 Mar 2004 10:56:23 -0000
@@ -678,7 +678,8 @@
 	% procedure_is_exported includes all modes of exported or
 	% exported_to_submodules predicates, plus the in-in mode
 	% for pseudo_exported unification predicates.
-:- pred procedure_is_exported(pred_info::in, proc_id::in) is semidet.
+:- pred procedure_is_exported(module_info::in, pred_info::in, proc_id::in)
+	is semidet.
 
 	% Set the import_status of the predicate to `imported'.
 	% This is used for `:- external(foo/2).' declarations.
@@ -1187,7 +1188,7 @@
 	pred_info_import_status(PredInfo, ImportStatus),
 	ImportStatus = pseudo_exported.
 
-procedure_is_exported(PredInfo, ProcId) :-
+procedure_is_exported(ModuleInfo, PredInfo, ProcId) :-
 	(
 		pred_info_is_exported(PredInfo)
 	;
@@ -1201,6 +1202,28 @@
 		pred_info_import_status(PredInfo, ImportStatus),
 		ImportStatus = external(ExternalImportStatus),
 		status_is_exported(ExternalImportStatus, yes)
+	;
+		pred_info_get_maybe_special_pred(PredInfo, yes(SpecialPred)),
+		SpecialPred = SpecialId - TypeCtor,
+		module_info_types(ModuleInfo, TypeTable),
+		% If the search fails, then TypeCtor must be a builtin type
+		% constructor, such as the tuple constructor.
+		map__search(TypeTable, TypeCtor, TypeDefn),
+		get_type_defn_in_exported_eqv(TypeDefn, yes),
+		(
+			SpecialId = unify,
+			% The other proc_ids are module-specific.
+			hlds_pred__in_in_unification_proc_id(ProcId)
+		;
+			SpecialId = compare
+			% The declared modes are all global, and we don't
+			% generate any modes for compare preds dynamically.
+		;
+			SpecialId = index,
+			% The index predicate is never called from anywhere
+			% except the compare predicate.
+			fail
+		)
 	).
 
 pred_info_mark_as_external(PredInfo0, PredInfo) :-
Index: compiler/make_hlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/make_hlds.m,v
retrieving revision 1.463
diff -u -b -r1.463 make_hlds.m
--- compiler/make_hlds.m	23 Mar 2004 06:56:40 -0000	1.463
+++ compiler/make_hlds.m	23 Mar 2004 06:56:49 -0000
@@ -2146,7 +2146,7 @@
 		Status = Status1,
 		Body = Body0
 	),
-	hlds_data__set_type_defn(TVarSet, Args, Body, Status,
+	hlds_data__set_type_defn(TVarSet, Args, Body, Status, no,
 		NeedQual, Context, T),
 	(
 		MaybeOldDefn = no,
@@ -2189,6 +2189,8 @@
 		hlds_data__get_type_defn_body(T2, Body_2),
 		hlds_data__get_type_defn_context(T2, OrigContext),
 		hlds_data__get_type_defn_status(T2, OrigStatus),
+		hlds_data__get_type_defn_in_exported_eqv(T2,
+			OrigInExportedEqv),
 		hlds_data__get_type_defn_need_qualifier(T2, OrigNeedQual),
 		Body_2 \= abstract_type(_)
 	->
@@ -2209,8 +2211,8 @@
 				true
 			;
 				hlds_data__set_type_defn(TVarSet_2, Params_2,
-					Body_2, Status, OrigNeedQual,
-					OrigContext, T3),
+					Body_2, Status, OrigInExportedEqv,
+					OrigNeedQual, OrigContext, T3),
 				map__det_update(Types0, TypeCtor, T3, Types),
 				module_info_set_types(Types, !Module)
 			)
@@ -2223,8 +2225,8 @@
 					Status1)
 			->
 				hlds_data__set_type_defn(TVarSet_2, Params_2,
-					NewBody, Status, NeedQual,
-					Context, T3),
+					NewBody, Status, OrigInExportedEqv,
+					NeedQual, Context, T3),
 				map__det_update(Types0, TypeCtor, T3, Types),
 				module_info_set_types(Types, !Module)
 			;
Index: compiler/ml_code_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_code_gen.m,v
retrieving revision 1.136
diff -u -b -r1.136 ml_code_gen.m
--- compiler/ml_code_gen.m	19 Mar 2004 10:19:22 -0000	1.136
+++ compiler/ml_code_gen.m	21 Mar 2004 14:29:53 -0000
@@ -1043,8 +1043,7 @@
 	ml_gen_proc_label(ModuleInfo, PredId, ProcId, Name, _ModuleName),
 	MLDS_Context = mlds__make_context(Context),
 	DeclFlags = ml_gen_proc_decl_flags(ModuleInfo, PredId, ProcId),
-	ml_gen_proc_defn(ModuleInfo, PredId, ProcId,
-		ProcDefnBody, ExtraDefns),
+	ml_gen_proc_defn(ModuleInfo, PredId, ProcId, ProcDefnBody, ExtraDefns),
 	ProcDefn = mlds__defn(Name, MLDS_Context, DeclFlags, ProcDefnBody),
 	!:Defns = list__append(ExtraDefns, [ProcDefn | !.Defns]),
 	ml_gen_maybe_add_table_var(ModuleInfo, PredId, ProcId, ProcInfo,
@@ -1098,7 +1097,7 @@
 
 ml_gen_proc_decl_flags(ModuleInfo, PredId, ProcId) = DeclFlags :-
 	module_info_pred_info(ModuleInfo, PredId, PredInfo),
-	( procedure_is_exported(PredInfo, ProcId) ->
+	( procedure_is_exported(ModuleInfo, PredInfo, ProcId) ->
 		Access = public
 	;
 		Access = private
Index: compiler/rtti.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rtti.m,v
retrieving revision 1.43
diff -u -b -r1.43 rtti.m
--- compiler/rtti.m	20 Feb 2004 04:43:44 -0000	1.43
+++ compiler/rtti.m	21 Mar 2004 14:44:08 -0000
@@ -983,7 +983,8 @@
 	modes_to_arg_modes(ModuleInfo, ProcModes, ArgTypes, ProcArgModes),
 	IsImported = (pred_info_is_imported(PredInfo) -> yes ; no),
 	IsPseudoImp = (pred_info_is_pseudo_imported(PredInfo) -> yes ; no),
-	IsExported = (procedure_is_exported(PredInfo, ProcId) -> yes ; no),
+	IsExported = (procedure_is_exported(ModuleInfo, PredInfo, ProcId)
+		-> yes ; no),
 	pred_info_get_maybe_special_pred(PredInfo, MaybeSpecial),
 	ProcHeadVarsWithNames = list__map((func(Var) = Var - Name :-
 			Name = varset__lookup_name(ProcVarSet, Var)
Index: compiler/type_ctor_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/type_ctor_info.m,v
retrieving revision 1.54
diff -u -b -r1.54 type_ctor_info.m
--- compiler/type_ctor_info.m	23 Mar 2004 06:56:42 -0000	1.54
+++ compiler/type_ctor_info.m	23 Mar 2004 07:03:58 -0000
@@ -206,7 +206,7 @@
 	NeedQualifier = may_be_unqualified,
 	term__context_init(Context),
 	hlds_data__set_type_defn(TVarSet, Params, Body,
-		ImportStatus, NeedQualifier, Context, TypeDefn).
+		ImportStatus, no, NeedQualifier, Context, TypeDefn).
 
 :- pred type_ctor_info__gen_type_ctor_gen_info(type_ctor::in, string::in,
 	int::in, hlds_type_defn::in, module_name::in, module_info::in,
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing java
cvs diff: Diffing java/library
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
Index: tests/hard_coded/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/hard_coded/Mmakefile,v
retrieving revision 1.229
diff -u -b -r1.229 Mmakefile
--- tests/hard_coded/Mmakefile	19 Mar 2004 09:51:26 -0000	1.229
+++ tests/hard_coded/Mmakefile	23 Mar 2004 08:19:19 -0000
@@ -5,6 +5,7 @@
 #-----------------------------------------------------------------------------#
 
 ORDINARY_PROGS=	\
+	abstract_eqv \
 	address_of_builtins \
 	agg \
 	any_free_unify \
Index: tests/hard_coded/abstract_eqv.exp
===================================================================
RCS file: tests/hard_coded/abstract_eqv.exp
diff -N tests/hard_coded/abstract_eqv.exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/hard_coded/abstract_eqv.exp	23 Mar 2004 08:20:04 -0000
@@ -0,0 +1,3 @@
+a = b: false
+a = b: false
+b = b: true
Index: tests/hard_coded/abstract_eqv.m
===================================================================
RCS file: tests/hard_coded/abstract_eqv.m
diff -N tests/hard_coded/abstract_eqv.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/hard_coded/abstract_eqv.m	23 Mar 2004 08:18:51 -0000
@@ -0,0 +1,29 @@
+:- module abstract_eqv.
+
+:- interface.
+
+:- import_module io.
+
+:- pred main(io::di, io::uo) is det.
+
+:- implementation.
+
+:- import_module abstract_eqv_1.
+
+main(!IO) :-
+	test(val1, val2, !IO),
+	test(val1, val3, !IO),
+	test(val2, val3, !IO).
+
+:- pred test(t_abs::in, t_abs::in, io::di, io::uo) is det.
+
+test(A, B, !IO) :-
+	io__write(A, !IO),
+	io__write_string(" = ", !IO),
+	io__write(B, !IO),
+	io__write_string(": ", !IO),
+	( A = B ->
+		io__write_string("true\n", !IO)
+	;
+		io__write_string("false\n", !IO)
+	).
Index: tests/hard_coded/abstract_eqv_1.m
===================================================================
RCS file: tests/hard_coded/abstract_eqv_1.m
diff -N tests/hard_coded/abstract_eqv_1.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/hard_coded/abstract_eqv_1.m	23 Mar 2004 08:18:51 -0000
@@ -0,0 +1,19 @@
+:- module abstract_eqv_1.
+
+:- interface.
+
+:- type t_abs.
+
+:- func val1 = t_abs.
+:- func val2 = t_abs.
+:- func val3 = t_abs.
+
+:- implementation.
+
+:- type t_abs == t_concrete.
+
+:- type t_concrete --->	a ; b ; c.
+
+val1 = a.
+val2 = b.
+val3 = b.
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
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