[m-dev.] trivial diff: use semisubtract

Simon Taylor stayl at cs.mu.OZ.AU
Sat Aug 14 15:57:15 AEST 1999



Estimated hours taken: 0.5

compiler/rl.m:
	Add `semi' to the list of alternatives for `subtract_type'.

compiler/rl_out.pp:
	Use `rl_PROC_semisubtract_nl' instead of `rl_PROC_subtract_nl'
	because Aditi's definition of `rl_PROC_subtract_nl' has changed
	to match its specification (it now performs a projection on
	its output rather than just returning the left input tuple).
	`semisubtract' implements the old behaviour.

compiler/rl*.m:
	Handle semisubtract.

Index: rl.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/rl.m,v
retrieving revision 1.6
diff -u -u -r1.6 rl.m
--- rl.m	1999/07/13 08:53:27	1.6
+++ rl.m	1999/08/13 04:22:28
@@ -322,6 +322,9 @@
 
 :- type subtract_type
 	--->	nested_loop
+	;	semi		% The output tuple is copied from the
+				% first input tuple. An output projection
+				% must be done as a separate operation.
 	;	sort_merge(sort_spec, sort_spec)
 	;	index(index_spec, key_range)
 	.
Index: rl_dump.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/rl_dump.m,v
retrieving revision 1.3
diff -u -u -r1.3 rl_dump.m
--- rl_dump.m	1999/06/23 04:27:57	1.3
+++ rl_dump.m	1999/08/13 04:24:01
@@ -391,6 +391,8 @@
 
 rl_dump__write_subtract_type(_, nested_loop) -->
 	io__write_string("nested_loop").
+rl_dump__write_subtract_type(_, semi) -->
+	io__write_string("semi").
 rl_dump__write_subtract_type(_, sort_merge(SortAttr1, SortAttr2)) -->
 	io__write_string("sort_merge("),
 	rl_dump__write_sort_spec(SortAttr1),
Index: rl_out.pp
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/rl_out.pp,v
retrieving revision 1.7
diff -u -u -r1.7 rl_out.pp
--- rl_out.pp	1999/07/30 05:14:27	1.7
+++ rl_out.pp	1999/08/13 04:29:46
@@ -631,6 +631,9 @@
 		{ Type = nested_loop },
 		{ SubtractCode = rl_PROC_subtract_nl }
 	;
+		{ Type = semi },
+		{ SubtractCode = rl_PROC_semisubtract_nl }
+	;
 		{ Type = sort_merge(_, _) },
 		{ SubtractCode = rl_PROC_subtract_sm }
 	;
Index: rl_relops.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/rl_relops.m,v
retrieving revision 1.2
diff -u -u -r1.2 rl_relops.m
--- rl_relops.m	1999/04/01 06:03:16	1.2
+++ rl_relops.m	1999/08/13 04:23:38
@@ -351,7 +351,7 @@
 :- pred rl_relops__classify_subtract_condition(list(hlds_goal)::in,
 	subtract_type::out, rl_info::rl_info_di, rl_info::rl_info_uo) is det.
 
-rl_relops__classify_subtract_condition(_, nested_loop) --> [].
+rl_relops__classify_subtract_condition(_, semi) --> [].
 
 rl_relops__difference(OldRel, NewRel, DiffRel, Code) -->
 	rl_info_get_relation_schema(OldRel, Schema),
Index: rl_sort.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/rl_sort.m,v
retrieving revision 1.3
diff -u -u -r1.3 rl_sort.m
--- rl_sort.m	1999/06/24 02:07:19	1.3
+++ rl_sort.m	1999/08/13 05:04:41
@@ -627,6 +627,8 @@
 	( 
 		{ Type = nested_loop }
 	;
+		{ Type = semi }
+	;
 		{ Type = sort_merge(SortSpec1, SortSpec2) },
 		rl_sort__add_relation_sortedness(BlockId, sort(SortSpec1),
 			Input1),
@@ -638,13 +640,13 @@
 			Input2)
 	;
 		{ Type = cross }
-	;
-		{ Type = semi }
 	).
 rl_sort__instr_needed(BlockId,
 		subtract(_Output, Input1, Input2, Type, _Exprn) - _) -->
 	(
 		{ Type = nested_loop }
+	;
+		{ Type = semi }
 	;
 		{ Type = sort_merge(SortSpec1, SortSpec2) },
 		rl_sort__add_relation_sortedness(BlockId, sort(SortSpec1),

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