[m-rev.] for review: making the decl debugger "smarter"

Mark Brown dougl at cs.mu.OZ.AU
Fri Sep 6 23:08:43 AEST 2002


Estimated hours taken: 16
Branches: main

Make the declarative debugger more flexible with how it interprets
trace event sequences.  This makes the declarative debugger "smarter":
it is now able to handle code that makes use of solutions/2 and its
variants, and it is not confused if it misses some events due to shallow
tracing.  It does, however, ask more questions than it would with full
tracing; this is unavoidable because it doesn't have the information about
backtracking that it would normally use to prune questions away.  (Later
we will be able to get the information we need by using "hidden" events.)

This version should (almost, see the XXX) be able to handle any of the
proposals that have recently been made on mercury-developers mailing list
regarding "interface" tracing.  The requirements on trace event sequences
are:

	1) if there are any events from a certain class (e.g. interface events,
	   negation events, disj events) then we require all events of that
	   class;

	2) if there are any disj events, we require all negation events
	   and if-then-else events.

XXX At the moment, there is another requirement:

	3) the depth limiting part of the code that constructs annotated
	   traces requires that the depths of consecutive events differ
	   by no greater than one.

This limitation shouldn't be difficult to remove, but that will come in
a later change.

browser/declarative_debugger.m:
	Instead of detecting the start of a contour or stratum by looking
	for a particular type of event, get the caller to pass in the
	identity of the event at the start.

	If a fail event is encountered when stepping left on a contour,
	this indicates that some internal events were not seen.  Treat
	the entire failed call (as well as any later conjuncts) as being
	in a negated context; that is, call missing_answer_children on
	this section of the tree, with the start of the "context" being
	the event before the call event corresponding to the fail we
	encountered.

	Similarly, if a neg_fail event is encountered when stepping left
	on a contour don't assume that it must have been backtracked over.
	That assumption is currently valid, but may not be in future
	depending on what we decide to do with hidden events.

tests/debugger/declarative/Mmakefile:
	Enable the tests 'solutions' and 'shallow'.

tests/debugger/declarative/untraced_subgoal.exp:
tests/debugger/declarative/untraced_subgoal.inp:
	Update the input and output of this test to allow for the extra
	questions.

tests/debugger/declarative/untraced_subgoal.m:
	Improve some comments.

tests/debugger/declarative/shallow.exp:
tests/debugger/declarative/shallow.inp:
	Provide correct input and expected output for this test.

tests/debugger/declarative/shallow_2.m:
	Fix some incorrect comments.

tests/debugger/declarative/solutions.exp:
tests/debugger/declarative/solutions.inp:
tests/debugger/declarative/solutions.exp2:
tests/debugger/declarative/solutions.inp2:
	New files.  Provide input and expected output for this test.  We
	need an alternative input file for debug grades because these
	produce interface events for the library predicate solutions/2,
	hence extra questions are generated.

Index: browser/declarative_debugger.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_debugger.m,v
retrieving revision 1.30
diff -u -r1.30 declarative_debugger.m
--- browser/declarative_debugger.m	30 Aug 2002 06:43:51 -0000	1.30
+++ browser/declarative_debugger.m	6 Sep 2002 07:22:06 -0000
@@ -522,15 +522,16 @@
 	(
 		Node = fail(PrecId, CallId, _, _),
 		not_at_depth_limit(Store, CallId),
-		missing_answer_children(Store, PrecId, [], Children)
+		missing_answer_children(Store, PrecId, CallId, [], Children)
 	;
 		Node = exit(PrecId, CallId, _, _, _, _),
 		not_at_depth_limit(Store, CallId),
-		wrong_answer_children(Store, PrecId, [], Children)
+		wrong_answer_children(Store, PrecId, CallId, [], Children)
 	;
 		Node = excp(PrecId, CallId, _, _, _),
 		not_at_depth_limit(Store, CallId),
-		unexpected_exception_children(Store, PrecId, [], Children)
+		unexpected_exception_children(Store, PrecId, CallId, [],
+			Children)
 	).
 
 :- pred not_at_depth_limit(S, R) <= annotated_trace(S, R).
@@ -540,11 +541,24 @@
 	call_node_from_id(Store, Ref, CallNode),
 	CallNode ^ call_at_max_depth = no.
 
-:- pred wrong_answer_children(S, R, list(edt_node(R)), list(edt_node(R)))
+:- pred wrong_answer_children(S, R, R, list(edt_node(R)), list(edt_node(R)))
 		<= annotated_trace(S, R).
-:- mode wrong_answer_children(in, in, in, out) is det.
+:- mode wrong_answer_children(in, in, in, in, out) is det.
 
-wrong_answer_children(Store, NodeId, Ns0, Ns) :-
+wrong_answer_children(Store, NodeId, StartId, Ns0, Ns) :-
+	(
+		NodeId = StartId
+	->
+		Ns = Ns0
+	;
+		wrong_answer_children_2(Store, NodeId, StartId, Ns0, Ns)
+	).
+
+:- pred wrong_answer_children_2(S, R, R, list(edt_node(R)),
+	list(edt_node(R))) <= annotated_trace(S, R).
+:- mode wrong_answer_children_2(in, in, in, in, out) is det.
+
+wrong_answer_children_2(Store, NodeId, StartId, Ns0, Ns) :-
 	det_trace_node_from_id(Store, NodeId, Node),
 	(
 		( Node = call(_, _, _, _, _, _, _, _, _)
@@ -552,49 +566,96 @@
 		; Node = cond(_, _, failed)
 		)
 	->
+		error("wrong_answer_children_2: unexpected start of contour")
+	;
+		Node = excp(_, _, _, _, _)
+	->
+		error("wrong_answer_children_2: exception handling not supported")
+	;
+		Node = exit(_, _, _, _, _, _)
+	->
 			%
-			% We have reached the end of the contour.
+			% Add a child for this node.
 			%
-		Ns = Ns0
+		Ns1 = [dynamic(NodeId) | Ns0]
 	;
-		Node = excp(_, _, _, _, _)
+		Node = fail(_, CallId, _, _)
 	->
-		error("wrong_answer_children: exception handling not supported")
+			%
+			% Fail events can be reached here if there
+			% were events missing due to a parent being
+			% shallow traced.  In this case, we can't tell
+			% whether the call was in a negated context
+			% or backtracked over, so we have to assume
+			% the former.
+			%
+			% Fail events can also be reached here if the
+			% parent was a variant of solutions/2.
+			%
+			% If this really is in a negated context, the start of
+			% the context would be just before the entry to this
+			% failed call, modulo any det/semidet code which
+			% succeeded.
+			%
+		call_node_from_id(Store, CallId, Call),
+		NestedStartId = Call ^ call_preceding,
+		missing_answer_children(Store, NodeId, NestedStartId, Ns0, Ns1)
 	;
-		(
-			Node = exit(_, _, _, _, _, _)
-		->
-				%
-				% Add a child for this node.
-				%
-			Ns1 = [dynamic(NodeId) | Ns0]
-		;
-			( Node = else(Prec, _)
-			; Node = neg_succ(Prec, _)
-			)
-		->
-				%
-				% There is a nested context.
-				%
-			missing_answer_children(Store, Prec, Ns0, Ns1)
-		;
-				%
-				% This handles the following cases:
-				% redo, fail, switch, first_disj, later_disj,
-				% then, and neg_fail.  Also handles cond when
-				% the status is anything other than failed.
-				%
-			Ns1 = Ns0
-		),
-		Next = step_left_in_contour(Store, Node),
-		wrong_answer_children(Store, Next, Ns1, Ns)
-	).
+		Node = neg_fail(Prec, NestedStartId)
+	->
+			%
+			% There is a nested context.  Neg_fail events can be
+			% reached here if there were events missing due to a
+			% parent being shallow traced.  In this case, we can't
+			% tell whether the call was in a negated context or
+			% backtracked over, so we have to assume the former.
+			%
+		wrong_answer_children(Store, Prec, NestedStartId, Ns0, Ns1)
+	;
+		( Node = else(Prec, NestedStartId)
+		; Node = neg_succ(Prec, NestedStartId)
+		)
+	->
+			%
+			% There is a nested context.
+			%
+		missing_answer_children(Store, Prec, NestedStartId, Ns0, Ns1)
+	;
+			%
+			% This handles the following cases:
+			% redo, switch, first_disj, later_disj, and
+			% then.  Also handles cond when the status is
+			% anything other than failed.
+			%
+			% Redo events can be reached here if there
+			% were missing events due to a shallow tracing.
+			% In this case, we have to scan over the entire
+			% previous contour, since there is no way to
+			% tell how much of it was backtracked over.
+			%
+		Ns1 = Ns0
+	),
+	Next = step_left_in_contour(Store, Node),
+	wrong_answer_children(Store, Next, StartId, Ns1, Ns).
 
-:- pred missing_answer_children(S, R, list(edt_node(R)), list(edt_node(R)))
+:- pred missing_answer_children(S, R, R, list(edt_node(R)), list(edt_node(R)))
 		<= annotated_trace(S, R).
-:- mode missing_answer_children(in, in, in, out) is det.
+:- mode missing_answer_children(in, in, in, in, out) is det.
 
-missing_answer_children(Store, NodeId, Ns0, Ns) :-
+missing_answer_children(Store, NodeId, StartId, Ns0, Ns) :-
+	(
+		NodeId = StartId
+	->
+		Ns = Ns0
+	;
+		missing_answer_children_2(Store, NodeId, StartId, Ns0, Ns)
+	).
+
+:- pred missing_answer_children_2(S, R, R, list(edt_node(R)), list(edt_node(R)))
+	<= annotated_trace(S, R).
+:- mode missing_answer_children_2(in, in, in, in, out) is det.
+
+missing_answer_children_2(Store, NodeId, StartId, Ns0, Ns) :-
 	det_trace_node_from_id(Store, NodeId, Node),
 	(
 		( Node = call(_, _, _, _, _, _, _, _, _)
@@ -602,59 +663,66 @@
 		; Node = cond(_, _, failed)
 		)
 	->
+		error("missing_answer_children_2: unexpected start of contour")
+	;
+		Node = excp(_, _, _, _, _)
+	->
+		error("missing_answer_children_2: exception handling not supported")
+	;
+		( Node = exit(_, _, _, _, _, _)
+		; Node = fail(_, _, _, _)
+		)
+	->
 			%
-			% We have reached the boundary of the stratum.
+			% Add a child for this node.
 			%
-		Ns = Ns0
+		Ns1 = [dynamic(NodeId) | Ns0]
 	;
-		Node = excp(_, _, _, _, _)
+		Node = neg_fail(Prec, NestedStartId)
 	->
-		error(
-		    "missing_answer_children: exception handling not supported")
+			%
+			% There is a nested successful context.
+			%
+		wrong_answer_children(Store, Prec, NestedStartId, Ns0, Ns1)
 	;
-		(
-			( Node = exit(_, _, _, _, _, _)
-			; Node = fail(_, _, _, _)
-			)
-		->
-				%
-				% Add a child for this node.
-				%
-			Ns1 = [dynamic(NodeId) | Ns0]
-		;
-			Node = neg_fail(Prec, _)
-		->
-				%
-				% There is a nested successful context.
-				%
-			wrong_answer_children(Store, Prec, Ns0, Ns1)
-		;
-			( Node = else(Prec, _)
-			; Node = neg_succ(Prec, _)
-			)
-		->
-				%
-				% There is a nested failed context.
-				%
-			missing_answer_children(Store, Prec, Ns0, Ns1)
-		;
-				%
-				% This handles the following cases:
-				% redo, switch, first_disj, later_disj and
-				% then.  Also handles cond when the status
-				% is anything other than failed.
-				%
-			Ns1 = Ns0
-		),
-		Next = step_in_stratum(Store, Node),
-		missing_answer_children(Store, Next, Ns1, Ns)
-	).
+		( Node = else(Prec, NestedStartId)
+		; Node = neg_succ(Prec, NestedStartId)
+		)
+	->
+			%
+			% There is a nested failed context.
+			%
+		missing_answer_children(Store, Prec, NestedStartId, Ns0, Ns1)
+	;
+			%
+			% This handles the following cases:
+			% redo, switch, first_disj, later_disj and
+			% then.  Also handles cond when the status
+			% is anything other than failed.
+			%
+		Ns1 = Ns0
+	),
+	Next = step_in_stratum(Store, Node),
+	missing_answer_children(Store, Next, StartId, Ns1, Ns).
 
-:- pred unexpected_exception_children(S, R, list(edt_node(R)),
+:- pred unexpected_exception_children(S, R, R, list(edt_node(R)),
 		list(edt_node(R))) <= annotated_trace(S, R).
-:- mode unexpected_exception_children(in, in, in, out) is det.
+:- mode unexpected_exception_children(in, in, in, in, out) is det.
 
-unexpected_exception_children(Store, NodeId, Ns0, Ns) :-
+unexpected_exception_children(Store, NodeId, StartId, Ns0, Ns) :-
+	(
+		NodeId = StartId
+	->
+		Ns = Ns0
+	;
+		unexpected_exception_children_2(Store, NodeId, StartId, Ns0, Ns)
+	).
+
+:- pred unexpected_exception_children_2(S, R, R, list(edt_node(R)),
+	list(edt_node(R))) <= annotated_trace(S, R).
+:- mode unexpected_exception_children_2(in, in, in, in, out) is det.
+
+unexpected_exception_children_2(Store, NodeId, StartId, Ns0, Ns) :-
 	det_trace_node_from_id(Store, NodeId, Node),
 	(
 		( Node = call(_, _, _, _, _, _, _, _, _)
@@ -662,42 +730,75 @@
 		; Node = cond(_, _, failed)
 		)
 	->
+		error("unexpected_exception_children_2: unexpected start of contour")
+	;
+		( Node = exit(_, _, _, _, _, _)
+		; Node = excp(_, _, _, _, _)
+		)
+	->
 			%
-			% We have reached the end of the contour.
+			% Add a child for this node.
 			%
-		Ns = Ns0
+		Ns1 = [dynamic(NodeId) | Ns0]
 	;
-		(
-			( Node = exit(_, _, _, _, _, _)
-			; Node = excp(_, _, _, _, _)
-			)
-		->
-				%
-				% Add a child for this node.
-				%
-			Ns1 = [dynamic(NodeId) | Ns0]
-		;
-			( Node = else(Prec, _)
-			; Node = neg_succ(Prec, _)
-			)
-		->
-				%
-				% There is a nested context.
-				%
-			missing_answer_children(Store, Prec, Ns0, Ns1)
-		;
-				%
-				% This handles the following cases:
-				% redo, fail, switch, first_disj, later_disj,
-				% then and neg_fail.  Also handles neg and
-				% cond when the status is anything other than
-				% failed.
-				%
-			Ns1 = Ns0
-		),
-		Next = step_left_in_contour(Store, Node),
-		unexpected_exception_children(Store, Next, Ns1, Ns)
-	).
+		Node = fail(_, CallId, _, _)
+	->
+			%
+			% Fail events can be reached here if there
+			% were events missing due to a parent being
+			% shallow traced.  In this case, we can't tell
+			% whether the call was in a negated context
+			% or backtracked over, so we have to assume
+			% the former.
+			%
+			% Fail events can also be reached here if the
+			% parent was a variant of solutions/2.
+			%
+			% If this really is in a negated context, the start of
+			% the context would be just before the entry to this
+			% failed call, modulo any det/semidet code which
+			% succeeded.
+			%
+		call_node_from_id(Store, CallId, Call),
+		NestedStartId = Call ^ call_preceding,
+		missing_answer_children(Store, NodeId, NestedStartId, Ns0, Ns1)
+	;
+		Node = neg_fail(Prec, NestedStartId)
+	->
+			%
+			% There is a nested context.  Neg_fail events can be
+			% reached here if there were events missing due to a
+			% parent being shallow traced.  In this case, we can't
+			% tell whether the call was in a negated context or
+			% backtracked over, so we have to assume the former.
+			%
+		wrong_answer_children(Store, Prec, NestedStartId, Ns0, Ns1)
+	;
+		( Node = else(Prec, NestedStartId)
+		; Node = neg_succ(Prec, NestedStartId)
+		)
+	->
+			%
+			% There is a nested context.
+			%
+		missing_answer_children(Store, Prec, NestedStartId, Ns0, Ns1)
+	;
+			%
+			% This handles the following cases:
+			% redo, switch, first_disj, later_disj, and
+			% then.  Also handles neg and cond when the
+			% status is anything other than failed.
+			%
+			% Redo events can be reached here if there
+			% were missing events due to a shallow tracing.
+			% In this case, we have to scan over the entire
+			% previous contour, since there is no way to
+			% tell how much of it was backtracked over.
+			%
+		Ns1 = Ns0
+	),
+	Next = step_left_in_contour(Store, Node),
+	unexpected_exception_children(Store, Next, StartId, Ns1, Ns).
 
 %-----------------------------------------------------------------------------%
 %
Index: tests/debugger/declarative/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/Mmakefile,v
retrieving revision 1.40
diff -u -r1.40 Mmakefile
--- tests/debugger/declarative/Mmakefile	2 Sep 2002 03:40:20 -0000	1.40
+++ tests/debugger/declarative/Mmakefile	6 Sep 2002 12:13:17 -0000
@@ -31,7 +31,9 @@
 	output_term_dep		\
 	propositional		\
 	queens			\
+	shallow			\
 	small			\
+	solutions		\
 	special_term_dep	\
 	tabled_read_decl	\
 	throw
@@ -41,13 +43,13 @@
 	untraced_subgoal
 
 NONWORKING_DECLARATIVE_PROGS=	\
-	shallow			\
-	solutions
 
 ifneq "$(findstring .debug,$(GRADE))" ""
     PROGS_2=$(DECLARATIVE_PROGS)
+    SOLUTIONS_INP=solutions.inp2
 else
     PROGS_2=$(DECLARATIVE_PROGS) $(NONDEBUG_DECLARATIVE_PROGS)
+    SOLUTIONS_INP=solutions.inp
 endif
 
 # Debugging does not work in MLDS (hl*) and deep profiling (profdeep) grades.
@@ -183,8 +185,8 @@
 small.out: small small.inp
 	$(MDB) ./small < small.inp > small.out 2>&1
 
-solutions.out: solutions solutions.inp
-	$(MDB) ./solutions < solutions.inp > solutions.out 2>&1
+solutions.out: solutions $(SOLUTIONS_INP)
+	$(MDB) ./solutions < $(SOLUTIONS_INP) > solutions.out 2>&1
 
 special_term_dep.out: special_term_dep special_term_dep.inp
 	$(MDB) ./special_term_dep < special_term_dep.inp \
Index: tests/debugger/declarative/shallow.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/shallow.exp,v
retrieving revision 1.1
diff -u -r1.1 shallow.exp
--- tests/debugger/declarative/shallow.exp	29 Aug 2002 16:15:53 -0000	1.1
+++ tests/debugger/declarative/shallow.exp	6 Sep 2002 12:10:46 -0000
@@ -0,0 +1,131 @@
+       1:      1  1 CALL pred shallow:main/2-0 (det) shallow.m:8
+mdb> echo on
+Command echo enabled.
+mdb> register --quiet
+mdb> break shallow__test
+ 0: + stop  interface pred shallow:test/2-0 (det)
+mdb> continue
+       2:      2  2 CALL pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:9)
+mdb> finish
+      15:      2  2 EXIT pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:9)
+mdb> dd
+test(p("t1", 5), 1)
+Valid? no
+p("t1", 5, 1)
+Valid? no
+a("t1", 1, 1)
+Valid? yes
+a("t1", 1, 0)
+Valid? yes
+Call a("t1", 1, _)
+Solutions:
+	a("t1", 1, 1)
+	a("t1", 1, 0)
+Complete? yes
+b("t1", 1, 5)
+Valid? yes
+Found incorrect contour:
+p("t1", 5, 1)
+Is this a bug? yes
+      14:      3  3 EXIT pred shallow_2:p/3-0 (det) shallow_2.m:16 (shallow.m:29)
+mdb> continue
+      15:      2  2 EXIT pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:9)
+mdb> continue
+      16:      6  2 CALL pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:10)
+mdb> finish
+      29:      6  2 EXIT pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:10)
+mdb> dd
+test(p("t2", 37), -11)
+Valid? no
+p("t2", 37, -11)
+Valid? no
+a("t2", 1, 1)
+Valid? yes
+a("t2", 1, 0)
+Valid? yes
+Call a("t2", 1, _)
+Solutions:
+	a("t2", 1, 1)
+	a("t2", 1, 0)
+Complete? yes
+b("t2", 1, 5)
+Valid? yes
+Found incorrect contour:
+p("t2", 37, -11)
+Is this a bug? yes
+      28:      7  3 EXIT pred shallow_2:p/3-0 (det) shallow_2.m:16 (shallow.m:29)
+mdb> continue
+      29:      6  2 EXIT pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:10)
+mdb> continue
+      30:     10  2 CALL pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:11)
+mdb> finish
+      41:     10  2 EXIT pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:11)
+mdb> dd
+test(q("t3", 2), 2)
+Valid? no
+q("t3", 2, 2)
+Valid? no
+a("t3", 2, 2)
+Valid? yes
+a("t3", 2, 0)
+Valid? yes
+Call a("t3", 2, _)
+Solutions:
+	a("t3", 2, 2)
+	a("t3", 2, 0)
+Complete? yes
+Found incorrect contour:
+q("t3", 2, 2)
+Is this a bug? yes
+      40:     11  3 EXIT pred shallow_2:q/3-0 (det) shallow_2.m:30 (shallow.m:29)
+mdb> continue
+      41:     10  2 EXIT pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:11)
+mdb> continue
+      42:     13  2 CALL pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:12)
+mdb> finish
+      48:     13  2 EXIT pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:12)
+mdb> dd
+test(q("t4", -1), 11)
+Valid? no
+q("t4", -1, 11)
+Valid? no
+a("t4", -1, -1)
+Valid? yes
+Found incorrect contour:
+q("t4", -1, 11)
+Is this a bug? yes
+      47:     14  3 EXIT pred shallow_2:q/3-0 (det) shallow_2.m:30 (shallow.m:29)
+mdb> continue
+      48:     13  2 EXIT pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:12)
+mdb> continue
+      49:     16  2 CALL pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:13)
+mdb> finish
+      62:     16  2 EXIT pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:13)
+mdb> dd
+test(r("t5", 3), 23)
+Valid? no
+r("t5", 3, 23)
+Valid? no
+a("t5", 3, 3)
+Valid? yes
+a("t5", 3, 0)
+Valid? yes
+Call a("t5", 3, _)
+Solutions:
+	a("t5", 3, 3)
+	a("t5", 3, 0)
+Complete? yes
+b("t5", 3, 5)
+Valid? yes
+Found incorrect contour:
+r("t5", 3, 23)
+Is this a bug? yes
+      61:     17  3 EXIT pred shallow_2:r/3-0 (det) shallow_2.m:40 (shallow.m:29)
+mdb> continue
+      62:     16  2 EXIT pred shallow:test/2-0 (det) shallow.m:29 (shallow.m:13)
+mdb> continue
+1
+-11
+2
+11
+23
Index: tests/debugger/declarative/shallow.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/shallow.inp,v
retrieving revision 1.1
diff -u -r1.1 shallow.inp
--- tests/debugger/declarative/shallow.inp	29 Aug 2002 16:15:53 -0000	1.1
+++ tests/debugger/declarative/shallow.inp	6 Sep 2002 12:09:55 -0000
@@ -1,43 +1,55 @@
 echo on
 register --quiet
-break test
+break shallow__test
 continue
 finish
 dd
-n
-n
-y
-y
+no
+no
+yes
+yes
+yes
+yes
+yes
 continue
 continue
 finish
 dd
-n
-n
-y
-y
+no
+no
+yes
+yes
+yes
+yes
+yes
 continue
 continue
 finish
 dd
-n
-n
-y
+no
+no
+yes
+yes
+yes
+yes
 continue
 continue
 finish
 dd
-n
-n
-y
-y
+no
+no
+yes
+yes
 continue
 continue
 finish
 dd
-n
-n
-y
-y
+no
+no
+yes
+yes
+yes
+yes
+yes
 continue
 continue
Index: tests/debugger/declarative/shallow_2.m
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/shallow_2.m,v
retrieving revision 1.1
diff -u -r1.1 shallow_2.m
--- tests/debugger/declarative/shallow_2.m	29 Aug 2002 16:15:54 -0000	1.1
+++ tests/debugger/declarative/shallow_2.m	6 Sep 2002 08:37:41 -0000
@@ -24,7 +24,6 @@
 
 q(S, M, N) :-
 	(
-		% Fails:
 		a(S, M, -1)
 	->
 		N = 11
@@ -34,7 +33,6 @@
 
 r(S, M, N) :-
 	(
-		% Succeeds:
 		\+ a(S, M, -3),
 		b(S, M, 5)
 	->
@@ -42,4 +40,15 @@
 	;
 		N = 0
 	).
+
+% shallow_3 defines:
+%
+% :- pred a(string::in, int::in, int::out) is multi.
+%
+% a(_, X, X).
+% a(_, _, 0).
+%
+% :- pred b(string::in, int::in, int::out) is det.
+%
+% b(_, _, 5).
 
Index: tests/debugger/declarative/solutions.exp
===================================================================
RCS file: tests/debugger/declarative/solutions.exp
diff -N tests/debugger/declarative/solutions.exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/debugger/declarative/solutions.exp	6 Sep 2002 08:24:02 -0000
@@ -0,0 +1,30 @@
+       1:      1  1 CALL pred solutions:main/2-0 (det) solutions.m:8
+mdb> echo on
+Command echo enabled.
+mdb> register --quiet
+mdb> break p
+ 0: + stop  interface pred solutions:p/2-0 (det)
+mdb> continue
+       2:      2  2 CALL pred solutions:p/2-0 (det) solutions.m:15 (solutions.m:9)
+mdb> finish
+      15:      2  2 EXIT pred solutions:p/2-0 (det) solutions.m:15 (solutions.m:9)
+mdb> dd
+p(1, [1, 2, 3])
+Valid? no
+q(1, 1)
+Valid? yes
+q(1, 2)
+Valid? yes
+q(1, 3)
+Valid? yes
+Call q(1, _)
+Solutions:
+	q(1, 1)
+	q(1, 2)
+	q(1, 3)
+Complete? yes
+Found incorrect contour:
+p(1, [1, 2, 3])
+Is this a bug? yes
+      15:      2  2 EXIT pred solutions:p/2-0 (det) solutions.m:15 (solutions.m:9)
+mdb> quit -y
Index: tests/debugger/declarative/solutions.exp2
===================================================================
RCS file: tests/debugger/declarative/solutions.exp2
diff -N tests/debugger/declarative/solutions.exp2
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/debugger/declarative/solutions.exp2	6 Sep 2002 12:16:26 -0000
@@ -0,0 +1,32 @@
+       1:      1  1 CALL pred solutions:main/2-0 (det) solutions.m:8
+mdb> echo on
+Command echo enabled.
+mdb> register --quiet
+mdb> break p
+ 0: + stop  interface pred solutions:p/2-0 (det)
+mdb> continue
+       2:      2  2 CALL pred solutions:p/2-0 (det) solutions.m:15 (solutions.m:9)
+mdb> finish
+      17:      2  2 EXIT pred solutions:p/2-0 (det) solutions.m:15 (solutions.m:9)
+mdb> dd
+p(1, [1, 2, 3])
+Valid? no
+solutions(q(1), [1, 2, 3])
+Valid? no
+q(1, 1)
+Valid? yes
+q(1, 2)
+Valid? yes
+q(1, 3)
+Valid? yes
+Call q(1, _)
+Solutions:
+	q(1, 1)
+	q(1, 2)
+	q(1, 3)
+Complete? yes
+Found incorrect contour:
+solutions(q(1), [1, 2, 3])
+Is this a bug? yes
+      16:      3  3 EXIT pred std_util:solutions/2-1 (det) std_util.m:1403 (solutions.m:16)
+mdb> quit -y
Index: tests/debugger/declarative/solutions.inp
===================================================================
RCS file: tests/debugger/declarative/solutions.inp
diff -N tests/debugger/declarative/solutions.inp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/debugger/declarative/solutions.inp	6 Sep 2002 08:23:46 -0000
@@ -0,0 +1,13 @@
+echo on
+register --quiet
+break p
+continue
+finish
+dd
+no
+yes
+yes
+yes
+yes
+yes
+quit -y
Index: tests/debugger/declarative/solutions.inp2
===================================================================
RCS file: tests/debugger/declarative/solutions.inp2
diff -N tests/debugger/declarative/solutions.inp2
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/debugger/declarative/solutions.inp2	6 Sep 2002 12:15:34 -0000
@@ -0,0 +1,14 @@
+echo on
+register --quiet
+break p
+continue
+finish
+dd
+no
+no
+yes
+yes
+yes
+yes
+yes
+quit -y
Index: tests/debugger/declarative/untraced_subgoal.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/untraced_subgoal.exp,v
retrieving revision 1.2
diff -u -r1.2 untraced_subgoal.exp
--- tests/debugger/declarative/untraced_subgoal.exp	18 Aug 2000 10:59:40 -0000	1.2
+++ tests/debugger/declarative/untraced_subgoal.exp	6 Sep 2002 10:01:47 -0000
@@ -43,10 +43,17 @@
 Valid? no
 r(1, 1)
 Valid? yes
-r(2, 2)
-Valid? yes
 s(2)
 Valid? yes
+s(3)
+Valid? yes
+Call s(_)
+Solutions:
+	s(2)
+	s(3)
+Complete? yes
+r(2, 2)
+Valid? yes
 Found incorrect contour:
 p(2, 2)
 Is this a bug? yes
@@ -60,13 +67,6 @@
 Solutions:
 	p(2, 2)
 Complete? no
-s(3)
-Valid? yes
-Call s(_)
-Solutions:
-	s(2)
-	s(3)
-Complete? yes
 Found partially uncovered atom:
 p(2, _)
 Is this a bug? yes
Index: tests/debugger/declarative/untraced_subgoal.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/untraced_subgoal.inp,v
retrieving revision 1.2
diff -u -r1.2 untraced_subgoal.inp
--- tests/debugger/declarative/untraced_subgoal.inp	18 Aug 2000 10:59:40 -0000	1.2
+++ tests/debugger/declarative/untraced_subgoal.inp	6 Sep 2002 10:01:33 -0000
@@ -21,11 +21,11 @@
 yes
 yes
 yes
+yes
+yes
 continue
 finish
 dd
 no
-yes
-yes
 yes
 continue
Index: tests/debugger/declarative/untraced_subgoal.m
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/untraced_subgoal.m,v
retrieving revision 1.1
diff -u -r1.1 untraced_subgoal.m
--- tests/debugger/declarative/untraced_subgoal.m	14 Jul 2000 07:02:10 -0000	1.1
+++ tests/debugger/declarative/untraced_subgoal.m	6 Sep 2002 09:50:10 -0000
@@ -42,3 +42,8 @@
 s(2).
 s(3).
 
+% :- pred q(int::out) is multi.
+%
+% q(1).
+% q(2).
+
--------------------------------------------------------------------------
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