[m-dev.] diff: merge trunk changes into alias branch [1/2]

David Overton dmo at cs.mu.OZ.AU
Tue Jul 13 14:38:22 AEST 1999


Hi,

This diff shows only the changes I had to make manually to resolve CVS
conflicts and get it to pass the bootcheck.

Estimated hours taken: 8

Merge trunk changes into alias branch up to tag trunk_snapshot_19990712123833.

Modified Files:
 Tag: alias
	.alias_trunk_sync_tag .cvsignore Mmakefile accumulator.m 
	base_type_info.m base_type_layout.m bytecode.m bytecode_gen.m 
	call_gen.m check_typeclass.m clause_to_proc.m code_util.m 
	common.m dead_proc_elim.m dense_switch.m dependency_graph.m 
	det_analysis.m det_report.m error_util.m follow_code.m 
	follow_vars.m goal_util.m higher_order.m hlds_data.m 
	hlds_goal.m hlds_module.m hlds_out.m hlds_pred.m inst.m 
	inst_util.m intermod.m ite_gen.m jumpopt.m lambda.m lco.m 
	live_vars.m llds.m llds_out.m lookup_switch.m magic.m 
	magic_util.m make_hlds.m mercury_compile.m mercury_to_c.m 
	mercury_to_goedel.m mercury_to_mercury.m middle_rec.m 
	mode_errors.m mode_info.m mode_util.m modecheck_call.m 
	modecheck_unify.m modes.m module_qual.m modules.m opt_debug.m 
	opt_util.m pd_cost.m polymorphism.m post_typecheck.m 
	prog_data.m prog_io.m prog_io_goal.m prog_io_pragma.m 
	prog_io_util.m prog_util.m purity.m quantification.m rl.m 
	rl_block_opt.m rl_code.m rl_dump.m rl_exprn.m rl_gen.m 
	rl_key.m rl_liveness.m rl_out.pp rl_sort.m simplify.m 
	string_switch.m table_gen.m tag_switch.m term_errors.m 
	term_traversal.m term_util.m termination.m transform_llds.m 
	tree.m type_util.m typecheck.m unify_gen.m unify_proc.m 
	unique_modes.m unused_args.m value_number.m vn_block.m 
	vn_cost.m vn_flush.m vn_type.m vn_util.m vn_verify.m 
Added Files:
 Tag: alias
	builtin_ops.m mlds.m 

--- accumulator.m	Tue Jul 13 14:16:18 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/accumulator.m	Mon Jul 12 12:48:03 1999
@@ -322,25 +322,17 @@
 	->
 		(
 			accumulator__split_recursive_case(PredId, ProcId,
-<<<<<<< accumulator.m
+					InitialInstMap, [],
 					InitialInstMap, InstTable,
 					ModuleInfo, FullyStrict,
-=======
-					InitialInstMap, [],
-					InitialInstMap, ModuleInfo, FullyStrict,
->>>>>>> 1.4
 					GoalAList, Rec0),
 
 				% Make sure that the base case doesn't
 				% contain a recursive call.
 			\+ accumulator__split_recursive_case(PredId, ProcId,
-<<<<<<< accumulator.m
+					InitialInstMap, [],
 					InitialInstMap, InstTable,
 					ModuleInfo, FullyStrict,
-=======
-					InitialInstMap, [],
-					InitialInstMap, ModuleInfo, FullyStrict,
->>>>>>> 1.4
 					GoalBList, _)
 		->
 			Type = switch_rec_base,
@@ -348,25 +340,17 @@
 			Rec = Rec0
 		;
 			accumulator__split_recursive_case(PredId, ProcId,
-<<<<<<< accumulator.m
+					InitialInstMap, [],
 					InitialInstMap, InstTable,
 					ModuleInfo, FullyStrict,
-=======
-					InitialInstMap, [],
-					InitialInstMap, ModuleInfo, FullyStrict,
->>>>>>> 1.4
 					GoalBList, Rec0),
 
 				% Make sure that the base case doesn't
 				% contain a recursive call.
 			\+ accumulator__split_recursive_case(PredId, ProcId,
-<<<<<<< accumulator.m
+					InitialInstMap, [],
 					InitialInstMap, InstTable,
 					ModuleInfo, FullyStrict,
-=======
-					InitialInstMap, [],
-					InitialInstMap, ModuleInfo, FullyStrict,
->>>>>>> 1.4
 					GoalAList, _)
 		->
 			Type = switch_base_rec,
@@ -384,15 +368,15 @@
 		(
 			accumulator__split_recursive_case(PredId, ProcId,
 					InitialInstMap, [],
-					InitialInstMap, ModuleInfo, FullyStrict,
-					GoalAList, Rec0),
+					InitialInstMap, InstTable, ModuleInfo,
+					FullyStrict, GoalAList, Rec0),
 
 				% Make sure that the base case doesn't
 				% contain a recursive call.
 			\+ accumulator__split_recursive_case(PredId, ProcId,
 					InitialInstMap, [],
-					InitialInstMap, ModuleInfo, FullyStrict,
-					GoalBList, _)
+					InitialInstMap, InstTable, ModuleInfo,
+					FullyStrict, GoalBList, _)
 		->
 			Type = disj_rec_base,
 			Base = base(GoalBList),
@@ -400,15 +384,15 @@
 		;
 			accumulator__split_recursive_case(PredId, ProcId,
 					InitialInstMap, [],
-					InitialInstMap, ModuleInfo, FullyStrict,
-					GoalBList, Rec0),
+					InitialInstMap, InstTable, ModuleInfo,
+					FullyStrict, GoalBList, Rec0),
 
 				% Make sure that the base case doesn't
 				% contain a recursive call.
 			\+ accumulator__split_recursive_case(PredId, ProcId,
 					InitialInstMap, [],
-					InitialInstMap, ModuleInfo, FullyStrict,
-					GoalAList, _)
+					InitialInstMap, InstTable, ModuleInfo,
+					FullyStrict, GoalAList, _)
 		->
 			Type = disj_base_rec,
 			Base = base(GoalAList),
@@ -431,15 +415,16 @@
 		(
 			accumulator__split_recursive_case(PredId, ProcId,
 					InitialInstMap, IfList,
-					BeforeThenInstMap, ModuleInfo,
-					FullyStrict, ThenList, Rec0),
+					BeforeThenInstMap, InstTable,
+					ModuleInfo, FullyStrict, ThenList,
+					Rec0),
 
 				% Make sure that the base case doesn't
 				% contain a recursive call.
 			\+ accumulator__split_recursive_case(PredId, ProcId,
 					InitialInstMap, [],
-					InitialInstMap, ModuleInfo, FullyStrict,
-					ElseList, _)
+					InitialInstMap, InstTable, ModuleInfo,
+					FullyStrict, ElseList, _)
 		->
 			Type = ite_rec_base,
 			Base = base(ElseList),
@@ -447,15 +432,15 @@
 		;
 			accumulator__split_recursive_case(PredId, ProcId,
 					InitialInstMap, [],
-					InitialInstMap, ModuleInfo, FullyStrict,
-					ElseList, Rec0),
+					InitialInstMap, InstTable, ModuleInfo,
+					FullyStrict, ElseList, Rec0),
 
 				% Make sure that the base case doesn't
 				% contain a recursive call.
 			\+ accumulator__split_recursive_case(PredId, ProcId,
 					InitialInstMap, [],
-					InitialInstMap, ModuleInfo, FullyStrict,
-					ThenList, _)
+					InitialInstMap, InstTable, ModuleInfo,
+					FullyStrict, ThenList, _)
 		->
 			Type = ite_base_rec,
 			Base = base(ThenList),
@@ -681,25 +666,14 @@
 		NewBaseGoal, NewRecGoal, OrigGoal, NewGoal) :-
 	(
 		Goal = switch(Var, CanFail, Cases0, StoreMap) - GoalInfo,
-		Cases0 = [case(IdA, InstA, _), case(IdB, InstB, _)]
+		Cases0 = [case(IdA, IMDA, _), case(IdB, IMDB, _)]
 	->
-<<<<<<< accumulator.m
-		OrigCases = [case(IdA, InstA, OrigRecGoal),
-				case(IdB, InstB, OrigBaseGoal)],
-		OrigGoal = switch(Var, CanFail, OrigCases, StoreMap) - GoalInfo,
-
-		NewCases = [case(IdA, InstA, NewRecGoal),
-				case(IdB, InstB, NewBaseGoal)],
-		NewGoal = switch(Var, CanFail, NewCases, StoreMap) - GoalInfo
-	;
-		fail
-	).
-
-=======
-		OrigCases = [case(IdA, OrigBaseGoal), case(IdB, OrigRecGoal)],
+		OrigCases = [case(IdA, IMDA, OrigBaseGoal),
+				case(IdB, IMDB, OrigRecGoal)],
 		OrigGoal = switch(Var, CanFail, OrigCases, StoreMap) - GoalInfo,
 
-		NewCases = [case(IdA, NewBaseGoal), case(IdB, NewRecGoal)],
+		NewCases = [case(IdA, IMDA, NewBaseGoal),
+				case(IdB, IMDB, NewRecGoal)],
 		NewGoal = switch(Var, CanFail, NewCases, StoreMap) - GoalInfo
 	;
 		error("accumulator__top_level: not the correct top level")
@@ -708,12 +682,14 @@
 		NewBaseGoal, NewRecGoal, OrigGoal, NewGoal) :-
 	(
 		Goal = switch(Var, CanFail, Cases0, StoreMap) - GoalInfo,
-		Cases0 = [case(IdA, _), case(IdB, _)]
+		Cases0 = [case(IdA, IMDA, _), case(IdB, IMDB, _)]
 	->
-		OrigCases = [case(IdA, OrigRecGoal), case(IdB, OrigBaseGoal)],
+		OrigCases = [case(IdA, IMDA, OrigRecGoal),
+				case(IdB, IMDB, OrigBaseGoal)],
 		OrigGoal = switch(Var, CanFail, OrigCases, StoreMap) - GoalInfo,
 
-		NewCases = [case(IdA, NewRecGoal), case(IdB, NewBaseGoal)],
+		NewCases = [case(IdA, IMDA, NewRecGoal),
+				case(IdB, IMDB, NewBaseGoal)],
 		NewGoal = switch(Var, CanFail, NewCases, StoreMap) - GoalInfo
 	;
 		error("accumulator__top_level: not the correct top level")
@@ -773,7 +749,6 @@
 		error("accumulator__top_level: not the correct top level")
 	).
 
->>>>>>> 1.4
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
 
@@ -806,22 +781,14 @@
 	% structure, R.
 	%
 :- pred accumulator__split_recursive_case(pred_id::in, proc_id::in,
-<<<<<<< accumulator.m
-		instmap::in, inst_table::in, module_info::in, bool::in,
-=======
 		instmap::in, hlds_goals::in,
-		instmap::in, module_info::in, bool::in,
->>>>>>> 1.4
+		instmap::in, inst_table::in, module_info::in, bool::in,
 		hlds_goals::in, rec_goal::out) is semidet.
 
 accumulator__split_recursive_case(PredId, ProcId,
-<<<<<<< accumulator.m
+		PreInstMap, PreGoals,
 		InitialInstMap, InstTable, ModuleInfo,
 		FullyStrict, Goals, RecGoal) :-
-=======
-		PreInstMap, PreGoals,
-		InitialInstMap, ModuleInfo, FullyStrict, Goals, RecGoal) :-
->>>>>>> 1.4
 	solutions(accumulator__split_goals(Goals, PredId, ProcId), Solns),
 	Solns = [recursive(DP0, R, C0)],
 	calculate_instmap(DP0, InitialInstMap, InitialInstMapBeforeR),
@@ -839,16 +806,10 @@
 	calculate_instmap(DP, InitialInstMap, InstMapBeforeR),
 	calculate_instmap([R], InstMapBeforeR, InstMapBeforeC),
 
-<<<<<<< accumulator.m
+	Pre		 = goal(PreGoals, PreInstMap, InstTable),
 	DecomposeProcess = goal(DP, InitialInstMap, InstTable),
 	Recursive 	 = goal(R, InstMapBeforeR, InstTable),
 	Compose 	 = goal(C, InstMapBeforeC, InstTable),
-=======
-	Pre		 = goal(PreGoals, PreInstMap),
-	DecomposeProcess = goal(DP, InitialInstMap),
-	Recursive 	 = goal(R, InstMapBeforeR),
-	Compose 	 = goal(C, InstMapBeforeC),
->>>>>>> 1.4
 
 	RecGoal = recursive(Pre, DecomposeProcess, Recursive, Compose).
 
@@ -976,16 +937,11 @@
 		a_goals::in, prog_vars::out) is det.
 
 accumulator__extra_vars_for_recursive_call(
-<<<<<<< accumulator.m
-		goal(DecomposeProcess, _InstMapBeforeDP, _InstTableDP),
-		goal(Compose, _InstMapBeforeCompose, _InstTableC), Vars) :-
-=======
-		goal(PreDecomposeProcess, _InstMapBeforePreDecomposeProcess),
-		goal(DecomposeProcess, _InstMapBeforeDecomposeProcess),
-		goal(Compose, _InstMapBeforeCompose), Vars) :-
+		goal(PreDecomposeProcess, _, _),
+		goal(DecomposeProcess, _, _),
+		goal(Compose, _, _), Vars) :-
 
 	goal_list_nonlocals(PreDecomposeProcess, PreDPNonLocalsSet),
->>>>>>> 1.4
 	goal_list_nonlocals(DecomposeProcess, DPNonLocalsSet),
 	set__union(PreDPNonLocalsSet, DPNonLocalsSet, NonLocals),
 
@@ -1118,19 +1074,13 @@
 		subst::in, subst::in, hlds_goal::out) is det.
 
 accumulator__new_base_case(Base, C, Y0stoYs_Subst, HstoAs_Subst, Goal) :-
-<<<<<<< accumulator.m
 	C = goal(Compose, _InstMapBeforeCompose, _InstTableCompose),
-	reverse_subst(Y0stoYs_Subst, YstoY0s_Subst),
 
-=======
-	C = goal(Compose, _InstMapBeforeCompose),
-
 	reverse_subst(Y0stoYs_Subst, YstoY0s_Subst0),
 
 	goal_list_nonlocals(Compose, NonLocals),
 	map__select(YstoY0s_Subst0, NonLocals, YstoY0s_Subst),
 
->>>>>>> 1.4
 	goal_util__rename_vars_in_goals(Base, no, YstoY0s_Subst, NewBase),
 	goal_util__rename_vars_in_goals(Compose, no, HstoAs_Subst, NewCompose),
 
@@ -1746,7 +1696,6 @@
 	mode_is_input(InstMap, InstTable, ModuleInfo, In),
 	mode_is_output(InstMap, InstTable, ModuleInfo, Out).
 
-<<<<<<< accumulator.m
 assoc_fact(unqualified("int"), "*", 3, InstMap,
 		argument_modes(InstTable, [In, In, Out]),
 		ModuleInfo, [A, B, C], [A, B, C], PossibleStaticVars, no) :-
@@ -1754,18 +1703,15 @@
 	mode_is_input(InstMap, InstTable, ModuleInfo, In),
 	mode_is_output(InstMap, InstTable, ModuleInfo, Out).
 
-=======
-assoc_fact(unqualified("list"), "append", 3, [TypeInfoIn, In, In, Out], 
+assoc_fact(unqualified("list"), "append", 3, InstMap,
+		argument_modes(InstTable, [TypeInfoIn, In, In, Out]), 
 		ModuleInfo, [TypeInfo, A, B, C], 
 		[TypeInfo, B, A, C], PossibleStaticVars, yes) :-
 	set__list_to_set([A, B], PossibleStaticVars),
-	mode_is_input(ModuleInfo, TypeInfoIn),
-	mode_is_input(ModuleInfo, In),
-	mode_is_output(ModuleInfo, Out).
-
-
+	mode_is_input(InstMap, InstTable, ModuleInfo, TypeInfoIn),
+	mode_is_input(InstMap, InstTable, ModuleInfo, In),
+	mode_is_output(InstMap, InstTable, ModuleInfo, Out).
 
->>>>>>> 1.4
 /* XXX introducing accumulators for floating point numbers can be bad.
 assoc_fact(unqualified("float"), "+", 3, InstMap,
 		argument_modes(InstTable, [In, In, Out]), ModuleInfo, 
@@ -1781,19 +1727,6 @@
 	mode_is_input(InstMap, InstTable, ModuleInfo, In),
 	mode_is_output(InstMap, InstTable, ModuleInfo, Out).
 */
-<<<<<<< accumulator.m
-
-assoc_fact(unqualified("list"), "append", 3, InstMap,
-		argument_modes(InstTable, [TypeInfoIn, In, In, Out]), 
-		ModuleInfo, [TypeInfo, A, B, C], 
-		[TypeInfo, B, A, C], PossibleStaticVars, yes) :-
-	set__list_to_set([A, B], PossibleStaticVars),
-	mode_is_input(InstMap, InstTable, ModuleInfo, TypeInfoIn),
-	mode_is_input(InstMap, InstTable, ModuleInfo, In),
-	mode_is_output(InstMap, InstTable, ModuleInfo, Out).
-
-=======
->>>>>>> 1.4
 /*
 	XXX this no longer works, because set__insert isn't associative.
 
--- continuation_info.m	Tue Jul 13 14:16:25 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/continuation_info.m	Mon Jul 12 14:09:51 1999
@@ -52,7 +52,7 @@
 
 :- interface.
 
-:- import_module llds, hlds_module, hlds_pred, prog_data.
+:- import_module llds, hlds_module, hlds_pred, hlds_data, prog_data.
 :- import_module (inst), instmap, trace, globals.
 :- import_module std_util, bool, list, assoc_list, set, map.
 
--- hlds_goal.m	Tue Jul 13 14:16:35 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/hlds_goal.m	Tue Jul  6 16:01:13 1999
@@ -1201,7 +1201,8 @@
 set_goal_contexts_2(Context, switch(Var, CanFail, Cases0, SM),
 		switch(Var, CanFail, Cases, SM)) :-
 	list__map(
-	    (pred(case(ConsId, Goal0)::in, case(ConsId, Goal)::out) is det :-
+	    (pred(case(ConsId, IMD, Goal0)::in, case(ConsId, IMD, Goal)::out)
+	    		is det :-
 		set_goal_contexts(Context, Goal0, Goal)
 	    ), Cases0, Cases).
 set_goal_contexts_2(Context, some(Vars, Goal0), some(Vars, Goal)) :-
--- hlds_module.m	Tue Jul 13 14:16:36 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/hlds_module.m	Mon Jul 12 12:49:35 1999
@@ -637,13 +637,8 @@
 		[], [], StratPreds, UnusedArgInfo, 0, ModuleNames,
 		no_aditi_compilation, TypeSpecInfo),
 	ModuleInfo = module(ModuleSubInfo, PredicateTable, Requests,
-<<<<<<< hlds_module.m
 		UnifyPredMap, GlobalData, Types, UserInsts, Modes, Ctors,
-		ClassTable, SuperClassTable, InstanceTable, 0).
-=======
-		UnifyPredMap, GlobalData, Types, Insts, Modes, Ctors,
 		ClassTable, SuperClassTable, InstanceTable, AssertionTable, 0).
->>>>>>> 1.45
 
 %-----------------------------------------------------------------------------%
 
@@ -843,13 +838,8 @@
 module_info_types(MI0, F) :-
 	MI0 = module(_, _, _, _, _, F, _, _, _, _, _, _, _, _).
 
-<<<<<<< hlds_module.m
 module_info_user_insts(MI0, G) :-
-	MI0 = module(_, _, _, _, _, _, G, _, _, _, _, _, _).
-=======
-module_info_insts(MI0, G) :-
 	MI0 = module(_, _, _, _, _, _, G, _, _, _, _, _, _, _).
->>>>>>> 1.45
 
 module_info_modes(MI0, H) :-
 	MI0 = module(_, _, _, _, _, _, _, H, _, _, _, _, _, _).
@@ -900,15 +890,9 @@
 	MI0 = module(A, B, C, D, E, _, G, H, I, J, K, L, M, N),
 	MI  = module(A, B, C, D, E, F, G, H, I, J, K, L, M, N).
 
-<<<<<<< hlds_module.m
 module_info_set_user_insts(MI0, G, MI) :-
-	MI0 = module(A, B, C, D, E, F, _, H, I, J, K, L, M),
-	MI  = module(A, B, C, D, E, F, G, H, I, J, K, L, M).
-=======
-module_info_set_insts(MI0, G, MI) :-
 	MI0 = module(A, B, C, D, E, F, _, H, I, J, K, L, M, N),
 	MI  = module(A, B, C, D, E, F, G, H, I, J, K, L, M, N).
->>>>>>> 1.45
 
 module_info_set_modes(MI0, H, MI) :-
 	MI0 = module(A, B, C, D, E, F, G, _, I, J, K, L, M, N),
--- hlds_out.m	Tue Jul 13 14:16:37 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/hlds_out.m	Mon Jul 12 12:41:20 1999
@@ -1328,13 +1328,9 @@
 			{ Unification = complicated_unify(Mode, CanFail,
 					TypeInfoVars) },
 			{ CanFail = can_fail },
-<<<<<<< hlds_out.m
 			{ Mode = (free(unique) - free(unique) -> 
-					free(unique) - free(unique)) }
-=======
-			{ Mode = (free - free -> free - free) },
+					free(unique) - free(unique)) },
 			{ TypeInfoVars = [] }
->>>>>>> 1.222
 		->
 			hlds_out__write_indent(Indent),
 			io__write_string("% Not yet classified\n")
@@ -1480,17 +1476,11 @@
 	),
 	!,
 	hlds_out_write_functor_and_submodes(ConsId, ArgVars, ArgModes,
-<<<<<<< hlds_out.m
 		InstMap0, InstTable, ModuleInfo, ProgVarSet, InstVarSet,
 		AppendVarnums, Indent).
-hlds_out__write_unification(complicated_unify(Mode, CanFail),
-		_InstMap0, InstTable, _ModuleInfo, _ProgVarSet, InstVarSet, _,
-		Indent) -->
-=======
-		ModuleInfo, ProgVarSet, InstVarSet, AppendVarnums, Indent).
 hlds_out__write_unification(complicated_unify(Mode, CanFail, TypeInfoVars),
-		_ModuleInfo, ProgVarSet, InstVarSet, AppendVarNums, Indent) -->
->>>>>>> 1.222
+		_InstMap0, InstTable, _ModuleInfo, ProgVarSet, InstVarSet,
+		AppendVarNums, Indent) -->
 	hlds_out__write_indent(Indent),
 	io__write_string("% "),
 	( { CanFail = can_fail },
@@ -1500,17 +1490,12 @@
 	),
 	!,
 	io__write_string("mode: "),
-<<<<<<< hlds_out.m
-
 	% XXX may need to pass InstMap0 here.
 	mercury_output_uni_mode(Mode, InstVarSet, InstTable),
-=======
-	mercury_output_uni_mode(Mode, InstVarSet),
 	io__write_string("\n"),
 	hlds_out__write_indent(Indent),
 	io__write_string("% type-info vars: "),
 	mercury_output_vars(TypeInfoVars, ProgVarSet, AppendVarNums),
->>>>>>> 1.222
 	io__write_string("\n").
 
 
--- hlds_pred.m	Tue Jul 13 14:16:38 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/hlds_pred.m	Mon Jul 12 12:41:21 1999
@@ -436,11 +436,9 @@
 	% This must only be called after polymorphism.m.
 :- pred hlds_pred__define_new_pred(hlds_goal, hlds_goal, list(prog_var),
 		list(prog_var), instmap, string, tvarset, map(prog_var, type),
-<<<<<<< hlds_pred.m
-		class_constraints, map(tvar, type_info_locn),
-		map(class_constraint, prog_var), prog_varset, pred_markers,
-		aditi_owner, is_address_taken, inst_table, module_info,
-		module_info, pred_proc_id).
+		class_constraints, type_info_varmap, typeclass_info_varmap,
+		prog_varset, pred_markers, aditi_owner, is_address_taken,
+		inst_table, module_info, module_info, pred_proc_id).
 :- mode hlds_pred__define_new_pred(in, out, in, out, in, in, in, in, in, in,
 		in, in, in, in, in, in, in, out, out) is det.
 
@@ -451,18 +449,11 @@
 :- pred hlds_pred__define_new_pred(hlds_goal, hlds_goal, list(prog_var),
 		list(prog_var), instmap, list(mode), string, tvarset,
 		map(prog_var, type), class_constraints,
-		map(tvar, type_info_locn), map(class_constraint, prog_var),
+		type_info_varmap, typeclass_info_varmap,
 		prog_varset, pred_markers, aditi_owner, is_address_taken,
 		inst_table, module_info, module_info, pred_proc_id).
 :- mode hlds_pred__define_new_pred(in, out, in, out, in, in, in, in, in, in,
 		in, in, in, in, in, in, in, in, out, out) is det.
-=======
-		class_constraints, type_info_varmap, typeclass_info_varmap,
-		prog_varset, pred_markers, aditi_owner, is_address_taken,
-		module_info, module_info, pred_proc_id).
-:- mode hlds_pred__define_new_pred(in, out, in, out, in, in, in, in, in,
-		in, in, in, in, in, in, in, out, out) is det.
->>>>>>> 1.61
 
 	% Various predicates for accessing the information stored in the
 	% pred_id and pred_info data structures.
@@ -1341,30 +1332,18 @@
 :- pred proc_info_set(maybe(determinism), prog_varset, map(prog_var, type),
 	list(prog_var), argument_modes, maybe(list(is_live)), hlds_goal,
 	prog_context, stack_slots, determinism, bool, list(arg_info),
-<<<<<<< hlds_pred.m
-	liveness_info, map(tvar, type_info_locn),
-	map(class_constraint, prog_var), maybe(arg_size_info),
-	maybe(termination_info), is_address_taken, inst_table, proc_info).
-=======
 	liveness_info, type_info_varmap, typeclass_info_varmap,
 	maybe(arg_size_info), maybe(termination_info), is_address_taken,
-	proc_info).
->>>>>>> 1.61
+	inst_table, proc_info).
 :- mode proc_info_set(in, in, in, in, in, in, in, in, in, in, in, in, in, in,
 	in, in, in, in, in, out) is det.
 
 :- pred proc_info_create(prog_varset, map(prog_var, type), list(prog_var),
-<<<<<<< hlds_pred.m
 	argument_modes, determinism, hlds_goal, prog_context,
-	map(tvar, type_info_locn), map(class_constraint, prog_var),
-	is_address_taken, inst_table, proc_info).
-:- mode proc_info_create(in, in, in, in, in, in, in, in, in, in, in,
-	out) is det.
-=======
-	list(mode), determinism, hlds_goal, prog_context,
-	type_info_varmap, typeclass_info_varmap, is_address_taken, proc_info).
-:- mode proc_info_create(in, in, in, in, in, in, in, in, in, in, out) is det.
->>>>>>> 1.61
+	type_info_varmap, typeclass_info_varmap, is_address_taken,
+	inst_table, proc_info).
+:- mode proc_info_create(in, in, in, in, in, in, in, in, in, in, in, out)
+	is det.
 
 :- pred proc_info_set_body(proc_info, prog_varset, map(prog_var, type),
 		list(prog_var), hlds_goal, type_info_varmap,
@@ -1651,17 +1630,9 @@
 proc_info_set_body(ProcInfo0, VarSet, VarTypes, HeadVars, Goal,
 		TI_VarMap, TCI_VarMap, ProcInfo) :-
 	ProcInfo0 = procedure(A, _, _, _, E, F, _,
-<<<<<<< hlds_pred.m
-		H, I, J, K, L, M, N, O, P, Q, R, S, T, U),
-=======
-		H, I, J, K, L, M, _, _, P, Q, R, S, T),
->>>>>>> 1.61
+		H, I, J, K, L, M, _, _, P, Q, R, S, T, U),
 	ProcInfo = procedure(A, VarSet, VarTypes, HeadVars, E, F, Goal,
-<<<<<<< hlds_pred.m
-		H, I, J, K, L, M, N, O, P, Q, R, S, T, U).
-=======
-		H, I, J, K, L, M, TI_VarMap, TCI_VarMap, P, Q, R, S, T).
->>>>>>> 1.61
+		H, I, J, K, L, M, TI_VarMap, TCI_VarMap, P, Q, R, S, T, U).
 
 proc_info_interface_determinism(ProcInfo, Determinism) :-
 	proc_info_declared_determinism(ProcInfo, MaybeDeterminism),
--- inst.m	Tue Jul 13 14:16:38 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/inst.m	Mon Jul 12 12:51:13 1999
@@ -1,9 +1,5 @@
 %-----------------------------------------------------------------------------%
-<<<<<<< inst.m
-% Copyright (C) 1997-1998 The University of Melbourne.
-=======
 % Copyright (C) 1997, 1999 The University of Melbourne.
->>>>>>> 1.6
 % This file may only be copied under the terms of the GNU General
 % Public License - see the file COPYING in the Mercury distribution.
 %-----------------------------------------------------------------------------%
@@ -16,10 +12,6 @@
 :- module (inst).
 :- interface.
 
-<<<<<<< inst.m
-:- import_module prog_data, hlds_data, hlds_pred, instmap.
-:- import_module list, std_util, map, io, set.
-=======
 % This module should NOT import hlds*.m.  Any types which are needed in
 % both the insts and in the HLDS should be defined here, rather than
 % in hlds*.m, because insts are part of the parse tree and the parse tree
@@ -30,9 +22,8 @@
 %     of the `cons_id' type, and so we could define a new type
 %     `abstract_cons_id' and use that here instead of `cons_id'.
 
-:- import_module prog_data, hlds_data.
-:- import_module list, std_util.
->>>>>>> 1.6
+:- import_module prog_data, hlds_data, instmap.
+:- import_module list, std_util, map, io, set.
 
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
--- inst_util.m	Tue Jul 13 14:16:39 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/inst_util.m	Tue Jul  6 16:07:50 1999
@@ -186,11 +186,7 @@
 
 :- implementation.
 :- import_module hlds_data, inst_match, mode_util, det_analysis.
-<<<<<<< inst_util.m
-:- import_module bool, std_util, require, map, list, set, assoc_list.
-=======
-:- import_module bool, std_util, require, map, list, set, int.
->>>>>>> 1.12
+:- import_module bool, std_util, require, map, list, set, int, assoc_list.
 
 :- pred add_new_keys_to_sub(map(inst_key, inst_key), list(inst_key),
 		inst_key, map(inst_key, inst_key)).
@@ -856,11 +852,7 @@
 abstractly_unify_bound_inst_list(Live, Xs, Ys, Real, UnifyInstInfo0,
 			L, Det, UnifyInstInfo) :-
 	abstractly_unify_bound_inst_list_2(Live, Xs, Ys, Real,
-<<<<<<< inst_util.m
-		UnifyInstInfo0, L, Det0, UnifyInstInfo),
-=======
-		ModuleInfo0, 0, L, Det0, ModuleInfo),
->>>>>>> 1.12
+		UnifyInstInfo0, 0, L, Det0, UnifyInstInfo),
 	( L = [] ->
 		det_par_conjunction_detism(Det0, erroneous, Det)
 	;
@@ -868,26 +860,12 @@
 	).
 
 :- pred abstractly_unify_bound_inst_list_2(is_live, list(bound_inst),
-<<<<<<< inst_util.m
 		list(bound_inst), unify_is_real, unify_inst_info,
-		list(bound_inst), determinism, unify_inst_info).
-:- mode abstractly_unify_bound_inst_list_2(in, in, in, in, in,
-=======
-		list(bound_inst), unify_is_real, module_info, int,
-		list(bound_inst), determinism, module_info).
+		int, list(bound_inst), determinism, unify_inst_info).
 :- mode abstractly_unify_bound_inst_list_2(in, in, in, in, in, in,
->>>>>>> 1.12
 		out, out, out) is semidet.
 
-<<<<<<< inst_util.m
-abstractly_unify_bound_inst_list_2(_, [], [], _, UI, [], det, UI).
-abstractly_unify_bound_inst_list_2(_, [], [_|_], _, UI, [], semidet, UI).
-abstractly_unify_bound_inst_list_2(_, [_|_], [], _, UI, [], semidet, UI).
-abstractly_unify_bound_inst_list_2(Live, [X|Xs], [Y|Ys], Real, UnifyInstInfo0,
-		L, Det, UnifyInstInfo) :-
-=======
-abstractly_unify_bound_inst_list_2(_, [], [], _, ModuleInfo, N, [], Det,
-		ModuleInfo) :-
+abstractly_unify_bound_inst_list_2(_, [], [], _, UI, N, [], Det, UI) :-
 	(
 			% The only time an abstract unification should
 			% be det, is when both of the bound_inst lists
@@ -903,22 +881,17 @@
 	;
 		Det = semidet
 	).
-abstractly_unify_bound_inst_list_2(_, [], [_|_], _, M, _, [], semidet, M).
-abstractly_unify_bound_inst_list_2(_, [_|_], [], _, M, _, [], semidet, M).
-abstractly_unify_bound_inst_list_2(Live, [X|Xs], [Y|Ys], Real, ModuleInfo0,
-		N, L, Det, ModuleInfo) :-
->>>>>>> 1.12
+abstractly_unify_bound_inst_list_2(_, [], [_|_], _, UI, _, [], semidet, UI).
+abstractly_unify_bound_inst_list_2(_, [_|_], [], _, UI, _, [], semidet, UI).
+abstractly_unify_bound_inst_list_2(Live, [X|Xs], [Y|Ys], Real, UI0,
+		N, L, Det, UI) :-
 	X = functor(ConsIdX, ArgsX),
 	Y = functor(ConsIdY, ArgsY),
 	( ConsIdX = ConsIdY ->
 		abstractly_unify_inst_list(ArgsX, ArgsY, Live, Real,
-			UnifyInstInfo0, Args, Det1, UnifyInstInfo1),
+			UI0, Args, Det1, UI1),
 		abstractly_unify_bound_inst_list_2(Live, Xs, Ys, Real,
-<<<<<<< inst_util.m
-				UnifyInstInfo1, L1, Det2, UnifyInstInfo),
-=======
-					ModuleInfo1, N+1, L1, Det2, ModuleInfo),
->>>>>>> 1.12
+				UI1, N+1, L1, Det2, UI),
 
 		% If the unification of the two cons_ids is guaranteed
 		% not to succeed, don't include it in the list.
@@ -931,23 +904,11 @@
 		)
 	;
 		( compare(<, ConsIdX, ConsIdY) ->
-<<<<<<< inst_util.m
 			abstractly_unify_bound_inst_list_2(Live,
-				Xs, [Y|Ys], Real, UnifyInstInfo0, L, Det1,
-				UnifyInstInfo)
-=======
-			abstractly_unify_bound_inst_list_2(Live, Xs, [Y|Ys],
-				Real, ModuleInfo0, N+1, L, Det1, ModuleInfo)
->>>>>>> 1.12
+				Xs, [Y|Ys], Real, UI0, N+1, L, Det1, UI)
 		;
-<<<<<<< inst_util.m
 			abstractly_unify_bound_inst_list_2(Live,
-				[X|Xs], Ys, Real, UnifyInstInfo0, L, Det1,
-				UnifyInstInfo)
-=======
-			abstractly_unify_bound_inst_list_2(Live, [X|Xs], Ys,
-				Real, ModuleInfo0, N+1, L, Det1, ModuleInfo)
->>>>>>> 1.12
+				[X|Xs], Ys, Real, UI0, N+1, L, Det1, UI)
 		),
 		det_par_conjunction_detism(Det1, semidet, Det)
 	).
--- intermod.m	Tue Jul 13 14:16:40 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/intermod.m	Tue Jul  6 16:09:47 1999
@@ -1086,22 +1086,12 @@
 	{ inst_table_init(InstTable) },	% YYY
 	( { pred_info_get_goal_type(PredInfo, pragmas) } ->
 		{ pred_info_procedures(PredInfo, Procs) },
-<<<<<<< intermod.m
-		intermod__write_c_code(SymName, PredOrFunc, HeadVars, Varset,
-						Clauses, Procs, InstTable)
-=======
 		intermod__write_c_code(SymName, PredOrFunc, HeadVars, VarSet,
-						Clauses, Procs)
->>>>>>> 1.65
+						Clauses, Procs, InstTable)
 	;
 		% { pred_info_typevarset(PredInfo, TVarSet) },
-<<<<<<< intermod.m
 		hlds_out__write_clauses(1, InstTable, ModuleInfo, PredId,
-			Varset, no, HeadVars, PredOrFunc, Clauses, no)
-=======
-		hlds_out__write_clauses(1, ModuleInfo, PredId, VarSet, no,
-			HeadVars, PredOrFunc, Clauses, no)
->>>>>>> 1.65
+			VarSet, no, HeadVars, PredOrFunc, Clauses, no)
 		%	HeadVars, Clauses, yes(TVarSet, VarTypes))
 	),
 	intermod__write_preds(ModuleInfo, PredIds).
--- lambda.m	Tue Jul 13 14:16:42 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/lambda.m	Mon Jul 12 14:10:17 1999
@@ -69,7 +69,7 @@
 
 :- interface. 
 
-:- import_module hlds_module, hlds_pred, hlds_goal, prog_data.
+:- import_module hlds_module, hlds_pred, hlds_goal, hlds_data, prog_data.
 :- import_module list, map, set.
 
 :- pred lambda__process_module(module_info, module_info).
@@ -95,11 +95,7 @@
 :- import_module hlds_data, make_hlds, globals, options, type_util.
 :- import_module goal_util, prog_util, mode_util, inst_match, llds, arg_info.
 
-<<<<<<< lambda.m
-:- import_module bool, set, string, std_util, require.
-=======
-:- import_module term, varset, bool, string, std_util, require.
->>>>>>> 1.51
+:- import_module term, varset, bool, set, string, std_util, require.
 
 :- type lambda_info --->
 		lambda_info(
@@ -222,18 +218,12 @@
 lambda__process_goal_2(unify(XVar, Y, Mode, Unification, Context), GoalInfo,
 			Unify - GoalInfo) -->
 	( { Y = lambda_goal(PredOrFunc, NonLocalVars, Vars, 
-<<<<<<< lambda.m
 			Modes, Det, _IMDelta, LambdaGoal0) } ->
-		% for lambda expressions, we must convert the lambda expression
-		% into a new predicate
-=======
-			Modes, Det, LambdaGoal0) } ->
 		% first, process the lambda goal recursively, in case it
 		% contains some nested lambda expressions.
 		lambda__process_goal(LambdaGoal0, LambdaGoal1),
 
 		% then, convert the lambda expression into a new predicate
->>>>>>> 1.51
 		lambda__process_lambda(PredOrFunc, Vars, Modes, Det, 
 			NonLocalVars, LambdaGoal1, 
 			Unification, Y1, Unification1),
@@ -306,14 +296,9 @@
 
 lambda__process_lambda(PredOrFunc, Vars, Modes, Det, OrigNonLocals0, LambdaGoal,
 		Unification0, Functor, Unification, LambdaInfo0, LambdaInfo) :-
-<<<<<<< lambda.m
-	LambdaInfo0 = lambda_info(VarSet, VarTypes, Constraints, TVarSet,
-			TVarMap, TCVarMap, Markers, POF, PredName, Owner,
-			ModuleInfo0, InstTable),
-	% XXX existentially typed lambda expressions are not yet supported
-=======
 	LambdaInfo0 = lambda_info(VarSet, VarTypes, _PredConstraints, TVarSet,
-		TVarMap, TCVarMap, Markers, POF, PredName, Owner, ModuleInfo0),
+		TVarMap, TCVarMap, Markers, POF, PredName, Owner, ModuleInfo0,
+		InstTable),
 
 		% Calculate the constraints which apply to this lambda
 		% expression. 
@@ -328,7 +313,6 @@
 	Constraints = constraints(UnivConstraints, []),
 
 	% existentially typed lambda expressions are not yet supported
->>>>>>> 1.51
 	% (see the documentation at top of this file)
 	ExistQVars = [],
 	Modes = argument_modes(_ArgInstTable, ArgModes),
@@ -343,13 +327,9 @@
 		Markers, Owner, InstTable, ModuleInfo0, Functor, Unification,
 		ModuleInfo),
 	LambdaInfo = lambda_info(VarSet, VarTypes, Constraints, TVarSet,
-<<<<<<< lambda.m
-			TVarMap, TCVarMap, Markers, POF, PredName, Owner,
-			ModuleInfo, InstTable).
+		TVarMap, TCVarMap, Markers, POF, PredName, Owner, ModuleInfo,
+		InstTable).
 
-=======
-		TVarMap, TCVarMap, Markers, POF, PredName, Owner, ModuleInfo).
-
 :- pred lambda__constraint_contains_vars(list(tvar), class_constraint).
 :- mode lambda__constraint_contains_vars(in, in) is semidet.
 
@@ -363,7 +343,6 @@
 	set__list_to_set(ConstraintVars, ConstraintVarsSet),
 	set__subset(ConstraintVarsSet, LambdaVarsSet).
 
->>>>>>> 1.51
 lambda__transform_lambda(PredOrFunc, OrigPredName, Vars, Modes, Detism,
 		OrigVars, ExtraTypeInfos, LambdaGoal, Unification0, VarSet,
 		VarTypes, Constraints, TVarSet, TVarMap, TCVarMap, Markers,
--- lco.m	Tue Jul 13 14:15:13 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/lco.m	Tue Jul  6 16:10:21 1999
@@ -938,7 +938,7 @@
 	error("lco:fix_modes_of_unify: simple_test in unify").
 
 % Should already have been transformed into calls by polymorphism.m.
-fix_modes_of_unify(complicated_unify(_, _),_,_,_,_,_,_,_,_,_,_,_,_) :-
+fix_modes_of_unify(complicated_unify(_, _, _),_,_,_,_,_,_,_,_,_,_,_,_) :-
 	error("lco:fix_modes_of_unify: complicated_unify").
 
 :- pred fix_uni_mode(module_info, instmap, uni_mode, uni_mode,
--- lookup_switch.m	Tue Jul 13 14:16:44 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/lookup_switch.m	Mon Jul 12 12:53:39 1999
@@ -70,15 +70,10 @@
 
 :- import_module builtin_ops, code_gen, type_util, tree.
 :- import_module dense_switch, globals, options, mode_util.
-<<<<<<< lookup_switch.m
 :- import_module exprn_aux, getopt, prog_data, instmap, inst_match.
 
-=======
-:- import_module exprn_aux, getopt, prog_data, instmap.
-
 :- import_module int, require, bool, assoc_list.
 
->>>>>>> 1.35
 	% Most of this predicate is taken from dense_switch.m
 
 	% We need the code_info structure to generate code for the cases to
--- magic_util.m	Tue Jul 13 14:16:45 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/magic_util.m	Mon Jul 12 12:54:37 1999
@@ -15,11 +15,7 @@
 :- interface.
 
 :- import_module hlds_data, hlds_goal, hlds_module, hlds_pred, prog_data.
-<<<<<<< magic_util.m
-:- import_module (inst), instmap, rl.
-=======
-:- import_module (inst).
->>>>>>> 1.3
+:- import_module (inst), instmap.
 :- import_module bool, io, list, map, set, std_util.
 
 	% Check that the argument types and modes are legal for
--- make_hlds.m	Tue Jul 13 14:16:47 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/make_hlds.m	Mon Jul 12 12:56:12 1999
@@ -1213,25 +1213,15 @@
 
 %-----------------------------------------------------------------------------%
 
-<<<<<<< make_hlds.m
 :- pred add_pragma_termination_info(pred_or_func, sym_name, argument_modes,
-		maybe(arg_size_info), maybe(termination_info),
-=======
-:- pred add_pragma_termination_info(pred_or_func, sym_name, list(mode),
 		maybe(pragma_arg_size_info), maybe(pragma_termination_info),
->>>>>>> 1.298
 		prog_context, module_info, module_info, io__state, io__state).
 :- mode add_pragma_termination_info(in, in, in, in, in, in, in, out, di, uo)
 		is det.
 
-<<<<<<< make_hlds.m
-add_pragma_termination_info(PredOrFunc, SymName, Modes, MaybeArgSizeInfo,
-		MaybeTerminationInfo, Context, Module0, Module) -->
-=======
-add_pragma_termination_info(PredOrFunc, SymName, ModeList,
+add_pragma_termination_info(PredOrFunc, SymName, Modes,
 		MaybePragmaArgSizeInfo, MaybePragmaTerminationInfo,
 		Context, Module0, Module) -->
->>>>>>> 1.298
 	{ module_info_get_predicate_table(Module0, Preds) },
 	{ Modes = argument_modes(_ArgInstTable, ArgModes) },
 	{ list__length(ArgModes, Arity) },
@@ -5241,17 +5231,11 @@
 
 create_atomic_unification(A, B, Context, UnifyMainContext, UnifySubContext,
 		Goal) :-
-<<<<<<< make_hlds.m
 	UMode = ((free(unique) - free(unique)) -> 
 		(free(unique) - free(unique))),
 	Mode = ((free(unique) - free(unique)) - 
 		(free(unique) - free(unique))),
-	UnifyInfo = complicated_unify(UMode, can_fail),
-=======
-	UMode = ((free - free) -> (free - free)),
-	Mode = ((free -> free) - (free -> free)),
 	UnifyInfo = complicated_unify(UMode, can_fail, []),
->>>>>>> 1.298
 	UnifyC = unify_context(UnifyMainContext, UnifySubContext),
 	goal_info_init(GoalInfo0),
 	goal_info_set_context(GoalInfo0, Context, GoalInfo),
--- mercury_to_mercury.m	Tue Jul 13 14:16:49 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/mercury_to_mercury.m	Mon Jul 12 13:00:04 1999
@@ -23,17 +23,12 @@
 						% is another graphic token
 	;	not_next_to_graphic_token.	% doesn't need quotes
 
-<<<<<<< mercury_to_mercury.m
 :- type expand_inst_alias --->
 		dont_expand		% alias(IK)
 	;	expand_silently		% Expansion
 	;	expand_noisily.		% alias(IK, Expansion)
 
-:- import_module hlds_goal, hlds_data, hlds_pred, prog_data, (inst), purity.
-:- import_module instmap, rl.
-=======
-:- import_module hlds_goal, hlds_data, prog_data, (inst).
->>>>>>> 1.159
+:- import_module hlds_goal, hlds_data, prog_data, (inst), instmap.
 :- import_module bool, std_util, list, io, varset, term.
 
 %	convert_to_mercury(ModuleName, OutputFileName, Items)
@@ -432,16 +427,12 @@
 					   "promise_pure")
 	;
 		{ Pragma = termination_info(PredOrFunc, PredName, 
-<<<<<<< mercury_to_mercury.m
-			Modes, MaybeArgSizeInfo, MaybeTerminationInfo) },
-=======
-			ModeList, MaybePragmaArgSizeInfo,
+			Modes, MaybePragmaArgSizeInfo,
 			MaybePragmaTerminationInfo) },
 		{ add_context_to_arg_size_info(MaybePragmaArgSizeInfo, Context,
 			MaybeArgSizeInfo) },
 		{ add_context_to_termination_info(MaybePragmaTerminationInfo,
 			Context, MaybeTerminationInfo) },
->>>>>>> 1.159
 		termination__write_pragma_termination_info(PredOrFunc,
 			PredName, Modes, Context,
 			MaybeArgSizeInfo, MaybeTerminationInfo)
@@ -458,10 +449,7 @@
 			"check_termination")
 	).
 
-<<<<<<< mercury_to_mercury.m
-mercury_output_item(nothing, _, _) --> [].
-=======
-mercury_output_item(assertion(Goal, VarSet), _) -->
+mercury_output_item(assertion(Goal, VarSet), _, _) -->
 	io__write_string(":- assertion "),
 	{ Indent = 1 },
 	mercury_output_newline(Indent),
@@ -468,8 +456,7 @@
 	mercury_output_goal(Goal, VarSet, Indent),
 	io__write_string(".\n").
 
-mercury_output_item(nothing, _) --> [].
->>>>>>> 1.159
+mercury_output_item(nothing, _, _) --> [].
 mercury_output_item(typeclass(Constraints, ClassName, Vars, Methods, 
 		VarSet), _, _) --> 
 	io__write_string(":- typeclass "),
--- mode_errors.m	Tue Jul 13 14:16:50 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/mode_errors.m	Mon Jul 12 12:41:34 1999
@@ -191,19 +191,12 @@
  report_mode_error(mode_error_par_conj(ErrorList), InstTable, ModeInfo) -->
  	report_mode_error_par_conj(InstTable, ModeInfo, ErrorList).
 report_mode_error(mode_error_higher_order_pred_var(PredOrFunc, Var, Inst,
-<<<<<<< mode_errors.m
 		Arity), InstTable, ModeInfo) -->
 	report_mode_error_higher_order_pred_var(InstTable, ModeInfo, PredOrFunc,
 		Var, Inst, Arity).
+report_mode_error(mode_error_poly_unify(Var, Inst), InstTable, ModeInfo) -->
+	report_mode_error_poly_unify(InstTable, ModeInfo, Var, Inst).
 report_mode_error(mode_error_var_is_live(Var), _InstTable, ModeInfo) -->
-=======
-		Arity), ModeInfo) -->
-	report_mode_error_higher_order_pred_var(ModeInfo, PredOrFunc, Var,
-		Inst, Arity).
-report_mode_error(mode_error_poly_unify(Var, Inst), ModeInfo) -->
-	report_mode_error_poly_unify(ModeInfo, Var, Inst).
-report_mode_error(mode_error_var_is_live(Var), ModeInfo) -->
->>>>>>> 1.64
 	report_mode_error_var_is_live(ModeInfo, Var).
 report_mode_error(mode_error_var_has_inst(Var, InstA, InstB), InstTable,
 		ModeInfo) -->
@@ -572,11 +565,11 @@
 	),
 	io__write_string(").\n").
 
-:- pred report_mode_error_poly_unify(mode_info, prog_var, inst,
+:- pred report_mode_error_poly_unify(inst_table, mode_info, prog_var, inst,
 					io__state, io__state).
-:- mode report_mode_error_poly_unify(mode_info_ui, in, in, di, uo) is det.
+:- mode report_mode_error_poly_unify(in, mode_info_ui, in, in, di, uo) is det.
 
-report_mode_error_poly_unify(ModeInfo, Var, VarInst) -->
+report_mode_error_poly_unify(InstTable, ModeInfo, Var, VarInst) -->
 	{ mode_info_get_context(ModeInfo, Context) },
 	{ mode_info_get_varset(ModeInfo, VarSet) },
 	{ mode_info_get_instvarset(ModeInfo, InstVarSet) },
@@ -587,7 +580,7 @@
 	io__write_string("  mode error: variable `"),
 	mercury_output_var(Var, VarSet, no),
 	io__write_string("' has instantiatedness `"),
-	output_inst(VarInst, InstVarSet),
+	output_inst(VarInst, InstVarSet, InstTable),
 	io__write_string("',\n"),
 	prog_out__write_context(Context),
 	io__write_string(
--- mode_util.m	Tue Jul 13 14:16:51 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/mode_util.m	Tue Jul  6 23:51:21 1999
@@ -190,23 +190,13 @@
 
 %-----------------------------------------------------------------------------%
 
-<<<<<<< mode_util.m
-:- pred normalise_insts(list(inst), instmap, inst_table, module_info,
-		list(inst)).
-:- mode normalise_insts(in, in, in, in, out) is det.
-=======
-:- pred normalise_insts(list(inst), list(type), module_info, list(inst)).
-:- mode normalise_insts(in, in, in, out) is det.
->>>>>>> 1.115
-
-<<<<<<< mode_util.m
-:- pred normalise_inst(inst, instmap, inst_table, module_info, inst).
-:- mode normalise_inst(in, in, in, in, out) is det.
-=======
-:- pred normalise_inst(inst, (type), module_info, inst).
-:- mode normalise_inst(in, in, in, out) is det.
->>>>>>> 1.115
+:- pred normalise_insts(list(inst), list(type), instmap, inst_table,
+		module_info, list(inst)).
+:- mode normalise_insts(in, in, in, in, in, out) is det.
 
+:- pred normalise_inst(inst, (type), instmap, inst_table, module_info, inst).
+:- mode normalise_inst(in, in, in, in, in, out) is det.
+
 %-----------------------------------------------------------------------------%
 
 % :- pred apply_inst_key_sub(inst_key_sub, instmap, instmap,
@@ -245,15 +235,9 @@
 %-----------------------------------------------------------------------------%
 
 :- implementation.
-<<<<<<< mode_util.m
 :- import_module require, int, map, set, std_util, assoc_list, bag.
-:- import_module prog_util, type_util, unify_proc.
+:- import_module prog_util, prog_io, type_util, unify_proc.
 :- import_module inst_match, inst_util, det_analysis, term.
-=======
-:- import_module require, int, map, set, std_util, assoc_list.
-:- import_module prog_util, prog_io, type_util.
-:- import_module inst_match, inst_util, term.
->>>>>>> 1.115
 
 %-----------------------------------------------------------------------------%
 
@@ -2140,12 +2124,12 @@
 		),
 		ModuleInfo = ModuleInfo2
 	;
-		Unification0 = complicated_unify(_, CanFail)
+		Unification0 = complicated_unify(_, CanFail, TIVars)
 	->
 		Det = Det1,
 		ComplUniMode = ((InitialInstX - InitialInstY) ->
 					(UnifyInst - UnifyInst)),
-		Unification = complicated_unify(ComplUniMode, CanFail),
+		Unification = complicated_unify(ComplUniMode, CanFail, TIVars),
 		goal_info_get_context(GoalInfo, Context),
 		recompute_info_get_vartypes(RI0, VarTypes),
 		map__lookup(VarTypes, Var, Type),
@@ -2167,7 +2151,7 @@
 	compute_instmap_delta(InstMap0, InstMap, InstMapDelta),
 	recompute_info_set_module_info(ModuleInfo, RI0, RI1),
 	recompute_info_set_inst_table(InstTable, RI1, RI2),
-	( GoalChanged = yes ->
+	( GoalChanged = bool:yes ->
 		recompute_info_set_goal_changed(RI2, RI)
 	;
 		RI = RI2
@@ -2331,21 +2315,15 @@
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
 
-<<<<<<< mode_util.m
-normalise_insts([], _, _, _, []).
-normalise_insts([Inst0|Insts0], InstMap, InstTable, ModuleInfo, [Inst|Insts]) :-
-	normalise_inst(Inst0, InstMap, InstTable, ModuleInfo, Inst),
-	normalise_insts(Insts0, InstMap, InstTable, ModuleInfo, Insts).
-=======
-normalise_insts([], [], _, []).
-normalise_insts([Inst0|Insts0], [Type|Types], ModuleInfo, [Inst|Insts]) :-
-	normalise_inst(Inst0, Type, ModuleInfo, Inst),
-	normalise_insts(Insts0, Types, ModuleInfo, Insts).
-normalise_insts([], [_|_], _, _) :-
+normalise_insts([], [], _, _, _, []).
+normalise_insts([Inst0|Insts0], [Type|Types], InstMap, InstTable, ModuleInfo,
+		[Inst|Insts]) :-
+	normalise_inst(Inst0, Type, InstMap, InstTable, ModuleInfo, Inst),
+	normalise_insts(Insts0, Types, InstMap, InstTable, ModuleInfo, Insts).
+normalise_insts([], [_|_], _, _, _, _) :-
 	error("normalise_insts: length mismatch").
-normalise_insts([_|_], [], _, _) :-
+normalise_insts([_|_], [], _, _, _, _) :-
 	error("normalise_insts: length mismatch").
->>>>>>> 1.115
 
 	% This is a bit of a hack.
 	% The aim is to avoid non-termination due to the creation
@@ -2352,41 +2330,26 @@
 	% of ever-expanding insts.
 	% XXX should also normalise partially instantiated insts.
 
-<<<<<<< mode_util.m
-normalise_inst(Inst0, InstMap, InstTable, ModuleInfo, NormalisedInst) :-
+normalise_inst(Inst0, Type, InstMap, InstTable, ModuleInfo, NormalisedInst) :-
 	inst_expand(InstMap, InstTable, ModuleInfo, Inst0, Inst),
-=======
-normalise_inst(Inst0, Type, ModuleInfo, NormalisedInst) :-
-	inst_expand(ModuleInfo, Inst0, Inst),
->>>>>>> 1.115
 	( Inst = bound(_, _) ->
 		(
-<<<<<<< mode_util.m
 			inst_is_ground(Inst, InstMap, InstTable, ModuleInfo),
-			inst_is_unique(Inst, InstMap, InstTable, ModuleInfo)
-=======
-			inst_is_ground(ModuleInfo, Inst),
-			inst_is_unique(ModuleInfo, Inst),
+			inst_is_unique(Inst, InstMap, InstTable, ModuleInfo),
 			% don't infer unique modes for introduced type_infos
 			% arguments, because that leads to an increase
 			% in the number of inferred modes without any benefit
 			\+ is_introduced_type_info_type(Type)
->>>>>>> 1.115
 		->
 			NormalisedInst = ground(unique, no)
 		;
-<<<<<<< mode_util.m
 			inst_is_ground(Inst, InstMap, InstTable, ModuleInfo),
 			inst_is_mostly_unique(Inst, InstMap, InstTable,
-					ModuleInfo)
-=======
-			inst_is_ground(ModuleInfo, Inst),
-			inst_is_mostly_unique(ModuleInfo, Inst),
+					ModuleInfo),
 			% don't infer unique modes for introduced type_infos
 			% arguments, because that leads to an increase
 			% in the number of inferred modes without any benefit
 			\+ is_introduced_type_info_type(Type)
->>>>>>> 1.115
 		->
 			NormalisedInst = ground(mostly_unique, no)
 		;
--- modecheck_call.m	Tue Jul 13 14:16:52 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/modecheck_call.m	Mon Jul 12 12:41:36 1999
@@ -148,15 +148,10 @@
 		% Check that `Args0' have livenesses which match the
 		% expected livenesses.
 		%
-<<<<<<< modecheck_call.m
 			% YYY InstMap0 is probably incorrect here
 		get_arg_lives(ArgModes0, InstMap0, ArgInstTable, ModuleInfo0,
 			ExpectedArgLives),
-		modecheck_var_list_is_live(Args0, ExpectedArgLives, 1,
-=======
-		get_arg_lives(Modes, ModuleInfo0, ExpectedArgLives),
 		modecheck_var_list_is_live(Args0, ExpectedArgLives, ArgOffset,
->>>>>>> 1.31
 			ModeInfo0, ModeInfo1),
 
 		inst_table_create_sub(InstTable0, ArgInstTable, Sub, InstTable1),
@@ -170,24 +165,13 @@
 		% then check that the final insts of the vars match the
 		% declared final insts.
 		%
-<<<<<<< modecheck_call.m
 		mode_list_get_initial_insts(ArgModes, ModuleInfo0,
 				InitialInsts),
-		modecheck_var_has_inst_list(Args0, InitialInsts, 0,
+		modecheck_var_has_inst_list(Args0, InitialInsts, ArgOffset,
 					ModeInfo2, ModeInfo3),
 		mode_list_get_final_insts(ArgModes, ModuleInfo0, FinalInsts),
-=======
-		mode_list_get_initial_insts(Modes, ModuleInfo0, InitialInsts),
-		modecheck_var_has_inst_list(Args0, InitialInsts, ArgOffset,
-					ModeInfo1, ModeInfo2),
-		mode_list_get_final_insts(Modes, ModuleInfo0, FinalInsts),
->>>>>>> 1.31
 		modecheck_set_var_inst_list(Args0, InitialInsts, FinalInsts,
-<<<<<<< modecheck_call.m
-				Args, ExtraGoals, ModeInfo3, ModeInfo4),
-=======
-			ArgOffset, Args, ExtraGoals, ModeInfo2, ModeInfo3),
->>>>>>> 1.31
+			ArgOffset, Args, ExtraGoals, ModeInfo3, ModeInfo4),
 		( determinism_components(Det, _, at_most_zero) ->
 			instmap__init_unreachable(Instmap),
 			mode_info_set_instmap(Instmap, ModeInfo4, ModeInfo)
@@ -282,21 +266,11 @@
 
 		mode_list_get_initial_insts(ArgModes, ModuleInfo,
 					InitialInsts),
-<<<<<<< modecheck_call.m
-		modecheck_var_has_inst_list(ArgVars0, InitialInsts, 0,
-					ModeInfo2, ModeInfo3),
-=======
 		modecheck_var_has_inst_list(ArgVars0, InitialInsts, ArgOffset,
-					ModeInfo1, ModeInfo2),
->>>>>>> 1.31
+					ModeInfo2, ModeInfo3),
 
-<<<<<<< modecheck_call.m
-		modecheck_end_of_call(ProcInfo, ArgVars0, ArgVars,
-					ExtraGoals, ModeInfo3, ModeInfo)
-=======
 		modecheck_end_of_call(ProcInfo, ArgVars0, ArgOffset, ArgVars,
-					ExtraGoals, ModeInfo2, ModeInfo)
->>>>>>> 1.31
+					ExtraGoals, ModeInfo3, ModeInfo)
 	;
 			% set the current error list to empty (and
 			% save the old one in `OldErrors').  This is so the
@@ -323,7 +297,6 @@
 			choose_best_match(MatchingProcIds, PredId, Procs,
 				ArgVars0, TheProcId, ModeInfo2),
 			map__lookup(Procs, TheProcId, ProcInfo),
-<<<<<<< modecheck_call.m
 
 			% proc_info_argmodes(ProcInfo,
 			% 	argument_modes(ArgInstTable, ArgModes0)),
@@ -335,13 +308,9 @@
 			% mode_info_set_inst_table(InstTable1, ModeInfo2,
 			% 	ModeInfo3),
 			ModeInfo2 = ModeInfo3,
-			modecheck_end_of_call(ProcInfo, ArgVars0, ArgVars,
-				ExtraGoals, ModeInfo3, ModeInfo4),
-			ModeInfo99 = ModeInfo4
-=======
 			modecheck_end_of_call(ProcInfo, ArgVars0, ArgOffset,
-				ArgVars, ExtraGoals, ModeInfo2, ModeInfo3)
->>>>>>> 1.31
+				ArgVars, ExtraGoals, ModeInfo3, ModeInfo4),
+			ModeInfo99 = ModeInfo4
 		),
 
 			% restore the error list, appending any new error(s)
@@ -451,15 +420,9 @@
 :- mode modecheck_end_of_call(in, in, in, out, out,
 				mode_info_di, mode_info_uo) is det.
 
-<<<<<<< modecheck_call.m
-modecheck_end_of_call(ProcInfo, ArgVars0, ArgVars, ExtraGoals,
+modecheck_end_of_call(ProcInfo, ArgVars0, ArgOffset, ArgVars, ExtraGoals,
 			ModeInfo0, ModeInfo) :-
 	proc_info_argmodes(ProcInfo, argument_modes(_, ProcArgModes)),
-=======
-modecheck_end_of_call(ProcInfo, ArgVars0, ArgOffset,
-			ArgVars, ExtraGoals, ModeInfo0, ModeInfo) :-
-	proc_info_argmodes(ProcInfo, ProcArgModes),
->>>>>>> 1.31
 	mode_info_get_module_info(ModeInfo0, ModuleInfo),
 	mode_list_get_initial_insts(ProcArgModes, ModuleInfo, InitialInsts),
 	mode_list_get_final_insts(ProcArgModes, ModuleInfo, FinalInsts),
@@ -522,18 +485,11 @@
 		[Inst | Insts], [IsLive | IsLives]) :-
 	mode_info_get_module_info(ModeInfo, ModuleInfo),
 	mode_info_get_instmap(ModeInfo, InstMap),
-<<<<<<< modecheck_call.m
 	mode_info_get_inst_table(ModeInfo, InstTable),
-=======
 	mode_info_get_var_types(ModeInfo, VarTypes),
->>>>>>> 1.31
 	instmap__lookup_var(InstMap, Var, Inst0),
-<<<<<<< modecheck_call.m
-	normalise_inst(Inst0, InstMap, InstTable, ModuleInfo, Inst),
-=======
 	map__lookup(VarTypes, Var, Type),
-	normalise_inst(Inst0, Type, ModuleInfo, Inst),
->>>>>>> 1.31
+	normalise_inst(Inst0, Type, InstMap, InstTable, ModuleInfo, Inst),
 
 	mode_info_var_is_live(ModeInfo, Var, IsLive0),
 
--- modecheck_unify.m	Tue Jul 13 14:16:52 1999
+++ /home/pgrad/dmo/mer0/alias_merge/mercury/compiler/modecheck_unify.m	Mon Jul 12 13:04:07 1999
@@ -20,12 +20,7 @@
 :- module modecheck_unify.
 :- interface.
 
-<<<<<<< modecheck_unify.m
-:- import_module hlds_goal, hlds_data, prog_data, mode_info, (inst), instmap.
-:- import_module map.
-=======
 :- import_module hlds_goal, prog_data, mode_info.
->>>>>>> 1.39
 
 	% Modecheck a unification
 :- pred modecheck_unification(prog_var, unify_rhs, unification, unify_context,
@@ -33,17 +28,6 @@
 :- mode modecheck_unification(in, in, in, in, in, out,
 			mode_info_di, mode_info_uo) is det.
 
-<<<<<<< modecheck_unify.m
-	% Work out what kind of unification a var-var unification is.
-:- pred categorize_unify_var_var(inst, inst, inst, inst, is_live, is_live,
-		prog_var, prog_var, instmap, instmap, determinism,
-		unify_context, map(prog_var, type), mode_info, hlds_goal_expr,
-		mode_info).
-:- mode categorize_unify_var_var(in, in, in, in, in, in, in, in, in, in, in,
-		in, in, mode_info_di, out, mode_info_uo) is det.
-
-=======
->>>>>>> 1.39
 	% Create a unification between the two given variables.
 	% The goal's mode and determinism information is not filled in.
 :- pred modecheck_unify__create_var_var_unification(prog_var, prog_var, type,
@@ -56,17 +40,12 @@
 
 :- implementation.
 
-<<<<<<< modecheck_unify.m
 :- import_module llds, prog_util, type_util, module_qual.
-:- import_module hlds_module, hlds_goal, hlds_pred, hlds_out.
-=======
-:- import_module llds, prog_util, type_util, module_qual, instmap.
 :- import_module hlds_module, hlds_goal, hlds_pred, hlds_data, hlds_out.
->>>>>>> 1.39
 :- import_module mode_debug, mode_util, mode_info, modes, mode_errors.
 :- import_module inst_match, inst_util, unify_proc, code_util, unique_modes.
 :- import_module typecheck, modecheck_call, (inst), quantification, make_hlds.
-:- import_module polymorphism.
+:- import_module polymorphism, instmap.
 
 :- import_module bool, list, map, std_util, int, set, require.
 :- import_module string, assoc_list.
@@ -126,7 +105,6 @@
 		Inst = UnifyInst,
 		Det = Det1,
 		mode_info_set_module_info(ModeInfo0, ModuleInfo1, ModeInfo1),
-<<<<<<< modecheck_unify.m
 		mode_info_set_inst_table(InstTable1, ModeInfo1, ModeInfo2),
 
 		mode_info_set_instmap(InstMap1, ModeInfo2, ModeInfo3),
@@ -147,17 +125,8 @@
 		mode_info_get_var_types(ModeInfo6, VarTypes),
 		categorize_unify_var_var(InstOfX, Inst, InstOfY, Inst,
 			LiveX, LiveY, X, Y, InstMap0, InstMap1,
-			Det, UnifyContext, VarTypes, ModeInfo6, Unify, ModeInfo)
-=======
-		modecheck_set_var_inst(X, Inst, ModeInfo1, ModeInfo2),
-		modecheck_set_var_inst(Y, Inst, ModeInfo2, ModeInfo3),
-		ModeOfX = (InstOfX -> Inst),
-		ModeOfY = (InstOfY -> Inst),
-		mode_info_get_var_types(ModeInfo3, VarTypes),
-		categorize_unify_var_var(ModeOfX, ModeOfY, LiveX, LiveY, X, Y,
-			Det, UnifyContext, VarTypes, Unification0, ModeInfo3,
+			Det, UnifyContext, VarTypes, Unification0, ModeInfo6,
 			Unify, ModeInfo)
->>>>>>> 1.39
 	;
 		set__list_to_set([X, Y], WaitingVars),
 		mode_info_error(WaitingVars, mode_error_unify_var_var(X, Y,
@@ -217,71 +186,6 @@
 		mode_info_get_predid(ModeInfo0, ThisPredId),
 		module_info_pred_info(ModuleInfo0, ThisPredId, ThisPredInfo),
 		pred_info_typevarset(ThisPredInfo, TVarSet),
-<<<<<<< modecheck_unify.m
-		map__apply_to_list(Args, VarTypes, ArgTypes),
-		(
-			% If we are redoing mode analysis, use the
-			% pred_id and proc_id found before, to avoid aborting
-			% in get_pred_id_and_proc_id if there are multiple
-			% matching procedures.
-			Unification0 = construct(_, 
-				pred_const(PredId0, ProcId0), _, _)
-		->
-			PredId = PredId0,
-			ProcId = ProcId0
-		;
-			get_pred_id_and_proc_id(PName, PredOrFunc, TVarSet, 
-				ArgTypes, ModuleInfo0, PredId, ProcId)
-		),
-		module_info_pred_proc_info(ModuleInfo0, PredId, ProcId,
-					PredInfo, ProcInfo),
-
-		% module-qualify the pred name (is this necessary?)
-		pred_info_module(PredInfo, PredModule),
-		unqualify_name(PName, UnqualPName),
-		QualifiedPName = qualified(PredModule, UnqualPName),
-
-		CallUnifyContext = call_unify_context(X0,
-				functor(ConsId0, ArgVars0), UnifyContext),
-		LambdaGoalExpr = call(PredId, ProcId, Args, not_builtin,
-				yes(CallUnifyContext), QualifiedPName),
-
-		%
-		% construct a goal_info for the lambda goal, making sure
-		% to set up the nonlocals field in the goal_info correctly
-		%
-		goal_info_get_nonlocals(GoalInfo0, NonLocals),
-		set__insert_list(NonLocals, LambdaVars, OutsideVars),
-		set__list_to_set(Args, InsideVars),
-		set__intersect(OutsideVars, InsideVars, LambdaNonLocals),
-		goal_info_init(LambdaGoalInfo0),
-		mode_info_get_context(ModeInfo2, Context),
-		goal_info_set_context(LambdaGoalInfo0, Context,
-				LambdaGoalInfo1),
-		goal_info_set_nonlocals(LambdaGoalInfo1, LambdaNonLocals,
-				LambdaGoalInfo),
-		LambdaGoal = LambdaGoalExpr - LambdaGoalInfo,
-
-		%
-		% work out the modes of the introduced lambda variables
-		% and the determinism of the lambda goal
-		%
-		proc_info_argmodes(ProcInfo, argument_modes(ArgInstTable,
-					ArgModes)),
-
-		( list__drop(Arity, ArgModes, LambdaModes0) ->
-			LambdaModes = LambdaModes0
-		;
-			error("modecheck_unification: list__drop failed")
-		),
-		proc_info_declared_determinism(ProcInfo, MaybeDet),
-		( MaybeDet = yes(Det) ->
-			LambdaDet = Det
-		;
-			error("Sorry, not implemented: determinism inference for higher-order predicate terms")
-		),
-
-=======
 		convert_pred_to_lambda_goal(PredOrFunc, X0, ConsId0, PName,
 			ArgVars0, PredArgTypes, TVarSet,
 			Unification0, UnifyContext, GoalInfo0, Context,
@@ -289,17 +193,9 @@
 			Functor0, VarSet, VarTypes),
 		mode_info_set_varset(VarSet, ModeInfo0, ModeInfo1),
 		mode_info_set_var_types(VarTypes, ModeInfo1, ModeInfo2),
->>>>>>> 1.39
 		%
 		% modecheck this unification in its new form
 		%
-<<<<<<< modecheck_unify.m
-		instmap_delta_init_reachable(IMDelta),
-		Functor0 = lambda_goal(PredOrFunc, ArgVars0, LambdaVars, 
-				argument_modes(ArgInstTable, LambdaModes),
-				LambdaDet, IMDelta, LambdaGoal),
-=======
->>>>>>> 1.39
 		modecheck_unification( X0, Functor0, Unification0, UnifyContext,
 				GoalInfo0, Goal, ModeInfo2, ModeInfo)
 	;
@@ -677,19 +573,13 @@
 		assoc_list__from_corresponding_lists(InstArgs, FinalInstsY,
 				ModeArgs),
 		(
-<<<<<<< modecheck_unify.m
 			inst_expand(InstMap1, InstTable4, ModuleInfo4,
 				InstOfX, InstOfX2),
+			list__length(ArgVars0, Arity),
 			get_arg_insts(InstOfX2, ConsId, Arity, InitialInstsX),
 			inst_expand(InstMap2, InstTable4, ModuleInfo4,
 				Inst, Inst2),
 			get_arg_insts(Inst2, ConsId, Arity, FinalInstsX)
-=======
-			inst_expand(ModuleInfo1, InstOfX, InstOfX1),
-			list__length(ArgVars0, Arity),
-			get_arg_insts(InstOfX1, ConsId, Arity, InstOfXArgs),
-			get_mode_of_args(Inst, InstOfXArgs, ModeOfXArgs0)
->>>>>>> 1.39
 		->
 			assoc_list__from_corresponding_lists(InitialInstsX,
 				FinalInstsX, ModeOfXArgs)
@@ -696,11 +586,10 @@
 		;
 			error("get_arg_insts failed")
 		),
-<<<<<<< modecheck_unify.m
 		mode_info_get_var_types(ModeInfo4, VarTypes),
 		categorize_unify_var_functor(InstOfX, Inst, ModeOfXArgs,
 				ModeArgs, X, ConsId, ArgVars0, InstMap1,
-				InstMap2, VarTypes, Det1,
+				InstMap2, VarTypes, UnifyContext, Det1,
 				Unification0, ModeInfo4,
 				Unification1, ModeInfo5),
 		split_complicated_subunifies(InstMap1, InstMap2, Unification1,
@@ -714,22 +603,6 @@
 %		;
 %			error("bind_args failed")
 %		)
-=======
-		mode_info_get_var_types(ModeInfo1, VarTypes),
-		categorize_unify_var_functor(ModeOfX, ModeOfXArgs, ModeArgs,
-				X, ConsId, ArgVars0, VarTypes, UnifyContext,
-				Unification0, ModeInfo1,
-				Unification1, ModeInfo2),
-		split_complicated_subunifies(Unification1, ArgVars0,
-				Unification, ArgVars, ExtraGoals,
-				ModeInfo2, ModeInfo3),
-		modecheck_set_var_inst(X, Inst, ModeInfo3, ModeInfo4),
-		( bind_args(Inst, ArgVars, ModeInfo4, ModeInfo5) ->
-			ModeInfo = ModeInfo5
-		;
-			error("bind_args failed")
-		)
->>>>>>> 1.39
 	;
 		set__list_to_set([X | ArgVars0], WaitingVars), % conservative
 		mode_info_error(WaitingVars,
@@ -949,25 +822,20 @@
 %-----------------------------------------------------------------------------%
 
 	% Work out what kind of unification a var-var unification is.
-:- pred categorize_unify_var_var(mode, mode, is_live, is_live, prog_var,
-		prog_var, determinism, unify_context, map(prog_var, type),
-		unification, mode_info, hlds_goal_expr, mode_info).
-:- mode categorize_unify_var_var(in, in, in, in, in, in, in, in, in, in,
-			mode_info_di, out, mode_info_uo) is det.
+:- pred categorize_unify_var_var(inst, inst, inst, inst, is_live, is_live,
+		prog_var, prog_var, instmap, instmap, determinism,
+		unify_context, map(prog_var, type), unification,
+		mode_info, hlds_goal_expr, mode_info).
+:- mode categorize_unify_var_var(in, in, in, in, in, in, in, in, in, in, in,
+		in, in, in, mode_info_di, out, mode_info_uo) is det.
 
 % categorize_unify_var_var works out which category a unification
 % between a variable and another variable expression is - whether it is
 % an assignment, a simple test or a complicated unify.
 
-<<<<<<< modecheck_unify.m
 categorize_unify_var_var(IX, FX, IY, FY, LiveX, LiveY, X, Y,
 		InstMapBefore, InstMapAfter, Det, UnifyContext,
-		VarTypes, ModeInfo0, Unify, ModeInfo) :-
-=======
-categorize_unify_var_var(ModeOfX, ModeOfY, LiveX, LiveY, X, Y, Det,
-		UnifyContext, VarTypes, Unification0, ModeInfo0,
-		Unify, ModeInfo) :-
->>>>>>> 1.39
+		VarTypes, Unification0, ModeInfo0, Unify, ModeInfo) :-
 	mode_info_get_module_info(ModeInfo0, ModuleInfo0),
 	mode_info_get_inst_table(ModeInfo0, InstTable0),
 	(
@@ -1003,9 +871,7 @@
 		%
 		% Check for unreachable unifications
 		%
-		( mode_get_insts(ModuleInfo0, ModeOfX, not_reached, _)
-		; mode_get_insts(ModuleInfo0, ModeOfY, not_reached, _)
-		)
+		( IX = not_reached ; IY = not_reached )
 	->
 		%
 		% For these, we can generate any old junk here --
@@ -1022,60 +888,10 @@
 			Unification = simple_test(X, Y),
 			ModeInfo = ModeInfo0
 		;
-<<<<<<< modecheck_unify.m
-			determinism_components(Det, CanFail, _),
-			UniMode0 = ((IX - IY) -> (FX - FY)),
-			Unification = complicated_unify(UniMode0, CanFail),
-			mode_info_get_instmap(ModeInfo0, InstMap0),
-			(
-				type_is_higher_order(Type, PredOrFunc, _)
-			->
-				% We do not want to report this as an error
-				% if it occurs in a compiler-generated
-				% predicate - instead, we delay the error
-				% until runtime so that it only occurs if
-				% the compiler-generated predicate gets called.
-				% not_reached is considered bound, so the 
-				% error message would be spurious if the 
-				% instmap is unreachable.
-				mode_info_get_predid(ModeInfo0, PredId),
-				module_info_pred_info(ModuleInfo0, PredId,
-						PredInfo),
-				( 
-				    ( code_util__compiler_generated(PredInfo) 
-				    ; instmap__is_unreachable(InstMap0)
-				    )
-				->
-				    ModeInfo = ModeInfo0
-				;
-				    set__init(WaitingVars),
-				    mode_info_error(WaitingVars,
-			mode_error_unify_pred(X, error_at_var(Y), Type, PredOrFunc),
-						ModeInfo0, ModeInfo)
-				)
-			;
-				% Don't request a unification if it's a
-				% X = X unification.
-				\+ ( IX = alias(Key), IY = alias(Key) ),
-				type_to_type_id(Type, TypeId, _)
-			->
-				% YYY Optimise UniMode0 in the case that there
-				%     are no shared inst_keys
-				UniMode0 = UniMode,
-				mode_info_get_context(ModeInfo0, Context),
-				unify_proc__request_unify(TypeId - UniMode, Det,
-					Context, InstTable0, ModuleInfo0, ModuleInfo),
-				mode_info_set_module_info(ModeInfo0, ModuleInfo,
-					ModeInfo)
-			;
-				ModeInfo = ModeInfo0
-			)
-=======
 			modecheck_complicated_unify(X, Y,
-				Type, ModeOfX, ModeOfY, Det, UnifyContext,
+				Type, (IX -> FX), (IY -> FY), Det, UnifyContext,
 				Unification0, ModeInfo0,
 				Unification, ModeInfo)
->>>>>>> 1.39
 		)
 	),
 	%
@@ -1118,9 +934,9 @@
 	->
 		Unify = conj([])
 	;
-		ModeOfX = IX - FX,
-		ModeOfY = IY - FY,
-		Unify = unify(X, var(Y), ModeOfX - ModeOfY, Unification,
+		UModeOfX = IX - FX,
+		UModeOfY = IY - FY,
+		Unify = unify(X, var(Y), UModeOfX - UModeOfY, Unification,
 				UnifyContext)
 	).
 
@@ -1143,7 +959,7 @@
 	mode_info_get_module_info(ModeInfo0, ModuleInfo0),
 	mode_get_insts(ModuleInfo0, ModeOfX, InitialInstX, FinalInstX),
 	mode_get_insts(ModuleInfo0, ModeOfY, InitialInstY, FinalInstY),
-	UniMode = ((InitialInstX - InitialInstY) -> (FinalInstX - FinalInstY)),
+	UniMode0 = ((InitialInstX - InitialInstY) -> (FinalInstX - FinalInstY)),
 	determinism_components(Det, CanFail, _),
 	( Unification0 = complicated_unify(_, _, UnifyTypeInfoVars0) ->
 		UnifyTypeInfoVars = UnifyTypeInfoVars0
@@ -1150,7 +966,7 @@
 	;
 		error("modecheck_complicated_unify")
 	),
-	Unification = complicated_unify(UniMode, CanFail, UnifyTypeInfoVars),
+	Unification = complicated_unify(UniMode0, CanFail, UnifyTypeInfoVars),
 
 	%
 	% check that all the type_info or type_class_info variables used
@@ -1171,6 +987,8 @@
 	),
 
 	mode_info_get_module_info(ModeInfo2, ModuleInfo2),
+	mode_info_get_instmap(ModeInfo2, InstMap),
+	mode_info_get_inst_table(ModeInfo2, InstTable),
 
 	(
 		mode_info_get_errors(ModeInfo2, Errors),
@@ -1186,7 +1004,8 @@
 		% also be able to handle (in(any), in(any)) unifications.]
 		%
 		Type = term__variable(_),
-		\+ inst_is_ground_or_any(ModuleInfo2, InitialInstX)
+		\+ inst_is_ground_or_any(InitialInstX, InstMap, InstTable,
+			ModuleInfo2)
 	->
 		set__singleton_set(WaitingVars, X),
 		mode_info_error(WaitingVars,
@@ -1194,7 +1013,8 @@
 			ModeInfo2, ModeInfo)
 	;
 		Type = term__variable(_),
-		\+ inst_is_ground_or_any(ModuleInfo2, InitialInstY)
+		\+ inst_is_ground_or_any(InitialInstY, InstMap, InstTable,
+			ModuleInfo2)
 	->
 		set__singleton_set(WaitingVars, Y),
 		mode_info_error(WaitingVars,
@@ -1218,10 +1038,9 @@
 		mode_info_get_predid(ModeInfo2, PredId),
 		module_info_pred_info(ModuleInfo2, PredId,
 				PredInfo),
-		mode_info_get_instmap(ModeInfo2, InstMap0),
 		( 
 			( code_util__compiler_generated(PredInfo) 
-			; instmap__is_unreachable(InstMap0)
+			; instmap__is_unreachable(InstMap)
 			)
 		->
 			ModeInfo = ModeInfo2
@@ -1233,6 +1052,10 @@
 				ModeInfo2, ModeInfo)
 		)
 	;
+		% Don't request a unification if it's a
+		% X = X unification.
+		\+ ( InitialInstX = alias(Key), InitialInstY = alias(Key) ),
+
 		%
 		% Ensure that we will generate code for the unification
 		% procedure that will be used to implement this complicated
@@ -1240,9 +1063,12 @@
 		%
 		type_to_type_id(Type, TypeId, _)
 	->
+		% YYY Optimise UniMode0 in the case that there
+		%     are no shared inst_keys
+		UniMode0 = UniMode,
 		mode_info_get_context(ModeInfo2, Context),
 		unify_proc__request_unify(TypeId - UniMode,
-			Det, Context, ModuleInfo2, ModuleInfo),
+			Det, Context, InstTable, ModuleInfo2, ModuleInfo),
 		mode_info_set_module_info(ModeInfo2, ModuleInfo,
 			ModeInfo)
 	;
@@ -1348,29 +1174,16 @@
 % unification or a deconstruction.  It also works out whether it will
 % be deterministic or semideterministic.
 
-<<<<<<< modecheck_unify.m
 :- pred categorize_unify_var_functor(inst, inst, assoc_list(inst, inst),
 		assoc_list(inst, inst), prog_var, cons_id, list(prog_var),
-		instmap, instmap, map(prog_var, type), determinism, unification,
-		mode_info, unification, mode_info).
+		instmap, instmap, map(prog_var, type), unify_context,
+		determinism, unification, mode_info, unification, mode_info).
 :- mode categorize_unify_var_functor(in, in, in, in, in, in, in, in, in, in,
-		in, in, mode_info_di, out, mode_info_uo) is det.
-=======
-:- pred categorize_unify_var_functor(mode, list(mode), list(mode), prog_var,
-		cons_id, list(prog_var), map(prog_var, type), unify_context,
-		unification, mode_info, unification, mode_info).
-:- mode categorize_unify_var_functor(in, in, in, in, in, in, in, in, in,
-			mode_info_di, out, mode_info_uo) is det.
->>>>>>> 1.39
+		in, in, in, mode_info_di, out, mode_info_uo) is det.
 
-<<<<<<< modecheck_unify.m
 categorize_unify_var_functor(IX, FX, ModeOfXArgs, ArgModes0, X, NewConsId,
-		ArgVars, InstMapBefore, InstMapAfter, VarTypes, Det,
-=======
-categorize_unify_var_functor(ModeOfX, ModeOfXArgs, ArgModes0,
-		X, NewConsId, ArgVars, VarTypes, UnifyContext,
->>>>>>> 1.39
-		Unification0, ModeInfo0, Unification, ModeInfo) :-
+		ArgVars, InstMapBefore, InstMapAfter, VarTypes, UnifyContext,
+		Det, Unification0, ModeInfo0, Unification, ModeInfo) :-
 	mode_info_get_module_info(ModeInfo0, ModuleInfo),
 	mode_info_get_inst_table(ModeInfo0, InstTable0),
 	map__lookup(VarTypes, X, TypeOfX),
-- 
David Overton       Department of Computer Science & Software Engineering
MEngSc Student      The University of Melbourne, Australia
+61 3 9344 9159     http://www.cs.mu.oz.au/~dmo
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list