[m-rev.] [reuse] diff: bugfix where some aliases did not propagate

Nancy Mazur Nancy.Mazur at cs.kuleuven.ac.be
Fri Mar 23 06:54:04 AEDT 2001


Hi Peter,

found the bastard ! it was really hiding well... 

Nancy

===================================================================


Estimated hours taken: 10
Branches: reuse

Bugfix, and while at it, reorganizing some code. 
Although aliases should have been derived, they weren't, simply
yielding bottom. As this was noticed in connection with adding
the user-declarable aliasing information, the bug was first
searched in that direction. Finally it appeared that the bug
has always been there (the b*stard!) and was related to type-selectors,
and verifying when one selector is less or equal than the other
one. 
Also corrected sr_dead and sr_indirect, so they too can take 
foreign-code aliases into account. 


pa_selector.m:
	Bugfix. 

pa_alias_as.m:
pa_run.m:
	Reorganizing the code. 


sr_dead.m:
sr_indirect.m:
	Take new foreign-code aliases into account. 


Index: pa_alias_as.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/pa_alias_as.m,v
retrieving revision 1.1.2.17
diff -u -r1.1.2.17 pa_alias_as.m
--- pa_alias_as.m	2001/03/22 10:06:50	1.1.2.17
+++ pa_alias_as.m	2001/03/22 19:46:56
@@ -59,6 +59,15 @@
 		alias_as, list(pa_datastruct__datastruct)).
 :- mode collect_aliases_of_datastruct(in, in, in, in, out) is det.
 
+	% Fully rename a given alias originating from a call
+	% to a procedure with given pred_proc_id. 
+	% rename_call_alias(PredProcId, ModuleInfo, ActualVars, 
+	% 	ActualTypes, FormalAlias, ActualAlias). 
+:- pred rename_call_alias( pred_proc_id, module_info, list(prog_var),
+				list( (type) ), 
+				alias_as, alias_as).
+:- mode rename_call_alias( in, in, in, in, in, out) is det.
+
 	% rename abstract substitution according to a mapping
 	% of prog_vars (map (FROM_VARS, TO_VARS)).
 :- pred rename(map(prog_var, prog_var), alias_as, alias_as).
@@ -112,13 +121,14 @@
 :- pred extend_unification(proc_info, module_info, 
 			hlds_goal__unification, 
 			hlds_goal__hlds_goal_info, alias_as, alias_as).
+
 :- mode extend_unification(in, in, in, in, in, out) is det.
 
-:- pred extend_foreign_code(proc_info, module_info, hlds_goal_info,
-			pragma_foreign_code_attributes,
-			list(prog_var), list(maybe(pair(string, mode))),
-                        list(type), alias_as, alias_as).
-:- mode extend_foreign_code(in, in, in, in, in, in, in, in, out) is det.
+:- pred extend_foreign_code(module_info::in, proc_info::in,
+		pragma_foreign_code_attributes::in, pred_id::in, proc_id::in, 
+		list(prog_var)::in, list(maybe(pair(string, mode)))::in,
+                list(type)::in, hlds_goal_info::in, 
+		alias_as::in, alias_as::out) is det.
 
 	% Add two abstract substitutions to each other. These
 	% abstract substitutions come from different contexts, and have
@@ -285,7 +295,17 @@
 		error("(pa_alias_as) collect_aliases_of_datastruct: alias_as is top.")
 	).
 	
-			
+		
+rename_call_alias(PredProcId, ModuleInfo, ActualVars, ActualTypes,
+		FormalAlias, ActualAlias):- 
+	module_info_pred_proc_info(ModuleInfo, PredProcId, PredInfo,
+			ProcInfo),
+	pred_info_arg_types(PredInfo, FormalTypes), 
+	proc_info_headvars(ProcInfo, FormalVars),
+	map__from_corresponding_lists(FormalVars, ActualVars, Dict), 
+	pa_alias_as__rename(Dict, FormalAlias, FormalAlias1),
+	pa_alias_as__rename_types(FormalTypes,  ActualTypes, 
+			FormalAlias1, ActualAlias).
 
 rename(MapVar, ASin, ASout):-
 	(
@@ -478,47 +498,84 @@
 
 
 %-----------------------------------------------------------------------------%
-extend_foreign_code(ProcInfo, HLDS, GoalInfo,
-			Attrs, Vars, MaybeModes, Types, Alias0, Alias):-
-	to_trios(Vars, MaybeModes, Types, Trios), 
-	% remove all unique objects
-	remove_all_unique_vars(HLDS, Trios, NonUniqueVars), 
-	% keep only the output vars
-	collect_all_output_vars(HLDS, NonUniqueVars, OutputVars), 
+extend_foreign_code(HLDS, ProcInfo, Attrs, PredId, ProcId, 
+		Vars, MaybeModes, Types, Info, Ain, A) :- 
+	from_foreign_code(ProcInfo, HLDS, Info, Attrs, Vars, 
+		MaybeModes, Types, ForeignAlias),
+	(
+		( is_bottom(ForeignAlias); is_top(ForeignAlias) ) 
+	-> 	
+		% easy extend
+		pa_alias_as__extend(ProcInfo, HLDS, ForeignAlias, Ain, A)
+	; 
+		% rename variables and types !
+		proc_info_vartypes(ProcInfo, VarTypes), 
+		list__map(map__lookup(VarTypes), Vars, ActualTypes), 
+		rename_call_alias(proc(PredId, ProcId), HLDS, Vars, 
+				ActualTypes, ForeignAlias, RenamedForeign), 
+%		RenamedForeign = ForeignAlias, 
+		pa_alias_as__extend(ProcInfo, HLDS, RenamedForeign, Ain, A)
+	). 
+
+:- pred i_said_get_rid_of_those_typeinfos(proc_info::in, 
+		list(type)::in, list(type)::out) is det.
+i_said_get_rid_of_those_typeinfos(ProcInfo, Types0, Types):-
+	proc_info_real_headvars(ProcInfo, Hvs), 
+	list__length(Hvs, RealArity), 
+	list__length(Types0, TooBigArity), 
+	Diff = TooBigArity - RealArity, 
 	(
-		aliasing(Attrs, UserDefinedAlias),
-		UserDefinedAlias = aliasing(_MaybeTypes, UserAlias),
-		UserAlias \= top(_)
+		list__drop(Diff, Types0, Types1)
 	->
-		extend(ProcInfo, HLDS, UserAlias, Alias0, Alias)
-	;	
-		(
-			OutputVars = [] 
-%		; 
-%			% XXXXXXXXXXXXXXXXX !!
-%			OutputVars = [_], InputVars = []
-		)
+		Types = Types1
+	; 
+		require__error("(pa_alias_as) problems getting rid of typeinfos.")
+	).
+				
+:- pred from_foreign_code(proc_info, module_info, hlds_goal_info,
+			pragma_foreign_code_attributes,
+			list(prog_var), list(maybe(pair(string, mode))),
+                        list(type), alias_as).
+:- mode from_foreign_code(in, in, in, in, in, in, in, out) is det.
+
+from_foreign_code(_ProcInfo, HLDS, GoalInfo, Attrs, Vars, 
+		MaybeModes, Types, Alias):-
+	(
+		aliasing(Attrs, UserDefinedAlias), 
+		UserDefinedAlias = aliasing(_, UserAlias),
+		UserAlias \= top(_)
 	->
-		Alias = Alias0
+		Alias = UserAlias
 	;
-		list__map( 
-			pred(Trio::in, Type::out) is det:-
-			( 
-				Trio = trio(_, _, Type)
-			), 
-			OutputVars,
-			OutputTypes),
+		% else --> apply heuristics
+		to_trios(Vars, MaybeModes, Types, Trios), 
+		% remove all unique objects
+		remove_all_unique_vars(HLDS, Trios, NonUniqueVars), 
+		% keep only the output vars
+		collect_all_output_vars(HLDS, NonUniqueVars, OutputVars), 
 		(
-			types_are_primitive(HLDS, OutputTypes) 
-		-> 
-			Alias = Alias0
-		; 
-
-			goal_info_get_context(GoalInfo, Context), 
-			format_context(Context, ContextStr), 
-			string__append_list(["pragma_foreign_code:",
+			OutputVars = [] 
+		->
+			Alias = bottom
+		;
+			list__map( 
+				pred(Trio::in, Type::out) is det:-
+				( 
+					Trio = trio(_, _, Type)
+				), 
+				OutputVars,
+				OutputTypes),
+			(
+				types_are_primitive(HLDS, OutputTypes) 
+			-> 
+				Alias = bottom
+			; 
+				goal_info_get_context(GoalInfo, Context), 
+				format_context(Context, ContextStr), 
+				string__append_list(["pragma_foreign_code:",
 						" (",ContextStr, ")"], Msg), 
-			pa_alias_as__top(Alias0, Msg, Alias)
+				pa_alias_as__top(Msg, Alias)
+			)
 		)
 	).
 	
Index: pa_run.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/pa_run.m,v
retrieving revision 1.1.2.19
diff -u -r1.1.2.19 pa_run.m
--- pa_run.m	2001/03/21 13:19:44	1.1.2.19
+++ pa_run.m	2001/03/22 19:46:57
@@ -14,7 +14,7 @@
 
 :- interface.
 
-%-------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 :- import_module io, list.
 :- import_module hlds_module, hlds_pred.
@@ -57,8 +57,8 @@
 			list( (type) ), alias_as, alias_as). 
 :- mode pa_run__extend_with_call_alias( in, in, in, in, in, in, in, out) is det.
 
-%-------------------------------------------------------------------%
-%-------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 :- implementation.
 
 :- import_module require.
@@ -78,7 +78,7 @@
 :- import_module sr_lbu, sr_lfu.
 
 
-%-------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 pa_run__aliases_pass( HLDSin, HLDSout ) -->
 
@@ -154,9 +154,9 @@
 				HLDSin, HLDSout )
 	).
 
-%-------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 % THE KERNEL 
-%-------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 :- pred analyse_pred_proc( module_info, pred_proc_id, pa_fixpoint_table, 
 				pa_fixpoint_table, io__state, io__state).
 :- mode analyse_pred_proc( in, in, in, out, di, uo) is det.
@@ -243,12 +243,8 @@
 		;
 			io__write_string("\n")
 		)
-	
-%		pa_alias_as__print_aliases(Alias, ProcInfo, PredInfo),
-%		io__write_string("\n")
 /**
-		io__write_strings(["\t\t: ", FullS, "/", ProjectS, "/", 
-					NormS, "\n"]),
+		,	
 		(
 			{ dummy_test(PRED_PROC_ID) }
 		-> 
@@ -266,7 +262,7 @@
 	).
 
 :- pred dummy_test( pred_proc_id::in) is semidet. 
-dummy_test( proc(PredId, _) ):- pred_id_to_int(PredId, 39). 
+dummy_test( proc(PredId, _) ):- pred_id_to_int(PredId, 16). 
 :- pred dummy_test_here( alias_as::in ) is det.
 dummy_test_here(_). 
 
@@ -336,8 +332,7 @@
 analyse_goal_expr( conj(Goals), _Info, ProcInfo, HLDS , T0, T, A0, A) :-
 	list__foldl2( analyse_goal(ProcInfo, HLDS),  Goals, 
 		T0, T, A0, A).
-	
-	
+
 analyse_goal_expr( call(PredID, ProcID, ARGS, _,_, _PName), _Info, 
 			ProcInfo, HLDS, T0, T, A0, A):- 
 	PRED_PROC_ID = proc(PredID, ProcID),
@@ -430,11 +425,12 @@
 	analyse_goal( ProcInfo, HLDS, ELSE, T2, T, A0, A3),
 	pa_alias_as__least_upper_bound( ProcInfo, HLDS, A2, A3, A).
 
-analyse_goal_expr(pragma_foreign_code(Attrs, _, _, Vars, MaybeModes, Types, _), 
+analyse_goal_expr(pragma_foreign_code(Attrs, PredId, ProcId, 
+			Vars, MaybeModes, Types, _), 
 			Info, ProcInfo, HLDS, 
 			T, T, Ain, A) :- 
-	pa_alias_as__extend_foreign_code(ProcInfo, HLDS, Info, Attrs, Vars, 
-		MaybeModes, Types, Ain, A). 
+	extend_foreign_code(HLDS, ProcInfo, Attrs, PredId, ProcId, 
+			Vars, MaybeModes, Types, Info, Ain, A). 
 
 	% error( "(pa) pragma_c_code not handled") .
 analyse_goal_expr( par_conj( _Goals, _SM), Info, _, _ , T, T, A0, A) :-  
@@ -587,21 +583,9 @@
 		top(ErrMsg, Alias)
 	).
 
-:- pred rename_call_alias( pred_proc_id, module_info, list(prog_var),
-				list( (type) ), 
-				alias_as, alias_as).
-:- mode rename_call_alias( in, in, in, in, in, out) is det.
-
-rename_call_alias( PRED_PROC_ID, HLDS, ARGS, ActualTypes, A0, A ):-
-	module_info_pred_proc_info( HLDS, PRED_PROC_ID, PredInfo, ProcInfo),
-	pred_info_arg_types(PredInfo, FormalTypes), 
-	proc_info_headvars(ProcInfo, Headvars),
-	map__from_corresponding_lists(Headvars,ARGS,Dict),
-	pa_alias_as__rename( Dict, A0, A1 ),
-	pa_alias_as__rename_types( FormalTypes, ActualTypes, A1, A).
 
-%-------------------------------------------------------------------%
-%-------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 % easy stuff
 
 	% once the abstract alias substitution is computed for
@@ -620,8 +604,8 @@
 					NewProcInfo, HLDSout).
 
 
-%-------------------------------------------------------------------%
-%-------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 % make the interface
 
 :- import_module globals, modules, passes_aux, bool, options.
Index: pa_selector.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/pa_selector.m,v
retrieving revision 1.1.2.5
diff -u -r1.1.2.5 pa_selector.m
--- pa_selector.m	2001/03/22 10:06:50	1.1.2.5
+++ pa_selector.m	2001/03/22 19:46:57
@@ -479,16 +479,14 @@
 		;
 			fail	% the walks do not correspond
 		)
-	; 
-		(
-			split_upto_type_selector(S1, _S1_part1, _TS1, 
-				_S2_part2 )
-		->
-			fail
-		; 
-			% normal case without type-selectors
+	; 	
+		% In the case that the second selector S2 has no type-
+		% selectors, the first one S1 can still be less or
+		% equal to the second one if all the selectors of S2
+		% correspond exactly to the first steps of S1, 
+		% so just: S1 = S2.ext, or rather: 
+		% less_or_equal(S2, S1, Extension) (the simple case)
 			less_or_equal(S1, S2, EXT )
-		)
 	). 
 
 apply_widening( ModuleInfo, MainType, Selector0, Selector ) :-
Index: sr_dead.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_dead.m,v
retrieving revision 1.1.2.16
diff -u -r1.1.2.16 sr_dead.m
--- sr_dead.m	2001/03/21 13:19:53	1.1.2.16
+++ sr_dead.m	2001/03/22 19:46:58
@@ -178,9 +178,10 @@
 	
 annotate_goal(ProcInfo, HLDS, Expr0 - Info0, Goal, 
 			Pool0, Pool, Alias0, Alias) :- 
-	Expr0 = pragma_foreign_code(Attrs, _, _, Vars, MaybeModes, Types, _), 
-	pa_alias_as__extend_foreign_code(ProcInfo, HLDS, Info0, Attrs, Vars, 
-			MaybeModes, Types, Alias0, Alias), 
+	Expr0 = pragma_foreign_code(Attrs, PredId, ProcId, 
+			Vars, MaybeModes, Types, _), 
+	extend_foreign_code(HLDS, ProcInfo, Attrs, PredId, ProcId, 
+		Vars, MaybeModes, Types, Info0, Alias0, Alias), 
 	Pool = Pool0, 
 	Goal = Expr0 - Info0. 
 	
Index: sr_indirect.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_indirect.m,v
retrieving revision 1.1.2.21
diff -u -r1.1.2.21 sr_indirect.m
--- sr_indirect.m	2001/03/21 13:19:54	1.1.2.21
+++ sr_indirect.m	2001/03/22 19:46:58
@@ -398,9 +398,11 @@
 	Goal = Expr - Info.
 
 analyse_goal(ProcInfo, HLDS, Expr0 - Info0, Goal, AI0, AI) :-
-	Expr0 = pragma_foreign_code(Attrs, _, _, Vars, MaybeModes, Types, _ ), 
-	pa_alias_as__extend_foreign_code(ProcInfo, HLDS, Info0, Attrs, Vars,
-			MaybeModes, Types, AI0 ^ alias, Alias),
+	Expr0 = pragma_foreign_code(Attrs, PredId, ProcId, 
+					Vars, MaybeModes, Types, _ ), 
+	pa_alias_as__extend_foreign_code(HLDS, ProcInfo, Attrs, 
+			PredId, ProcId, Vars, 
+			MaybeModes, Types, Info0, AI0 ^ alias, Alias),
 	AI = AI0 ^ alias := Alias,
 	Goal = Expr0 - Info0. 
 
@@ -416,228 +418,6 @@
 	AI = AI0 ^ alias := Alias,
 	Goal = Expr0 - Info0. 
 
-:- pred analyse_goal( proc_info, module_info, 
-			hlds_goal, hlds_goal,
-			indirect_reuse_pool, indirect_reuse_pool, 
-			alias_as, alias_as, 
-			sr_fixpoint_table__table, sr_fixpoint_table__table).
-:- mode analyse_goal( in, in, in, out, in, out, in, out, in, out ) 
-			is det.
-
-
-analyse_goal( ProcInfo, HLDS, Expr0 - Info0, Goal, Pool0, Pool, Alias0, Alias, 
-			FP0, FP) :- 
-	Expr0 = conj(Goals0), 
-	list_map_foldl3( analyse_goal(ProcInfo, HLDS),
-			Goals0, Goals, 
-			Pool0, Pool,
-			Alias0, Alias, 
-			FP0, FP),
-	Expr = conj(Goals),
-	Info = Info0,
-	Goal = Expr - Info. 
-
-analyse_goal( ProcInfo, HLDS, Expr0 - Info0, Goal, Pool0, Pool, Alias0, Alias, 
-			FP0, FP) :- 
-	Expr0 = call(PredId, ProcId, ActualVars, _, _, _), 
-	proc_info_vartypes( ProcInfo, VarTypes),
-	list__map( 
-		map__lookup(VarTypes),
-		ActualVars, 
-		ActualTypes),
-	call_verify_reuse( ProcInfo, HLDS,
-		PredId, ProcId, ActualVars, ActualTypes, 
-		Alias0, set__init,
-		Pool0, Pool,
-		Info0, Info, 
-		FP0, FP, _),
-	pa_run__extend_with_call_alias( HLDS, ProcInfo, 
-		PredId, ProcId, ActualVars, ActualTypes, Alias0, Alias),
-	Expr = Expr0, 
-	Goal = Expr - Info.
-
-analyse_goal( _ProcInfo, _HLDS, Expr0 - Info0, Goal, Pool0, Pool, 
-			_Alias0, Alias, 
-			FP0, FP) :- 
-	Expr0 = generic_call(_, _, _, _), 
-	pa_alias_as__top("unhandled goal", Alias), 
-	Pool = Pool0, 
-	FP = FP0,
-	Goal = Expr0 - Info0. 
-	
-	% AAA still to do
-analyse_goal( ProcInfo, HLDS, Expr0 - Info0, Goal, Pool0, Pool, Alias0, Alias, 
-			FP0, FP) :- 
-	Expr0 = switch( A, B, Cases0, SM),
-	list_map3_foldl(
-		analyse_case(ProcInfo, HLDS, 
-				Pool0, Alias0),
-		Cases0, 
-		Cases,
-		ListPools, 
-		ListAliases,
-		FP0, FP),
-	indirect_reuse_pool_least_upper_bound_disjunction( ListPools,
-				Pool),
-	pa_alias_as__least_upper_bound_list(ProcInfo, HLDS, Info0, 
-				ListAliases,
-				Alias1),
-	% reduce the aliases
-	goal_info_get_outscope( Info, Outscope ),
-	pa_alias_as__project_set( Outscope, Alias1, Alias ),
-
-	Info = Info0,
-	Expr = switch( A, B, Cases, SM),
-	Goal = Expr - Info. 
-
-analyse_goal( ProcInfo, HLDS, Expr0 - Info0, Goal, Pool0, Pool, Alias0, Alias, 
-			FP0, FP) :- 
-	Expr0 = unify(_Var, _Rhs, _Mode, Unification, _Context), 
-	Pool = Pool0, 
-	pa_alias_as__extend_unification(ProcInfo, HLDS, 
-			Unification, Info, Alias0, Alias),	
-	Info = Info0,
-	FP = FP0,
-	Expr = Expr0, 
-	Goal = Expr - Info. 
-
-analyse_goal( ProcInfo, HLDS, Expr0 - Info0, Goal, Pool0, Pool, Alias0, Alias, 
-			FP0, FP) :- 
-	Expr0 = disj( Goals0, SM ),
-	(
-		Goals0 = []
-	->
-		Goals = Goals0, 
-		Pool = Pool0,
-		Alias = Alias0,
-		FP = FP0
-	;
-		
-		list_map3_foldl(
-			pred( Gin::in, Gout::out, R::out, A::out, 
-			FPin::in, FPout::out) is det :-
-			(
-			analyse_goal( ProcInfo, HLDS, 
-				Gin, Gout, 
-				Pool0, R, 
-				Alias0, A, 
-				FPin, FPout)
-			),
-			Goals0, 
-			Goals,
-			ListPools, 
-			ListAliases,
-			FP0, FP),
-		indirect_reuse_pool_least_upper_bound_disjunction(
-					ListPools,
-					Pool),
-		pa_alias_as__least_upper_bound_list(ProcInfo, HLDS, Info0, 
-					ListAliases,
-					Alias1),
-		% reduce the aliases
-		goal_info_get_outscope( Info, Outscope ),
-		pa_alias_as__project_set( Outscope, Alias1, Alias )
-	),
-
-	Info = Info0,
-	Expr = disj(Goals, SM),
-	Goal = Expr - Info. 
-
-analyse_goal( ProcInfo, HLDS, Expr0 - Info0, Goal, Pool0, Pool, Alias0, Alias, 
-			FP0, FP) :- 
-	Expr0 = not(NegatedGoal0),
-	analyse_goal(ProcInfo, HLDS, 
-			NegatedGoal0, NegatedGoal, 
-			Pool0, Pool, 
-			Alias0, Alias, 
-			FP0, FP), 
-	Info = Info0, 
-	Expr = not(NegatedGoal),
-	Goal = Expr - Info. 
-
-analyse_goal( ProcInfo, HLDS, Expr0 - Info0, Goal, Pool0, Pool, Alias0, Alias, 
-			FP0, FP) :- 
-	Expr0 = some( A, B, SomeGoal0), 
-	analyse_goal( ProcInfo, HLDS, SomeGoal0, SomeGoal, Pool0, Pool, 
-			Alias0, Alias, FP0, FP), 
-	Info = Info0, 
-	Expr = some( A, B, SomeGoal), 
-	Goal = Expr - Info.
-
-analyse_goal( ProcInfo, HLDS, Expr0 - Info0, Goal, Pool0, Pool, Alias0, Alias, 
-			FP0, FP) :- 
-	Expr0 = if_then_else( Vars, Cond0, Then0, Else0, SM),
-	analyse_goal( ProcInfo, HLDS, Cond0, Cond, 
-			Pool0, PoolCOND, 
-			Alias0,  AliasCOND, 
-			FP0, FP1),
-	analyse_goal( ProcInfo, HLDS, Then0, Then, 
-			PoolCOND, PoolTHEN, 
-			AliasCOND,  AliasTHEN,
-			FP1, FP2 ),
-	analyse_goal( ProcInfo, HLDS, Else0, Else, 
-			Pool0, PoolELSE, 
-			Alias0,  AliasELSE,
-			FP2, FP3 ), 
-	indirect_reuse_pool_least_upper_bound_disjunction( 
-				[PoolTHEN, PoolELSE],
-				Pool),
-
-	pa_alias_as__least_upper_bound_list(ProcInfo, HLDS, Info0, 
-				[AliasTHEN, AliasELSE],
-				Alias1),
-	FP = FP3,
-
-	% reduce the aliases
-	goal_info_get_outscope( Info, Outscope ),
-	pa_alias_as__project_set( Outscope, Alias1, Alias ),
-
-	Info = Info0,
-	Expr = if_then_else( Vars, Cond, Then, Else, SM),
-	Goal = Expr - Info.
-				
-analyse_goal(ProcInfo, HLDS, Expr0 - Info0, Goal, Pool0, Pool, 
-			Alias0, Alias, 
-			FP0, FP) :- 
-	Expr0 = pragma_foreign_code(Attrs, _, _, Vars, MaybeModes, Types, _), 
-	pa_alias_as__extend_foreign_code(ProcInfo, HLDS, Info0, Attrs, Vars, 
-			MaybeModes, Types, Alias0, Alias), 
-	Pool = Pool0, 
-	FP = FP0,
-	Goal = Expr0 - Info0. 
-
-analyse_goal( _ProcInfo, _HLDS, Expr0 - Info0, Goal, Pool0, Pool, 
-			_Alias0, Alias, 
-			FP0, FP) :- 
-	Expr0 = par_conj( _, _), 
-	pa_alias_as__top("unhandled goal", Alias), 
-	Pool = Pool0, 
-	FP = FP0,
-	Goal = Expr0 - Info0. 
-
-analyse_goal( _ProcInfo, _HLDS, Expr0 - Info0, Goal, Pool0, Pool, 
-			_Alias0, Alias, 
-			FP0, FP) :- 
-	Expr0 = bi_implication(_, _), 
-	pa_alias_as__top("unhandled goal", Alias), 
-	Pool = Pool0, 
-	FP = FP0,
-	Goal = Expr0 - Info0. 
-
-:- pred analyse_case( proc_info, module_info, 
-			indirect_reuse_pool, alias_as, 
-			case, case, 
-			indirect_reuse_pool,  alias_as, 
-			sr_fixpoint_table__table, 
-			sr_fixpoint_table__table).
-:- mode analyse_case( in, in, in, in, in, out, out, out, in, out) is det.
-
-analyse_case( ProcInfo, HLDS, Reuses0, Alias0, Case0, Case,
-		Reuses, Alias, FP0, FP ):-
-	Case0 = case(CONS, Goal0),
-	analyse_goal( ProcInfo, HLDS, Goal0, Goal, Reuses0, Reuses, 
-			Alias0, Alias, FP0, FP),
-	Case = case( CONS, Goal).
 
 :- pred call_verify_reuse( proc_info::in, module_info::in,
 		pred_id::in, proc_id::in, list(prog_var)::in,

--------------------------------------------------------------------------
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