[m-dev.] for review: using field names in mode_info

Zoltan Somogyi zs at cs.mu.OZ.AU
Thu Jul 27 17:30:52 AEST 2000


For a quick check by dmo, whose work this is. (I just took dmo's diff
and removed the very few things that changed the module's interface.)

compiler/mode_info.m:
	Start using field names.

Zoltan.

cvs diff: Diffing .
Index: mode_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mode_info.m,v
retrieving revision 1.51
diff -u -b -r1.51 mode_info.m
--- mode_info.m	1999/07/13 08:53:13	1.51
+++ mode_info.m	2000/07/27 07:17:55
@@ -1,5 +1,5 @@
 %-----------------------------------------------------------------------------%
-% Copyright (C) 1994-1999 The University of Melbourne.
+% Copyright (C) 1994-2000 The University of Melbourne.
 % This file may only be copied under the terms of the GNU General
 % Public License - see the file COPYING in the Mercury distribution.
 %-----------------------------------------------------------------------------%
@@ -339,35 +339,42 @@
 
 :- type mode_info 
 	--->	mode_info(
-			io__state,
-			module_info,
-			pred_id,	% The pred we are checking
-			proc_id,	% The mode which we are checking
-			prog_varset,	% The variables in the current proc
-			map(prog_var, type),
+			io_state :: io__state,
+			module_info :: module_info,
+			predid :: pred_id,	% The pred we are checking
+			procid :: proc_id,	% The mode which we are checking
+			varset :: prog_varset,	
+					% The variables in the current proc
+			var_types :: map(prog_var, type),
 					% The types of the variables
-			prog_context,	% The line number of the subgoal we
+			context :: prog_context,
+					% The line number of the subgoal we
 					% are currently checking
-			mode_context,	% A description of where in the
+			mode_context :: mode_context,
+					% A description of where in the
 					% goal the error occurred
-			instmap,	% The current instantiatedness
+			instmap :: instmap,
+					% The current instantiatedness
 					% of the variables
-			locked_vars,	% The "locked" variables,
+			locked_vars :: locked_vars,
+					% The "locked" variables,
 					% i.e. variables which cannot be
 					% further instantiated inside a
 					% negated context
-			delay_info,	% info about delayed goals
-			list(mode_error_info),
+			delay_info :: delay_info,
+					% info about delayed goals
+			errors :: list(mode_error_info),
 					% The mode errors found
 
-			list(set(prog_var)),	% The live variables,
+			live_vars :: list(set(prog_var)),
+					% The live variables,
 	% i.e. those variables which may be referenced again on forward
 	% execution or after shallow backtracking.  (By shallow
 	% backtracking, I mean semidet backtracking in a negation,
 	% if-then-else, or semidet disjunction within the current
 	% predicate.)
 
-			list(set(prog_var)),
+			nondet_live_vars :: list(set(prog_var)),
 					% The nondet-live variables,
 	% i.e. those variables which may be referenced again after deep
 	% backtracking TO THE CURRENT EXECUTION POINT.  These are the
@@ -378,7 +385,7 @@
 	% execution point, since those variables will *already* have
 	% been marked as mostly_unique rather than unique.)
 
-			assoc_list(prog_var, inst),
+			last_checkpoint_insts :: assoc_list(prog_var, inst),
 	% This field is used by the checkpoint code when debug_modes is on.
 	% It has the instmap that was current at the last mode checkpoint,
 	% so that checkpoints do not print out the insts of variables
@@ -386,6 +393,7 @@
 	% This field will always contain an empty list if debug_modes is off,
 	% since its information is not needed then.
 
+			parallel_vars ::
 			list(pair(set(prog_var), set(prog_var))),
 	% A stack of pairs of sets of variables used to mode-check
 	% parallel conjunctions. The first set is the nonlocals of
@@ -394,18 +402,20 @@
 	% bound inside the current parallel conjunct - the stack is for
 	% the correct handling of nested parallel conjunctions.
 
-			bool,		% Changed flag
+			changed_flag :: bool,
+					% Changed flag
 					% If `yes', then we may need
 					% to repeat mode inference.
 
-			how_to_check_goal,
+			how_to_check :: how_to_check_goal,
 
-			may_change_called_proc,
+			may_change_called_proc :: may_change_called_proc,
 					% Is mode analysis allowed
 					% to change which procedure
 					% is called?
 
-			bool		% Are we rechecking a goal after
+			checking_extra_goals :: bool
+					% Are we rechecking a goal after
 					% introducing unifications for
 					% complicated sub-unifications
 					% or an implied mode?
@@ -454,108 +464,83 @@
 
 	% Lots of very boring access predicates.
 
-mode_info_get_io_state(
-		mode_info(IOState0,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_),
-		IOState) :-
+mode_info_get_io_state(ModeInfo, IOState) :-
 	% XXX
-	unsafe_promise_unique(IOState0, IOState).
+	unsafe_promise_unique(ModeInfo^io_state, IOState).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_io_state(mode_info(_,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T),
-		IOState0,
-		mode_info(IOState,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T)) :-
+mode_info_set_io_state(ModeInfo, IOState0, ModeInfo^io_state := IOState) :-
 	% XXX
 	unsafe_promise_unique(IOState0, IOState).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_module_info(
-		mode_info(_,ModuleInfo,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_),
-		ModuleInfo).
+mode_info_get_module_info(ModeInfo, ModeInfo^module_info).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_module_info(mode_info(A,_,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T),
-		ModuleInfo,
-		mode_info(A,ModuleInfo,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T)).
+mode_info_set_module_info(ModeInfo, ModuleInfo,
+		ModeInfo^module_info := ModuleInfo).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_preds(
-		mode_info(_,ModuleInfo,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_),
-		Preds) :-
-	module_info_preds(ModuleInfo, Preds).
+mode_info_get_preds(ModeInfo, Preds) :-
+	module_info_preds(ModeInfo^module_info, Preds).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_modes(
-		mode_info(_,ModuleInfo,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_),
-		Modes) :-
-	module_info_modes(ModuleInfo, Modes).
+mode_info_get_modes(ModeInfo, Modes) :-
+	module_info_modes(ModeInfo^module_info, Modes).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_insts(
-		mode_info(_,ModuleInfo,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_),
-		Insts) :-
-	module_info_insts(ModuleInfo, Insts).
+mode_info_get_insts(ModeInfo, Insts) :-
+	module_info_insts(ModeInfo^module_info, Insts).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_predid(mode_info(_,_,PredId,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_),
-		PredId).
+mode_info_get_predid(ModeInfo, ModeInfo^predid).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_procid(mode_info(_,_,_,ProcId,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_), 
-		ProcId).
+mode_info_get_procid(ModeInfo, ModeInfo^procid).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_varset(mode_info(_,_,_,_,VarSet,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_),
-		VarSet).
+mode_info_get_varset(ModeInfo, ModeInfo^varset).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_varset(VarSet,
-		mode_info(A,B,C,D,_,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T),
-		mode_info(A,B,C,D,VarSet,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T)).
+mode_info_set_varset(VarSet) -->
+	^varset := VarSet.
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_var_types(
-		mode_info(_,_,_,_,_,VarTypes,_,_,_,_,_,_,_,_,_,_,_,_,_,_),
-		VarTypes).
+mode_info_get_var_types(ModeInfo, ModeInfo^var_types).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_var_types(VTypes,
-		mode_info(A,B,C,D,E,_,G,H,I,J,K,L,M,N,O,P,Q,R,S,T),
-		mode_info(A,B,C,D,E,VTypes,G,H,I,J,K,L,M,N,O,P,Q,R,S,T)).
+mode_info_set_var_types(VTypes) -->
+	^var_types := VTypes.
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_context(mode_info(_,_,_,_,_,_,Context,_,_,_,_,_,_,_,_,_,_,_,_,_),
-		Context).
+mode_info_get_context(ModeInfo, ModeInfo^context).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_context(Context,
-		mode_info(A,B,C,D,E,F,_,H,I,J,K,L,M,N,O,P,Q,R,S,T),
-		mode_info(A,B,C,D,E,F,Context,H,I,J,K,L,M,N,O,P,Q,R,S,T)).
+mode_info_set_context(Context) -->
+	^context := Context.
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_mode_context(
-		mode_info(_,_,_,_,_,_,_,ModeContext,_,_,_,_,_,_,_,_,_,_,_,_),
-		ModeContext).
+mode_info_get_mode_context(ModeInfo, ModeInfo^mode_context).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_mode_context(ModeContext,
-		mode_info(A,B,C,D,E,F,G,_,I,J,K,L,M,N,O,P,Q,R,S,T),
-		mode_info(A,B,C,D,E,F,G,ModeContext,I,J,K,L,M,N,O,P,Q,R,S,T)).
+mode_info_set_mode_context(ModeContext) -->
+	^mode_context := ModeContext.
 
 %-----------------------------------------------------------------------------%
 
@@ -583,8 +568,7 @@
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_instmap(mode_info(_,_,_,_,_,_,_,_,InstMap,_,_,_,_,_,_,_,_,_,_,_),
-		InstMap).
+mode_info_get_instmap(ModeInfo, ModeInfo^instmap).
 
 	% mode_info_dcg_get_instmap/3 is the same as mode_info_get_instmap/2
 	% except that it's easier to use inside a DCG.
@@ -594,46 +578,42 @@
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_instmap( InstMap,
-		mode_info(A,B,C,D,E,F,G,H,InstMap0,J,
-			DelayInfo0,L,M,N,O,P,Q,R,S,T),
-		mode_info(A,B,C,D,E,F,G,H,InstMap,J,
-			DelayInfo,L,M,N,O,P,Q,R,S,T)) :-
-	( instmap__is_unreachable(InstMap), instmap__is_reachable(InstMap0) ->
-		delay_info__bind_all_vars(DelayInfo0, DelayInfo)
+mode_info_set_instmap(InstMap) -->
+	InstMap0 =^ instmap,
+	^instmap := InstMap,
+	(
+		{ instmap__is_unreachable(InstMap) },
+		{ instmap__is_reachable(InstMap0) }
+	->
+		DelayInfo0 =^ delay_info,
+		{ delay_info__bind_all_vars(DelayInfo0, DelayInfo) },
+		^delay_info := DelayInfo
 	;
-		DelayInfo = DelayInfo0
+		[]
 	).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_locked_vars(
-		mode_info(_,_,_,_,_,_,_,_,_,LockedVars,_,_,_,_,_,_,_,_,_,_),
-		LockedVars).
+mode_info_get_locked_vars(ModeInfo, ModeInfo^locked_vars).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_locked_vars( mode_info(A,B,C,D,E,F,G,H,I,_,K,L,M,N,O,P,Q,R,S,T),
-	LockedVars,
-	mode_info(A,B,C,D,E,F,G,H,I,LockedVars,K,L,M,N,O,P,Q,R,S,T)).
+mode_info_set_locked_vars(ModeInfo, LockedVars,
+		ModeInfo^locked_vars := LockedVars).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_errors(mode_info(_,_,_,_,_,_,_,_,_,_,_,Errors,_,_,_,_,_,_,_,_),
-		Errors).
+mode_info_get_errors(ModeInfo, ModeInfo^errors).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_num_errors(
-		mode_info(_,_,_,_,_,_,_,_,_,_,_,Errors,_,_,_,_,_,_,_,_),
-		NumErrors) :-
-	list__length(Errors, NumErrors).
+mode_info_get_num_errors(ModeInfo, NumErrors) :-
+	list__length(ModeInfo^errors, NumErrors).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_errors(Errors,
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,_,M,N,O,P,Q,R,S,T), 
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,Errors,M,N,O,P,Q,R,S,T)).
+mode_info_set_errors(Errors) -->
+	^errors := Errors.
 
 %-----------------------------------------------------------------------------%
 
@@ -645,24 +625,19 @@
 	% Add a set of vars to the bag of live vars and
 	% the bag of nondet-live vars.
 
-mode_info_add_live_vars(NewLiveVars,
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,
-			LiveVars0,NondetLiveVars0,O,P,Q,R,S,T),
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,
-			LiveVars,NondetLiveVars,O,P,Q,R,S,T)) :-
+mode_info_add_live_vars(NewLiveVars) -->
+	LiveVars0 =^ live_vars,
+	NondetLiveVars0 =^ nondet_live_vars,
+	^live_vars := [NewLiveVars | LiveVars0],
+	^nondet_live_vars := [NewLiveVars | NondetLiveVars0].
 
-	LiveVars = [NewLiveVars | LiveVars0],
-	NondetLiveVars = [NewLiveVars | NondetLiveVars0].
-
 	% Remove a set of vars from the bag of live vars and
 	% the bag of nondet-live vars.
 
-mode_info_remove_live_vars(OldLiveVars, ModeInfo0, ModeInfo) :-
-	ModeInfo0 = mode_info(A,B,C,D,E,F,G,H,I,J,K,L,
-				LiveVars0, NondetLiveVars0,O,P,Q,R,S,T),
-	ModeInfo1 = mode_info(A,B,C,D,E,F,G,H,I,J,K,L,
-				LiveVars, NondetLiveVars,O,P,Q,R,S,T),
-	(
+mode_info_remove_live_vars(OldLiveVars) -->
+	LiveVars0 =^ live_vars,
+	NondetLiveVars0 =^ nondet_live_vars,
+	{
 		list__delete_first(LiveVars0, OldLiveVars, LiveVars1),
 		list__delete_first(NondetLiveVars0, OldLiveVars,
 			NondetLiveVars1)
@@ -671,13 +646,15 @@
 		NondetLiveVars = NondetLiveVars1
 	;
 		error("mode_info_remove_live_vars: failed")
-	),
+	},
+	^live_vars := LiveVars,
+	^nondet_live_vars := NondetLiveVars,
 		% when a variable becomes dead, we may be able to wake
 		% up a goal which is waiting on that variable
-	set__to_sorted_list(OldLiveVars, VarList),
-	mode_info_get_delay_info(ModeInfo1, DelayInfo0),
-	delay_info__bind_var_list(VarList, DelayInfo0, DelayInfo),
-	mode_info_set_delay_info(DelayInfo, ModeInfo1, ModeInfo).
+	{ set__to_sorted_list(OldLiveVars, VarList) },
+	DelayInfo0 =^ delay_info,
+	{ delay_info__bind_var_list(VarList, DelayInfo0, DelayInfo) },
+	^delay_info := DelayInfo.
 
 	% Check whether a list of variables are live or not
 
@@ -688,12 +665,10 @@
 
 	% Check whether a variable is live or not
 
-mode_info_var_is_live(
-		mode_info(_,_,_,_,_,_,_,_,_,_,_,_,LiveVarsList,_,_,_,_,_,_,_),
-		Var, Result) :-
+mode_info_var_is_live(ModeInfo, Var, Result) :-
 	(
 		% some [LiveVars] 
-		list__member(LiveVars, LiveVarsList),
+		list__member(LiveVars, ModeInfo^live_vars),
 		set__member(Var, LiveVars)
 	->
 		Result = live
@@ -703,11 +678,10 @@
 
 	% Check whether a variable is nondet_live or not.
 
-mode_info_var_is_nondet_live(mode_info(_,_,_,_,_,_,_,_,_,_,_,_,_,
-		NondetLiveVarsList,_,_,_,_,_,_), Var, Result) :-
+mode_info_var_is_nondet_live(ModeInfo, Var, Result) :-
 	(
 		% some [LiveVars] 
-		list__member(LiveVars, NondetLiveVarsList),
+		list__member(LiveVars, ModeInfo^nondet_live_vars),
 		set__member(Var, LiveVars)
 	->
 		Result = live
@@ -715,22 +689,19 @@
 		Result = dead
 	).
 
-mode_info_get_liveness(mode_info(_,_,_,_,_,_,_,_,_,_,_,_,LiveVarsList,
-		_,_,_,_,_,_,_), LiveVars) :-
+mode_info_get_liveness(ModeInfo, LiveVars) :-
 	set__init(LiveVars0),
-	mode_info_get_liveness_2(LiveVarsList, LiveVars0, LiveVars).
+	mode_info_get_liveness_2(ModeInfo^live_vars, LiveVars0, LiveVars).
 
 mode_info_get_liveness_2([], LiveVars, LiveVars).
 mode_info_get_liveness_2([LiveVarsSet | LiveVarsList], LiveVars0, LiveVars) :-
 	set__union(LiveVars0, LiveVarsSet, LiveVars1),
 	mode_info_get_liveness_2(LiveVarsList, LiveVars1, LiveVars).
 
-mode_info_get_live_vars(mode_info(_,_,_,_,_,_,_,_,_,_,_,_,LiveVarsList,
-		_,_,_,_,_,_,_), LiveVarsList).
+mode_info_get_live_vars(ModeInfo, ModeInfo^live_vars).
 
-mode_info_set_live_vars(LiveVarsList,
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,_,N,O,P,Q,R,S,T),
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,LiveVarsList,N,O,P,Q,R,S,T)).
+mode_info_set_live_vars(LiveVarsList) -->
+	^live_vars := LiveVarsList.
 
 %-----------------------------------------------------------------------------%
 
@@ -782,72 +753,53 @@
 	;
 		mode_info_var_is_locked_2(Sets, Var, Reason)
 	).
+
+mode_info_get_delay_info(ModeInfo, ModeInfo^delay_info).
+
+mode_info_set_delay_info(DelayInfo) -->
+	^delay_info := DelayInfo.
+
+mode_info_get_nondet_live_vars(ModeInfo, ModeInfo^nondet_live_vars).
+
+mode_info_set_nondet_live_vars(NondetLiveVars) -->
+	^nondet_live_vars := NondetLiveVars.
+
+mode_info_get_last_checkpoint_insts(ModeInfo, ModeInfo^last_checkpoint_insts).
+
+mode_info_set_last_checkpoint_insts(LastCheckpointInsts) -->
+	^last_checkpoint_insts := LastCheckpointInsts.
+
+mode_info_get_parallel_vars(PVars) -->
+	PVars =^ parallel_vars.
+
+mode_info_set_parallel_vars(PVars) -->
+	^parallel_vars := PVars.
+
+mode_info_get_changed_flag(ModeInfo, ModeInfo^changed_flag).
+
+mode_info_set_changed_flag(Changed) -->
+	^changed_flag := Changed.
+
+mode_info_get_how_to_check(ModeInfo, ModeInfo^how_to_check).
+
+mode_info_set_how_to_check(How) -->
+	^how_to_check := How.
+
+mode_info_get_may_change_called_proc(ModeInfo,
+		ModeInfo^may_change_called_proc).
+
+mode_info_set_may_change_called_proc(MayChange) -->
+	^may_change_called_proc := MayChange.
 
-mode_info_get_delay_info(
-		mode_info(_,_,_,_,_,_,_,_,_,_,DelayInfo,_,_,_,_,_,_,_,_,_),
-		DelayInfo).
-
-mode_info_set_delay_info(DelayInfo,
-		mode_info(A,B,C,D,E,F,G,H,I,J,_,L,M,N,O,P,Q,R,S,T),
-		mode_info(A,B,C,D,E,F,G,H,I,J,DelayInfo,L,M,N,O,P,Q,R,S,T)).
-
-mode_info_get_nondet_live_vars(mode_info(_,_,_,_,_,_,_,_,_,_,_,_,_,
-			NondetLiveVars,_,_,_,_,_,_), NondetLiveVars).
-
-mode_info_set_nondet_live_vars(NondetLiveVars,
-	mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,_,O,P,Q,R,S,T),
-	mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,NondetLiveVars,O,P,Q,R,S,T)).
-
-mode_info_get_last_checkpoint_insts(mode_info(_,_,_,_,_,_,_,_,_,_,_,_,_,_,
-		LastCheckpointInsts,_,_,_,_,_), LastCheckpointInsts).
-
-mode_info_set_last_checkpoint_insts(LastCheckpointInsts,
-			mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,_,P,Q,R,S,T),
-			mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,
-				LastCheckpointInsts,P,Q,R,S,T)).
-
-mode_info_get_parallel_vars(PVars, ModeInfo, ModeInfo) :-
-	ModeInfo = mode_info(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,PVars,_,_,_,_).
-
-mode_info_set_parallel_vars(PVars,
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,_,Q,R,S,T),
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,PVars,Q,R,S,T)).
-
-mode_info_get_changed_flag(
-		mode_info(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,Changed,_,_,_),
-		Changed).
-
-mode_info_set_changed_flag(Changed,
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,_,R,S,T),
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Changed,R,S,T)).
-
-mode_info_get_how_to_check(
-		mode_info(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,How,_,_),
-		How).
-
-mode_info_set_how_to_check(How,
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,_,S,T),
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,How,S,T)).
-
-mode_info_get_may_change_called_proc(
-		mode_info(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,MayChange,_),
-		MayChange).
-
-mode_info_set_may_change_called_proc(MayChange,
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,_,T),
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,MayChange,T)).
-
-mode_info_set_checking_extra_goals(Checking,
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,Checking0),
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,Checking)) :-
-	( Checking0 = yes, Checking = yes ->
+mode_info_set_checking_extra_goals(Checking) -->
+	( yes =^ checking_extra_goals, { Checking = yes } ->
 		% This should never happen - once the extra goals are
 		% introduced, rechecking the goal should not introduce
 		% more extra goals.
-		error(
-		"mode analysis: rechecking extra goals adds more extra goals")
+		{ error(
+		"mode analysis: rechecking extra goals adds more extra goals") }
 	;
-		true
+		^checking_extra_goals := Checking
 	).
 
 %-----------------------------------------------------------------------------%
cvs diff: Diffing notes
--------------------------------------------------------------------------
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