[m-rev.] diff: fix clp(r) interface

Julien Fischer juliensf at cs.mu.OZ.AU
Thu Nov 10 11:51:55 AEDT 2005


Estimated hours taken: 1
Branches: main

Fix the CLP(R) interface.

clpr/dump.m:
clpr/samples/fib.m:
clpr/samples/laplace.m:
	Take account of Ralph's recent change to the handling of
	inst `any' variables in negated contexts.

clpr/Mmakefile:
	Remove redundant options.

	Shut up determinism warnings in dump module.

clpr/.cvsignore:
	Ignore various kinds of generated file.

Julien.

Index: .cvsignore
===================================================================
RCS file: /home/mercury1/repository/clpr/.cvsignore,v
retrieving revision 1.1
diff -u -r1.1 .cvsignore
--- .cvsignore	14 Sep 1997 04:10:12 -0000	1.1
+++ .cvsignore	10 Nov 2005 00:00:46 -0000
@@ -1 +1,11 @@
+*.d
 *.c
+*.dv
+*.opt
+*.trans_opt
+*.int*
+*.*date*
+*.dep
+*.mh
+*.err
+*.pic_o
Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/clpr/Mmakefile,v
retrieving revision 1.24
diff -u -r1.24 Mmakefile
--- Mmakefile	3 Mar 2005 04:31:54 -0000	1.24
+++ Mmakefile	10 Nov 2005 00:06:48 -0000
@@ -5,7 +5,6 @@
 #-----------------------------------------------------------------------------#

 # In case the user of the library wants intermodule optimization...
-MCFLAGS += --intermodule-optimization
 MCFLAGS += --trans-intermod-opt

 # We need to use a grade with trailing
@@ -25,6 +24,7 @@
 		$(filter %.tr,$(grade)))

 MCFLAGS-cfloat_lib += --no-warn-nothing-exported
+MCFLAGS-dump=--no-warn-det-decls-too-lax

 # Enable C debugging
 #MGNUCFLAGS = -g
@@ -39,13 +39,13 @@
 C2INITARGS = cfloat.c

 # We need this to use shared libraries on Linux
-MLFLAGS = --mercury-libs shared
+MLFLAGS += --mercury-libs shared

 # This library (cfloat_lib) uses the clpr library in the clpr
 # directory; we need to link that in to avoid undefined symbols
 # when building libcfloat.so.
-MLFLAGS += -Lclpr
-MLLIBS = -lclpr
+EXTRA_MLFLAGS += -Lclpr
+EXTRA_MLLIBS += -lclpr
 libcfloat_lib.so : clpr

 # In case the user doesn't define it, to avoid a warning
Index: dump.m
===================================================================
RCS file: /home/mercury1/repository/clpr/dump.m,v
retrieving revision 1.17
diff -u -r1.17 dump.m
--- dump.m	9 Mar 2005 22:20:51 -0000	1.17
+++ dump.m	9 Nov 2005 23:50:33 -0000
@@ -104,10 +104,10 @@
 	% Unfortunately the standard same_length predicate in list.m
 	% doesn't have this mode...
 	%
-:- pred same_len(list(T1)::list_ca, list(T2)::in) is semidet.
+:- impure pred same_len(list(T1)::list_ca, list(T2)::in) is semidet.

 same_len([], []).
-same_len([_|Xs], [_|Ys]) :- same_len(Xs, Ys).
+same_len([_|Xs], [_|Ys]) :- impure same_len(Xs, Ys).

 	% unsafe_dump(CfloatList, NameList) writes the constraint
 	% relationships between the cfloats in the list CfloatList to
@@ -116,7 +116,7 @@
 	%
 unsafe_dump(Cfloats, Names) :-
 	% Ensure Cfloats and names have the same length
-	( same_len(Cfloats, Names) ->
+	( impure same_len(Cfloats, Names) ->
 			% convert the mercury list of cfloats to a CLP(R)
 			% representation.
 		dump.mercury_cfloat_list_to_clpr_list(Cfloats, CLPRVars),
Index: samples/fib.m
===================================================================
RCS file: /home/mercury1/repository/clpr/samples/fib.m,v
retrieving revision 1.2
diff -u -r1.2 fib.m
--- samples/fib.m	16 Jan 1998 06:56:21 -0000	1.2
+++ samples/fib.m	10 Nov 2005 00:21:36 -0000
@@ -13,7 +13,7 @@
 main -->
 	{ W == 14.0 },
 	(
-		{ fib(W, X) }
+		{ impure fib(W, X) }
 	->
 		io__write_string("Fib(14) = "),
 		{ cfloat__get_val(X, XVal) },
@@ -25,7 +25,7 @@

 	{ Z == 610.0 },
 	(
-		{ fib(Y, Z) }
+		{ impure fib(Y, Z) }
 	->
 		io__write_string("Fib-1(610) = "),
 		{ cfloat__get_val(Y, YVal) },
Index: samples/laplace.m
===================================================================
RCS file: /home/mercury1/repository/clpr/samples/laplace.m,v
retrieving revision 1.3
diff -u -r1.3 laplace.m
--- samples/laplace.m	3 Mar 2005 04:31:54 -0000	1.3
+++ samples/laplace.m	10 Nov 2005 00:22:46 -0000
@@ -115,7 +115,7 @@
 	    % [100, _, _, _, _, _, _, _, _, _, 100],
 	    % [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]

-	( { laplace(X) } ->
+	( { impure laplace(X) } ->
 		io__write_string("\n"),
 		printmat(X)
 	;

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