[m-dev.] diff: check syntax of `some' goals

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Oct 30 01:54:45 AEDT 1998


On 30-Oct-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Report an error if the first argument of a `some' goal
> is not a list of variables.

Oops, I forgot to include the test case.

tests/invalid/Mmakefile:
tests/invalid/some.m:
tests/invalid/some.err_exp:
	Regression test for the above change.

Index: tests/invalid/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/Mmakefile,v
retrieving revision 1.34
diff -u -r1.34 Mmakefile
--- Mmakefile	1998/10/29 09:25:42	1.34
+++ Mmakefile	1998/10/29 14:44:47
@@ -41,6 +41,7 @@
 	prog_io_erroneous.m \
 	qual_basic_test2.m \
 	qualified_cons_id2.m \
+	some.m \
 	spurious_mode_error.m \
 	test_nested.m \
 	type_inf_loop.m \
Index: tests/invalid/some.err_exp
===================================================================
RCS file: some.err_exp
diff -N some.err_exp
--- /dev/null	Fri Oct 30 01:11:13 1998
+++ some.err_exp	Fri Oct 30 01:44:35 1998
@@ -0,0 +1,14 @@
+some.m:006: Error: unrecognized declaration: some junk pred p2(int :: in) is semidet.
+some.m:012: In clause for predicate `some:p1/1':
+some.m:012:   in argument 1 of call to predicate `some/2':
+some.m:012:   error: undefined symbol `junk/0'.
+some.m:012: In clause for predicate `some:p1/1':
+some.m:012:   syntax error in existential quantification: first
+some.m:012:   argument of `some' should be a list of variables.
+some.m:013: In clause for predicate `some:p3/1':
+some.m:013:   in argument 1 of call to predicate `some/2':
+some.m:013:   error: undefined symbol `junk/0'.
+some.m:013: In clause for predicate `some:p3/1':
+some.m:013:   syntax error in existential quantification: first
+some.m:013:   argument of `some' should be a list of variables.
+For more information, try recompiling with `-E'.
Index: tests/invalid/some.m
===================================================================
RCS file: some.m
diff -N some.m
--- /dev/null	Fri Oct 30 01:11:13 1998
+++ some.m	Fri Oct 30 01:43:37 1998
@@ -0,0 +1,14 @@
+:- module (some).
+
+:- interface.
+
+:- pred p1(int::in) is semidet.
+:- some junk pred p2(int::in) is semidet.
+:- pred p3(int::in) is semidet.
+
+:- implementation.
+:- import_module int.
+
+p1(X) :- some junk p3(X).
+p3(X) :- ( some junk X > 0 -> X = 42 ; X = -42 ).
+
-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list