[m-rev.] diff: back out an incorrect change to abstractly_unify_inst_functor

David Overton dmo at cs.mu.OZ.AU
Fri Jul 5 09:28:27 AEST 2002


Estimated hours taken: 0.1
Branches: main

compiler/inst_util.m:
tests/valid/Mmakefile:
tests/valid/any_functor_unify.m:
	Back out a change which permitted unification of variables of
	inst `any' with functors.  Having this feature would require
	support from the code generator which does not exist.  The
	change was originally made in response to a bug report from the
	HAL project, but it turns out that this was actually a bug in
	the HAL compiler -- it is supposed to convert such unifications
	to a predicate call in the generated Mercury code but was not
	doing that.


Index: compiler/inst_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/inst_util.m,v
retrieving revision 1.21
diff -u -r1.21 inst_util.m
--- compiler/inst_util.m	9 May 2002 05:00:53 -0000	1.21
+++ compiler/inst_util.m	4 Jul 2002 23:23:31 -0000
@@ -516,6 +516,8 @@
 :- mode abstractly_unify_inst_functor_2(in, in, in, in, in, in, in,
 			out, out, out) is semidet.
 
+	% XXX need to handle `any' insts
+
 abstractly_unify_inst_functor_2(live, not_reached, _, _, _, _, M,
 			not_reached, erroneous, M).
 
@@ -527,12 +529,6 @@
 	maybe_make_shared_inst_list(Args0, ArgLives, ModuleInfo0,
 			Args, ModuleInfo).
 
-abstractly_unify_inst_functor_2(live, any(Uniq), ConsId, ArgInsts,
-		ArgLives, Real, M0, Inst, Det, M) :-
-	make_any_inst_list_lives(ArgInsts, live, ArgLives, Uniq, Real, M0,
-		AnyArgInsts, Det, M),
-	Inst = bound(Uniq, [functor(ConsId, AnyArgInsts)]).
-
 abstractly_unify_inst_functor_2(live, bound(Uniq, ListX), ConsId, Args,
 			ArgLives, Real, M0, bound(Uniq, List), Det, M) :-
 	abstractly_unify_bound_inst_list_lives(ListX, ConsId, Args, ArgLives,
@@ -554,11 +550,6 @@
 abstractly_unify_inst_functor_2(dead, free, ConsId, Args, _ArgLives, _Real, M,
 			bound(unique, [functor(ConsId, Args)]), det, M).
 
-abstractly_unify_inst_functor_2(dead, any(Uniq), ConsId, ArgInsts,
-		_ArgLives, Real, M0, Inst, Det, M) :-
-	make_any_inst_list(ArgInsts, dead, Uniq, Real, M0, AnyArgInsts, Det, M),
-	Inst = bound(Uniq, [functor(ConsId, AnyArgInsts)]).
-
 abstractly_unify_inst_functor_2(dead, bound(Uniq, ListX), ConsId, Args,
 			_ArgLives, Real, M0, bound(Uniq, List), Det, M) :-
 	ListY = [functor(ConsId, Args)],
@@ -1078,26 +1069,6 @@
 		Inst, Det1, ModuleInfo1),
 	make_any_inst_list(Insts0, Live, Uniq, Real, ModuleInfo1,
 		Insts, Det2, ModuleInfo),
-	det_par_conjunction_detism(Det1, Det2, Det).
-
-:- pred make_any_inst_list_lives(list(inst), is_live, list(is_live),
-			uniqueness, unify_is_real,
-			module_info, list(inst), determinism, module_info).
-:- mode make_any_inst_list_lives(in, in, in, in, in, in, out, out, out)
-				is semidet.
-
-make_any_inst_list_lives([], _, _, _, _, ModuleInfo, [], det, ModuleInfo).
-make_any_inst_list_lives([Inst0 | Insts0], Live, [ArgLive | ArgLives],
-		Uniq, Real, ModuleInfo0, [Inst | Insts], Det, ModuleInfo) :-
-	( Live = live, ArgLive = live ->
-		BothLive = live
-	;
-		BothLive = dead
-	),
-	make_any_inst(Inst0, BothLive, Uniq, Real, ModuleInfo0,
-		Inst, Det1, ModuleInfo1),
-	make_any_inst_list_lives(Insts0, Live, ArgLives, Uniq, Real,
-		ModuleInfo1, Insts, Det2, ModuleInfo),
 	det_par_conjunction_detism(Det1, Det2, Det).
 
 %-----------------------------------------------------------------------------%
Index: tests/valid/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/valid/Mmakefile,v
retrieving revision 1.105
diff -u -r1.105 Mmakefile
--- tests/valid/Mmakefile	1 Jun 2002 13:34:45 -0000	1.105
+++ tests/valid/Mmakefile	4 Jul 2002 23:23:32 -0000
@@ -51,7 +51,6 @@
 	foreign_type_spec.m
 
 OTHER_SOURCES= \
-	any_functor_unify.m \
 	any_inst_merge.m \
 	common_struct_bug.m \
 	compl_unify_bug.m \
Index: tests/valid/any_functor_unify.m
===================================================================
RCS file: tests/valid/any_functor_unify.m
diff -N tests/valid/any_functor_unify.m
--- tests/valid/any_functor_unify.m	9 May 2002 05:00:55 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-:- module any_functor_unify.
-:- interface.
-
-:- type wrap ---> wrap(int).
-:- inst wrap(I) ---> wrap(I).
-
-:- pred p(wrap).
-:- mode p(in(any)) is det.
-
-:- implementation.
-
-p(X) :-
-	X = wrap(_).
-- 
David Overton                   The University of Melbourne  +61 3 8344 9159
dmo at cs.mu.oz.au                 Monash University (Clayton)  +61 3 9905 5779
http://www.cs.mu.oz.au/~dmo     Mobile Phone                 +61 4 0337 4393
--------------------------------------------------------------------------
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