[m-rev.] For review: test case for memoed predicates with no outputs

Ralph Becket rafe at csse.unimelb.edu.au
Mon Oct 16 13:32:15 AEST 2006


Zoltan asked me to add this:

Estimated hours taken: 0.5
Branches: main

tests/tabling/Mmakefile:
tests/tabling/no_outputs.m:
tests/tabling/no_outputs.exp:
	Add a new test case for memoization of predicates with no outputs.

Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/tabling/Mmakefile,v
retrieving revision 1.41
diff -u -r1.41 Mmakefile
--- Mmakefile	8 Mar 2006 13:24:39 -0000	1.41
+++ Mmakefile	16 Oct 2006 03:29:45 -0000
@@ -17,6 +17,7 @@
 	fib_string \
 	loopcheck_no_loop \
 	loopcheck_nondet_no_loop \
+	no_outputs \
 	oota \
 	table_foreign_output \
 	test_enum \
Index: no_outputs.exp
===================================================================
RCS file: no_outputs.exp
diff -N no_outputs.exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ no_outputs.exp	1 Sep 2006 02:12:56 -0000
@@ -0,0 +1 @@
+aye
Index: no_outputs.m
===================================================================
RCS file: no_outputs.m
diff -N no_outputs.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ no_outputs.m	1 Sep 2006 02:27:04 -0000
@@ -0,0 +1,45 @@
+%-----------------------------------------------------------------------------%
+% no_outputs.m
+% Ralph Becket <rafe at csse.unimelb.edu.au>
+% Fri Sep  1 12:09:56 EST 2006
+% vim: ft=mercury ts=4 sw=4 et wm=0 tw=0
+%
+% Test memoization of predicates with no outputs.
+%
+%-----------------------------------------------------------------------------%
+
+:- module no_outputs.
+
+:- interface.
+
+:- import_module io.
+
+
+
+:- pred main(io :: di, io :: uo) is det.
+
+%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
+
+:- implementation.
+
+
+main(!IO) :-
+    ( if 
+        p(1, 1),
+        p(2, 2),
+        p(3, 3)
+      then
+        io.write_string("aye\n", !IO)
+      else
+        io.write_string("nay\n", !IO)
+    ).
+
+
+:- pred p(T::in, T::in) is semidet.
+:- pragma memo(p/2, [fast_loose]).
+
+p(X, X).
+
+%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list