[m-dev.] diff: fix Mercury->Aditi interface for base relations

Simon Taylor stayl at cs.mu.OZ.AU
Mon Feb 21 12:42:13 AEDT 2000



Estimated hours taken: 1

Fix the Mercury->Aditi interface for base relations with input arguments.

compiler/magic.m:
	Make the code match the comments by testing whether
	a base relation has no input arguments before applying
	an optimization for that case.

compiler/dependency_graph.m:
	Don't include base relations in the SCCs computed for
	Aditi code generation -- no code should be generated for
	base relations.

tests/valid/base_relation.m:
	Test case.



Index: compiler/dependency_graph.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/dependency_graph.m,v
retrieving revision 1.44
diff -u -u -r1.44 dependency_graph.m
--- dependency_graph.m	1999/10/25 03:48:43	1.44
+++ dependency_graph.m	2000/02/21 01:36:57
@@ -1,5 +1,5 @@
 %-----------------------------------------------------------------------------%
-% Copyright (C) 1995-1999 The University of Melbourne.
+% Copyright (C) 1995-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.
 %-----------------------------------------------------------------------------%
@@ -603,8 +603,8 @@
 		{ list__member(PredProcId, SCC) },
 		{ PredProcId = proc(PredId, _) },
 		{ module_info_pred_info(ModuleInfo, PredId, PredInfo) },
-		{ pred_info_get_markers(PredInfo, Markers) },
-		{ check_marker(Markers, aditi) }
+		{ hlds_pred__pred_info_is_aditi_relation(PredInfo) },
+		{ \+ hlds_pred__pred_info_is_base_relation(PredInfo) }
 	->
 		aditi_scc_info_add_scc(SCC, SCCs, SCCid),
 		list__foldl(dependency_graph__process_aditi_pred_proc_id(SCCid),
Index: compiler/magic.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/magic.m,v
retrieving revision 1.12
diff -u -u -r1.12 magic.m
--- magic.m	1999/10/28 00:57:03	1.12
+++ magic.m	2000/02/21 01:36:50
@@ -1,5 +1,5 @@
 %-----------------------------------------------------------------------------%
-% Copyright (C) 1998-1999 University of Melbourne.
+% Copyright (C) 1998-2000 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.
 %-----------------------------------------------------------------------------%
@@ -870,7 +870,8 @@
 		magic_info_set_module_info(ModuleInfo),
 		{ JoinPredProcId = AditiPredProcId }
 	;	
-		{ hlds_pred__pred_info_is_base_relation(CPredInfo) }
+		{ hlds_pred__pred_info_is_base_relation(CPredInfo) },
+		{ InputArgModes = [] }
 	->
 		% No join with the input is needed for a base relation
 		% with no input arguments.
Index: tests/valid/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/tests/valid/Mmakefile,v
retrieving revision 1.54
diff -u -u -r1.54 Mmakefile
--- Mmakefile	2000/02/21 00:05:09	1.54
+++ Mmakefile	2000/02/21 01:10:36
@@ -26,6 +26,7 @@
 	instance_unconstrained_tvar.m
 
 OTHER_SOURCES= \
+	base_relation.m \
 	common_struct_bug.m \
 	compl_unify_bug.m \
 	complicated_unify.m \
@@ -181,6 +182,7 @@
 GRADEFLAGS-semi_fail_in_non_ite	= --use-trail
 
 MCFLAGS-aditi_update		= --aditi
+MCFLAGS-base_relation		= --aditi
 MCFLAGS-compl_unify_bug		= -O3
 MCFLAGS-context_anc		= --aditi
 MCFLAGS-deforest_loop		= -O3 --intermodule-optimization
Index: tests/valid/base_relation.m
===================================================================
RCS file: base_relation.m
diff -N base_relation.m
--- /dev/null	Mon Feb 21 12:26:06 2000
+++ base_relation.m	Mon Feb 21 12:24:51 2000
@@ -0,0 +1,12 @@
+:- module base_relation.
+
+:- interface.
+
+:- import_module aditi.
+
+:- pred base(aditi__state, int, int).
+:- mode base(aditi_ui, in, out) is nondet.
+:- mode base(aditi_ui, out, out) is nondet.
+
+:- pragma base_relation(base/3).
+
--------------------------------------------------------------------------
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