[m-rev.] diff: new test case (disabled)

Mark Brown dougl at cs.mu.OZ.AU
Wed Oct 9 19:24:52 AEST 2002


On 09-Oct-2002, Mark Brown <dougl at cs.mu.OZ.AU> wrote:
> Hi,
> 
> I found another occurrence in the declarative debugger of builtin
> comparison of terms from the debuggee.  Comparing debuggee terms has to
> be avoided because if the terms happen to be higher order the current
> implementation of the runtime will abort, which will kill the whole
> debugging session.  I have in mind a couple of solutions to this problem,
> but I haven't yet decided which approach to take, so for the moment I'll
> just commit the test case but leave it disabled.

And another.  This one is closely related to the previous one.

Estimated hours taken: 0.5
Branches: main

tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/ho4.exp:
tests/debugger/declarative/ho4.inp:
tests/debugger/declarative/ho4.m:
	A new test case similar to 'ho3'.  We don't yet pass this one
	either.

Index: tests/debugger/declarative/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/Mmakefile,v
retrieving revision 1.44
diff -u -r1.44 Mmakefile
--- tests/debugger/declarative/Mmakefile	9 Oct 2002 08:50:02 -0000	1.44
+++ tests/debugger/declarative/Mmakefile	9 Oct 2002 09:17:12 -0000
@@ -51,12 +51,13 @@
 	catch			\
 	untraced_subgoal
 
-# XXX 'ho3' test case fails, due to an attempt to compare higher order
-# terms.  This happens because for missing answer questions the oracle
-# stores the outputs in a set, which relies on builtin comparison.
+# XXX 'ho3' and 'ho4' test cases fail due to an attempt to compare higher
+# order terms.  This happens because for missing answer questions the oracle
+# stores the solutions in a set, which relies on builtin comparison.
 #
 NONWORKING_DECLARATIVE_PROGS=	\
-	ho3
+	ho3			\
+	ho4
 
 ifneq "$(findstring .debug,$(GRADE))" ""
     PROGS_2=$(DECLARATIVE_PROGS)
@@ -167,6 +168,9 @@
 
 ho3.out: ho3 ho3.inp
 	$(MDB) ./ho3 < ho3.inp > ho3.out 2>&1
+
+ho4.out: ho4 ho4.inp
+	$(MDB) ./ho4 < ho4.inp > ho4.out 2>&1
 
 if_then_else.out: if_then_else if_then_else.inp
 	$(MDB) ./if_then_else < if_then_else.inp > if_then_else.out 2>&1
Index: tests/debugger/declarative/ho4.exp
===================================================================
RCS file: tests/debugger/declarative/ho4.exp
diff -N tests/debugger/declarative/ho4.exp
Index: tests/debugger/declarative/ho4.inp
===================================================================
RCS file: tests/debugger/declarative/ho4.inp
diff -N tests/debugger/declarative/ho4.inp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/debugger/declarative/ho4.inp	9 Oct 2002 09:11:51 -0000
@@ -0,0 +1,7 @@
+echo on
+register --quiet
+break p
+continue
+finish
+dd
+no
Index: tests/debugger/declarative/ho4.m
===================================================================
RCS file: tests/debugger/declarative/ho4.m
diff -N tests/debugger/declarative/ho4.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/debugger/declarative/ho4.m	9 Oct 2002 09:09:02 -0000
@@ -0,0 +1,43 @@
+:- module ho4.
+:- interface.
+:- import_module io.
+:- pred main(io__state::di, io__state::uo) is det.
+:- implementation.
+:- import_module list.
+
+main -->
+	{
+		p(1)
+	->
+		S1 = ""
+	;
+		S1 = "\\+ "
+	},
+	{
+		p(2)
+	->
+		S2 = ""
+	;
+		S2 = "\\+ "
+	},
+	io__write_strings([S1, "p(1).\n", S2, "p(2).\n"]).
+
+:- pred p(int).
+:- mode p(in) is semidet.
+
+p(N) :-
+	q(r(5), M),
+	M = N.
+
+:- pred q(pred(int), int).
+:- mode q(pred(out) is multi, out) is multi.
+
+q(R, N) :-
+	R(N).
+
+:- pred r(int, int).
+:- mode r(in, out) is multi.
+
+r(A, A).
+r(_, 0).
+
--------------------------------------------------------------------------
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