[m-dev.] for review: improve DD user interface

Mark Anthony BROWN dougl at cs.mu.OZ.AU
Sun Feb 20 17:12:14 AEDT 2000


Hi,

This is for review by anyone.

Cheers,
Mark.

Estimated hours taken: 15

Fix the user interface of the declarative debugger so that it
produces more readable output; the representation of atoms
is updated so that it can handle non-ground arguments.

Ensure that all DD output goes through the correct stream, so that
the debugger works properly under emacs.

browser/declarative_debugger.m:
	Call a procedure in the oracle to handle bug confirmation
	(including printing out the bug), rather than handle
	it directly.

browser/declarative_execution.m:
	Update the trace_atom type so that it can handle both ground
	and free arguments.  Export to C some procedures for
	constructing trace atoms.

browser/declarative_oracle.m:
	Export a procedure which handles bug confirmation.  This calls
	the declarative_user module to do the interaction, and interprets
	the result.

browser/declarative_user.m:
	Export a procedure to handle bug confirmation by the user.
	Update to handle the changes to trace_atom.

trace/mercury_trace_declarative.c:
	Construct trace_atoms by calling the new Mercury procedures
	exported from browser/declarative_execution.m.

trace/mercury_trace_declarative.h:
	Remove the macro that had been used to construct old style atoms.

trace/mercury_trace_vars.{c,h}:
	Export a procedure to calculate the argument position of a
	head variable.

tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/args.{m,inp,exp,exp2}:
	New test case to test mixing bound and free arguments.

tests/debugger/declarative/*.inp:
tests/debugger/declarative/*.exp:
tests/debugger/declarative/*.exp2:
	Update test cases to reflect new output, and the extra question
	asked for bug confirmation.

? tests/debugger/declarative/args.m
? tests/debugger/declarative/args.inp
? tests/debugger/declarative/args.exp
? tests/debugger/declarative/args.exp2
Index: browser/declarative_debugger.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_debugger.m,v
retrieving revision 1.11
diff -u -r1.11 declarative_debugger.m
--- browser/declarative_debugger.m	2000/02/17 06:47:18	1.11
+++ browser/declarative_debugger.m	2000/02/20 05:48:23
@@ -138,15 +138,10 @@
 handle_analyser_response(_, no_suspects, no_bug_found, D, D) -->
 	[].
 
-handle_analyser_response(Store, bug_found(Bug), Response, D, D) -->
-	confirm_bug(Store, Bug, Confirmed),
-	{
-		Confirmed = yes,
-		Response = bug_found
-	;
-		Confirmed = no,
-		Response = no_bug_found
-	}.
+handle_analyser_response(Store, bug_found(Bug), Response, Diagnoser0,
+		Diagnoser) -->
+
+	confirm_bug(Store, Bug, Response, Diagnoser0, Diagnoser).
 
 handle_analyser_response(Store, oracle_queries(Queries), Response,
 		Diagnoser0, Diagnoser) -->
@@ -181,20 +176,33 @@
 handle_oracle_response(_, abort_diagnosis, no_bug_found, D, D) -->
 	io__write_string("Diagnosis aborted.\n").
 
-:- pred confirm_bug(S, decl_bug(edt_node(R)), bool, io__state, io__state)
+:- pred confirm_bug(S, decl_bug(edt_node(R)), diagnoser_response,
+		diagnoser_state(R), diagnoser_state(R), io__state, io__state)
 		<= execution_tree(S, R).
-:- mode confirm_bug(in, in, out, di, uo) is det.
+:- mode confirm_bug(in, in, out, in, out, di, uo) is det.
 
-confirm_bug(Store, e_bug(Node), yes) -->
-	io__write_string("Incorrect node found:\n"),
-	{ edt_root(wrap(Store), Node, Question) },
-	io__write(Question),
-	io__nl.
-confirm_bug(Store, i_bug(Node), yes) -->
-	io__write_string("Inadmissible call:\n"),
+confirm_bug(Store, Bug, Response, Diagnoser0, Diagnoser) -->
+	{
+		Bug = e_bug(Node),
+		Message = "Incorrect node found:\n"
+	;
+		Bug = i_bug(Node),
+		Message = "Inadmissible call node found:\n"
+	},
+	{ diagnoser_get_oracle(Diagnoser0, Oracle0) },
 	{ edt_root(wrap(Store), Node, Question) },
-	io__write(Question),
-	io__nl.
+	oracle_confirm_bug(Message, Question, Confirmation, Oracle0, Oracle),
+	{ diagnoser_set_oracle(Diagnoser0, Oracle, Diagnoser) },
+	{
+		Confirmation = confirm_bug,
+		Response = bug_found
+	;
+		Confirmation = overrule_bug,
+		Response = no_bug_found
+	;
+		Confirmation = abort_diagnosis,
+		Response = no_bug_found
+	}.
 
 	% Export a monomorphic version of diagnosis_state_init/4, to
 	% make it easier to call from C code.
Index: browser/declarative_execution.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_execution.m,v
retrieving revision 1.4
diff -u -r1.4 declarative_execution.m
--- browser/declarative_execution.m	2000/02/17 12:04:15	1.4
+++ browser/declarative_execution.m	2000/02/20 05:48:31
@@ -92,20 +92,16 @@
 		)
 	.
 
-	% If either of the following two types are modified, some of
-	% the macros in trace/mercury_trace_declarative.h may need
-	% to be updated.
-	%
 :- type trace_atom
 	--->	atom(
 			string,			% Procedure name.
-			list(univ)		% Arguments.
-			% XXX we also need to store some information about
-			% where the arguments come from, since they will
-			% not necessarily be in the right order or all
-			% present (we do not store unbound variables).
+			list(maybe(univ))	% Arguments.
 		).
 
+	% If the following two type is modified, some of
+	% the macros in trace/mercury_trace_declarative.h may need
+	% to be updated.
+	%
 :- type goal_status
 	--->	succeeded
 	;	failed
@@ -716,6 +712,21 @@
 	[will_not_call_mercury, thread_safe],
 	"Id = (Word) NULL;"
 ).
+
+
+:- func construct_trace_atom(string, int) = trace_atom.
+:- pragma export(construct_trace_atom(in, in) = out,
+		"MR_DD_construct_trace_atom").
+
+construct_trace_atom(Functor, Arity) = atom(Functor, Args) :-
+	list__duplicate(Arity, no, Args).
+
+:- func add_trace_atom_arg(trace_atom, int, univ) = trace_atom.
+:- pragma export(add_trace_atom_arg(in, in, in) = out,
+		"MR_DD_add_trace_atom_arg").
+
+add_trace_atom_arg(atom(F, Args0), Num, Val) = atom(F, Args) :-
+	list__replace_nth_det(Args0, Num, yes(Val), Args).
 
 %-----------------------------------------------------------------------------%
 
Index: browser/declarative_oracle.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_oracle.m,v
retrieving revision 1.6
diff -u -r1.6 declarative_oracle.m
--- browser/declarative_oracle.m	2000/02/04 03:45:27	1.6
+++ browser/declarative_oracle.m	2000/02/20 05:48:34
@@ -25,15 +25,23 @@
 :- module mdb__declarative_oracle.
 :- interface.
 :- import_module mdb__declarative_debugger.
-:- import_module list, io.
+:- import_module list, io, string.
 
-	% A response that the oracle gives to the caller.
+	% A response that the oracle gives to a query about the
+	% truth of an EDT node.
 	%
 :- type oracle_response
 	--->	oracle_answers(list(decl_answer))
 	;	no_oracle_answers
 	;	abort_diagnosis.
 
+	% A response that the oracle gives when asked to confirm a bug.
+	%
+:- type oracle_confirmation
+	--->	confirm_bug
+	;	overrule_bug
+	;	abort_diagnosis.
+
 	% The oracle state.  This is threaded around the declarative
 	% debugger.
 	%
@@ -54,11 +62,19 @@
 		oracle_state, io__state, io__state).
 :- mode query_oracle(in, out, in, out, di, uo) is det.
 
+	% Confirm that the node found is indeed an e_bug or an i_bug.
+	% The first argument is a message from the caller to be
+	% prefixed to the question.
+	%
+:- pred oracle_confirm_bug(string, decl_question, oracle_confirmation,
+		oracle_state, oracle_state, io__state, io__state).
+:- mode oracle_confirm_bug(in, in, out, in, out, di, uo) is det.
+
 %-----------------------------------------------------------------------------%
 
 :- implementation.
 :- import_module mdb__declarative_user, mdb__util.
-:- import_module bool, std_util, map, set.
+:- import_module bool, std_util, map, set, require.
 
 query_oracle(Queries, Response, Oracle0, Oracle) -->
 	{ get_oracle_kb(Oracle0, KB0) },
@@ -87,6 +103,26 @@
 		{ Response = oracle_answers(Answers) },
 		{ Oracle = Oracle0 }
 	).
+
+oracle_confirm_bug(Message, Question, Confirmation, Oracle0, Oracle) -->
+	{ get_oracle_user(Oracle0, User0) },
+	user_confirm_bug(Message, Question, UserResponse, User0, User),
+	{ set_oracle_user(Oracle0, User, Oracle) },
+	{
+		UserResponse = user_answer(_ - yes),
+		Confirmation = confirm_bug
+	;
+		UserResponse = user_answer(_ - no),
+		Confirmation = overrule_bug
+	;
+		UserResponse = no_user_answer,
+		error("oracle_confirm_bug: no user answer")
+	;
+		UserResponse = abort_diagnosis,
+		Confirmation = abort_diagnosis
+	}.
+
+%-----------------------------------------------------------------------------%
 		
 :- type oracle_state
 	--->	oracle(
Index: browser/declarative_user.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_user.m,v
retrieving revision 1.4
diff -u -r1.4 declarative_user.m
--- browser/declarative_user.m	2000/02/04 03:45:28	1.4
+++ browser/declarative_user.m	2000/02/20 05:48:37
@@ -15,7 +15,7 @@
 :- module mdb__declarative_user.
 :- interface.
 :- import_module mdb__declarative_debugger.
-:- import_module list, io.
+:- import_module list, io, string.
 
 :- type user_response
 	--->	user_answer(decl_answer)
@@ -36,9 +36,11 @@
 		io__state, io__state).
 :- mode query_user(in, out, in, out, di, uo) is det.
 
-% :- pred confirm_user(list(decl_answer), user_response, user_state, user_state,
-%		io__state, io__state).
-% :- mode confirm_user(in, out, in, out, di, uo) is det.
+	% Confirm that the node found is indeed an e_bug or an i_bug.
+	%
+:- pred user_confirm_bug(string, decl_question, user_response, user_state,
+		user_state, io__state, io__state).
+:- mode user_confirm_bug(in, in, out, in, out, di, uo) is det.
 
 %-----------------------------------------------------------------------------%
 
@@ -127,7 +129,6 @@
 reverse_and_append([A | As], Bs, Cs) :-
 	reverse_and_append(As, [A | Bs], Cs).
 
-
 %-----------------------------------------------------------------------------%
 
 :- type user_command
@@ -158,12 +159,26 @@
 		"\th, ?\thelp\t\tthis help message\n"
 	]).
 
+:- pred user_confirm_bug_help(user_state, io__state, io__state).
+:- mode user_confirm_bug_help(in, di, uo) is det.
+
+user_confirm_bug_help(user(_, OutStr)) -->
+	io__write_strings(OutStr, [
+		"Answer one of:\n",
+		"\ty\tyes\t\tconfirm that the suspect is a bug\n",
+		"\tn\tno\t\tdo not accept that the suspect is a bug\n",
+%		"\tb\tbrowse\t\tbrowse the suspect\n",
+		"\ta\tabort\t\tabort this diagnosis session\n",
+		"\th, ?\thelp\t\tthis help message\n"
+	]).
+
 :- pred get_command(string, user_command, user_state, user_state,
 		io__state, io__state).
 :- mode get_command(in, out, in, out, di, uo) is det.
 
 get_command(Prompt, Command, User, User) -->
-	util__trace_getline(Prompt, Result),
+	{ User = user(InStr, OutStr) },
+	util__trace_getline(Prompt, Result, InStr, OutStr),
 	( { Result = ok(String) },
 		{ string__to_char_list(String, Line) },
 		{
@@ -175,14 +190,13 @@
 		}
 	; { Result = error(Error) },
 		{ io__error_message(Error, Msg) },
-		io__write_string(Msg),
-		io__nl,
+		io__write_string(OutStr, Msg),
+		io__nl(OutStr),
 		{ Command = abort }
 	; { Result = eof },
 		{ Command = abort }
 	).
 
-
 :- pred command_chars(list(char), user_command).
 :- mode command_chars(in, out) is semidet.
 
@@ -198,6 +212,38 @@
 
 %-----------------------------------------------------------------------------%
 
+user_confirm_bug(Message, Question, Response, User0, User) -->
+	{ User0 = user(_, OutStr) },
+	io__write_string(OutStr, Message),
+	write_decl_question(Question, User0),
+	get_command("Is this a bug? ", Command, User0, User1),
+	(
+		{ Command = yes }
+	->
+		{ Response = user_answer(Question - yes) },
+		{ User = User1 }
+	;
+		{ Command = no }
+	->
+		{ Response = user_answer(Question - no) },
+		{ User = User1 }
+	;
+		{ Command = abort }
+	->
+		{ Response = abort_diagnosis },
+		{ User = User1 }
+	;
+		{ Command = browse }
+	->
+		browse_edt_node(Question, User1, User2),
+		user_confirm_bug(Message, Question, Response, User2, User)
+	;
+		user_confirm_bug_help(User1),
+		user_confirm_bug(Message, Question, Response, User1, User)
+	).
+
+%-----------------------------------------------------------------------------%
+
 	% Display the node in user readable form on the current
 	% output stream.
 	%
@@ -211,19 +257,55 @@
 write_decl_question(missing_answer(Call, Solns), User) -->
 	{ User = user(_, OutStr) },
 	write_decl_atom(OutStr, "Call ", Call),
-	io__write_string(OutStr, "Solutions:\n"),
-	list__foldl(write_decl_atom(OutStr, "\t"), Solns).
+	(
+		{ Solns = [] }
+	->
+		io__write_string(OutStr, "No solutions.\n")
+	;
+		io__write_string(OutStr, "Solutions:\n"),
+		list__foldl(write_decl_atom(OutStr, "\t"), Solns)
+	).
 
 :- pred write_decl_atom(io__output_stream, string, decl_atom,
 		io__state, io__state).
 :- mode write_decl_atom(in, in, in, di, uo) is det.
 
-write_decl_atom(OutStr, Indent, Atom) -->
+write_decl_atom(OutStr, Indent, atom(Functor, Args)) -->
 	io__write_string(OutStr, Indent),
 
-		% XXX this looks horrible, but works for now.  We should
-		% call the browser to print this.
+		% XXX We should call the browser to print this.  But
+		% that can wait until the browser has more flexible
+		% term display facilities.
 		%
-	io__write(OutStr, Atom),
-	io__nl.
+	io__write_string(OutStr, Functor),
+	(
+		{ Args = [] }
+	;
+		{ Args = [Arg | Args0] },
+		io__write_char(OutStr, '('),
+		write_decl_atom_arg(OutStr, Arg),
+		write_decl_atom_args(OutStr, Args0),
+		io__write_char(OutStr, ')')
+	),
+	io__nl(OutStr).
+
+:- pred write_decl_atom_args(io__output_stream, list(maybe(univ)),
+		io__state, io__state).
+:- mode write_decl_atom_args(in, in, di, uo) is det.
+
+write_decl_atom_args(_, []) -->
+	[].
+write_decl_atom_args(OutStr, [Arg | Args]) -->
+	io__write_string(OutStr, ", "),
+	write_decl_atom_arg(OutStr, Arg),
+	write_decl_atom_args(OutStr, Args).
+
+:- pred write_decl_atom_arg(io__output_stream, maybe(univ),
+		io__state, io__state).
+:- mode write_decl_atom_arg(in, in, di, uo) is det.
+
+write_decl_atom_arg(OutStr, yes(Arg)) -->
+	io__print(OutStr, Arg).
+write_decl_atom_arg(OutStr, no) -->
+	io__write_char(OutStr, '_').
 
Index: tests/debugger/declarative/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/Mmakefile,v
retrieving revision 1.11
diff -u -r1.11 Mmakefile
--- tests/debugger/declarative/Mmakefile	2000/02/17 06:47:45	1.11
+++ tests/debugger/declarative/Mmakefile	2000/02/20 05:48:46
@@ -19,6 +19,7 @@
 DECLARATIVE_PROGS=		\
 	aadebug			\
 	app			\
+	args			\
 	backtrack		\
 	big			\
 	gcf			\
@@ -74,6 +75,9 @@
 
 app.out: app app.inp
 	$(MDB) ./app < app.inp > app.out 2>&1
+
+args.out: args args.inp
+	$(MDB) ./args < args.inp > args.out 2>&1
 
 backtrack.out: backtrack backtrack.inp
 	$(MDB) ./backtrack < backtrack.inp > backtrack.out 2>&1
Index: tests/debugger/declarative/aadebug.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/aadebug.exp,v
retrieving revision 1.2
diff -u -r1.2 aadebug.exp
--- tests/debugger/declarative/aadebug.exp	2000/02/17 06:47:46	1.2
+++ tests/debugger/declarative/aadebug.exp	2000/02/20 05:48:47
@@ -9,63 +9,71 @@
 mdb> finish
       15:      2  2 EXIT pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> dd
-atom("p", [univ('a' : character), univ(30 : int)])
+p('a', 30)
 Valid? no
-atom("q", [univ('a' : character), univ('a' : character)])
+q('a', 'a')
 Valid? yes
-atom("r", [univ('a' : character), univ(10 : int)])
+r('a', 10)
 Valid? yes
-atom("s", [univ(10 : int), univ(30 : int)])
+s(10, 30)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ('a' : character), univ(30 : int)]))
+p('a', 30)
+Is this a bug? yes
       15:      2  2 EXIT pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> continue
       18:      2  2 REDO pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> finish
       20:      2  2 EXIT pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> dd
-atom("p", [univ('a' : character), univ(31 : int)])
+p('a', 31)
 Valid? no
 Incorrect node found:
-wrong_answer(atom("p", [univ('a' : character), univ(31 : int)]))
+p('a', 31)
+Is this a bug? yes
       20:      2  2 EXIT pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> continue
       23:      2  2 REDO pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> finish
       35:      2  2 EXIT pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> dd
-atom("p", [univ('a' : character), univ(32 : int)])
+p('a', 32)
 Valid? no
-atom("q", [univ('a' : character), univ('b' : character)])
+q('a', 'b')
 Valid? yes
-Call atom("r", [univ('b' : character)])
-Solutions:
+Call r('b', _)
+No solutions.
 Complete? yes
-Call atom("q", [univ('b' : character)])
-Solutions:
+Call q('b', _)
+No solutions.
 Complete? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ('a' : character), univ(32 : int)]))
+p('a', 32)
+Is this a bug? yes
       35:      2  2 EXIT pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> continue
       38:      2  2 REDO pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> finish
       41:      2  2 FAIL pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> dd
-Call atom("p", [univ('a' : character)])
+Call p('a', _)
 Solutions:
-	atom("p", [univ('a' : character), univ(30 : int)])
-	atom("p", [univ('a' : character), univ(31 : int)])
-	atom("p", [univ('a' : character), univ(32 : int)])
+	p('a', 30)
+	p('a', 31)
+	p('a', 32)
 Complete? no
-Call atom("q", [univ('a' : character)])
+Call q('a', _)
 Solutions:
-	atom("q", [univ('a' : character), univ('a' : character)])
-	atom("q", [univ('a' : character), univ('b' : character)])
+	q('a', 'a')
+	q('a', 'b')
 Complete? yes
 Incorrect node found:
-missing_answer(atom("p", [univ('a' : character)]), [atom("p", [univ('a' : character), univ(30 : int)]), atom("p", [univ('a' : character), univ(31 : int)]), atom("p", [univ('a' : character), univ(32 : int)])])
+Call p('a', _)
+Solutions:
+	p('a', 30)
+	p('a', 31)
+	p('a', 32)
+Is this a bug? yes
       41:      2  2 FAIL pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> continue
 no
Index: tests/debugger/declarative/aadebug.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/aadebug.exp2,v
retrieving revision 1.1
diff -u -r1.1 aadebug.exp2
--- tests/debugger/declarative/aadebug.exp2	2000/02/17 06:47:46	1.1
+++ tests/debugger/declarative/aadebug.exp2	2000/02/20 05:48:47
@@ -9,63 +9,71 @@
 mdb> finish
       15:      2  2 EXIT pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> dd
-atom("p", [univ('a' : character), univ(30 : int)])
+p('a', 30)
 Valid? no
-atom("q", [univ('a' : character), univ('a' : character)])
+q('a', 'a')
 Valid? yes
-atom("r", [univ('a' : character), univ(10 : int)])
+r('a', 10)
 Valid? yes
-atom("s", [univ(10 : int), univ(30 : int)])
+s(10, 30)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ('a' : character), univ(30 : int)]))
+p('a', 30)
+Is this a bug? yes
       15:      2  2 EXIT pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> continue
       20:      2  2 REDO pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> finish
       22:      2  2 EXIT pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> dd
-atom("p", [univ('a' : character), univ(31 : int)])
+p('a', 31)
 Valid? no
 Incorrect node found:
-wrong_answer(atom("p", [univ('a' : character), univ(31 : int)]))
+p('a', 31)
+Is this a bug? yes
       22:      2  2 EXIT pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> continue
       27:      2  2 REDO pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> finish
       39:      2  2 EXIT pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> dd
-atom("p", [univ('a' : character), univ(32 : int)])
+p('a', 32)
 Valid? no
-atom("q", [univ('a' : character), univ('b' : character)])
+q('a', 'b')
 Valid? yes
-Call atom("r", [univ('b' : character)])
-Solutions:
+Call r('b', _)
+No solutions.
 Complete? yes
-Call atom("q", [univ('b' : character)])
-Solutions:
+Call q('b', _)
+No solutions.
 Complete? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ('a' : character), univ(32 : int)]))
+p('a', 32)
+Is this a bug? yes
       39:      2  2 EXIT pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> continue
       44:      2  2 REDO pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> finish
       47:      2  2 FAIL pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> dd
-Call atom("p", [univ('a' : character)])
+Call p('a', _)
 Solutions:
-	atom("p", [univ('a' : character), univ(30 : int)])
-	atom("p", [univ('a' : character), univ(31 : int)])
-	atom("p", [univ('a' : character), univ(32 : int)])
+	p('a', 30)
+	p('a', 31)
+	p('a', 32)
 Complete? no
-Call atom("q", [univ('a' : character)])
+Call q('a', _)
 Solutions:
-	atom("q", [univ('a' : character), univ('a' : character)])
-	atom("q", [univ('a' : character), univ('b' : character)])
+	q('a', 'a')
+	q('a', 'b')
 Complete? yes
 Incorrect node found:
-missing_answer(atom("p", [univ('a' : character)]), [atom("p", [univ('a' : character), univ(30 : int)]), atom("p", [univ('a' : character), univ(31 : int)]), atom("p", [univ('a' : character), univ(32 : int)])])
+Call p('a', _)
+Solutions:
+	p('a', 30)
+	p('a', 31)
+	p('a', 32)
+Is this a bug? yes
       47:      2  2 FAIL pred aadebug:p/2-0 (nondet) aadebug.m:24 (aadebug.m:9)
 mdb> continue
 no
Index: tests/debugger/declarative/aadebug.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/aadebug.inp,v
retrieving revision 1.2
diff -u -r1.2 aadebug.inp
--- tests/debugger/declarative/aadebug.inp	2000/02/17 06:47:47	1.2
+++ tests/debugger/declarative/aadebug.inp	2000/02/20 05:48:47
@@ -8,10 +8,12 @@
 yes
 yes
 yes
+yes
 continue
 finish
 dd
 no
+yes
 continue
 finish
 dd
@@ -19,10 +21,12 @@
 yes
 yes
 yes
+yes
 continue
 finish
 dd
 no
+yes
 yes
 continue
 
Index: tests/debugger/declarative/app.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/app.exp,v
retrieving revision 1.4
diff -u -r1.4 app.exp
--- tests/debugger/declarative/app.exp	2000/01/21 02:44:28	1.4
+++ tests/debugger/declarative/app.exp	2000/02/20 05:48:48
@@ -15,7 +15,7 @@
 mdb> finish -n
       16:      5  5 EXIT pred app:app/3-0 (det) app.m:26 (app.m:28)
 mdb> dd
-atom("app", [univ([4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([4, 5], [6, 7, 8], [4, 5, 6, 7, 8])
 Valid? yes
       16:      5  5 EXIT pred app:app/3-0 (det) app.m:26 (app.m:28)
 mdb> continue
@@ -25,14 +25,15 @@
 mdb> continue
       19:      2  2 EXIT pred app:app/3-0 (det) app.m:26 (app.m:13)
 mdb> dd
-atom("app", [univ([1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([1, 2, 3, 4, 5], [6, 7, 8], [1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([2, 3, 4, 5], [6, 7, 8], [2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([3, 4, 5], [6, 7, 8], [3, 4, 5, 6, 7, 8])
 Valid? no
 Incorrect node found:
-wrong_answer(atom("app", [univ([3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))]))
+app([3, 4, 5], [6, 7, 8], [3, 4, 5, 6, 7, 8])
+Is this a bug? yes
       19:      2  2 EXIT pred app:app/3-0 (det) app.m:26 (app.m:13)
 mdb> continue
 append([1, 2, 3, 4, 5], [6, 7, 8], [1, 2, 3, 4, 5, 6, 7, 8]).
@@ -40,28 +41,29 @@
 mdb> finish -n
       67:      8  2 EXIT pred app:app/3-0 (det) app.m:26 (app.m:18)
 mdb> dd
-atom("app", [univ([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([6, 7, 8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([6, 7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([7, 8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([0, 1, 2, 3, 4, 5], [6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
 Incorrect node found:
-wrong_answer(atom("app", [univ([3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))]))
+app([3, 4, 5], [6, 7, 8], [3, 4, 5, 6, 7, 8])
+Is this a bug? yes
       67:      8  2 EXIT pred app:app/3-0 (det) app.m:26 (app.m:18)
 mdb> continue
 append([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8]).
Index: tests/debugger/declarative/app.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/app.exp2,v
retrieving revision 1.4
diff -u -r1.4 app.exp2
--- tests/debugger/declarative/app.exp2	2000/02/17 12:04:29	1.4
+++ tests/debugger/declarative/app.exp2	2000/02/20 05:48:49
@@ -15,7 +15,7 @@
 mdb> finish -n
       16:      5  5 EXIT pred app:app/3-0 (det) app.m:26 (app.m:28)
 mdb> dd
-atom("app", [univ([4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([4, 5], [6, 7, 8], [4, 5, 6, 7, 8])
 Valid? yes
       16:      5  5 EXIT pred app:app/3-0 (det) app.m:26 (app.m:28)
 mdb> continue
@@ -25,43 +25,45 @@
 mdb> continue
       19:      2  2 EXIT pred app:app/3-0 (det) app.m:26 (app.m:13)
 mdb> dd
-atom("app", [univ([1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([1, 2, 3, 4, 5], [6, 7, 8], [1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([2, 3, 4, 5], [6, 7, 8], [2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([3, 4, 5], [6, 7, 8], [3, 4, 5, 6, 7, 8])
 Valid? no
 Incorrect node found:
-wrong_answer(atom("app", [univ([3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))]))
+app([3, 4, 5], [6, 7, 8], [3, 4, 5, 6, 7, 8])
+Is this a bug? yes
       19:      2  2 EXIT pred app:app/3-0 (det) app.m:26 (app.m:13)
 mdb> continue
 append([1, 2, 3, 4, 5], [6, 7, 8], [1, 2, 3, 4, 5, 6, 7, 8]).
-      24:    443  2 CALL pred app:app/3-0 (det) app.m:26 (app.m:18)
+      24:    584  2 CALL pred app:app/3-0 (det) app.m:26 (app.m:18)
 mdb> finish -n
-      71:    443  2 EXIT pred app:app/3-0 (det) app.m:26 (app.m:18)
+      71:    584  2 EXIT pred app:app/3-0 (det) app.m:26 (app.m:18)
 mdb> dd
-atom("app", [univ([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([6, 7, 8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([6, 7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([7, 8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([8, 9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([9, 0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([9, 0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
-atom("app", [univ([0, 1, 2, 3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([0, 1, 2, 3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))])
+app([0, 1, 2, 3, 4, 5], [6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8])
 Valid? no
 Incorrect node found:
-wrong_answer(atom("app", [univ([3, 4, 5] : list:list(int)), univ([6, 7, 8] : list:list(int)), univ([3, 4, 5, 6, 7, 8] : list:list(int)), univ(int : private_builtin:type_info(int))]))
-      71:    443  2 EXIT pred app:app/3-0 (det) app.m:26 (app.m:18)
+app([3, 4, 5], [6, 7, 8], [3, 4, 5, 6, 7, 8])
+Is this a bug? yes
+      71:    584  2 EXIT pred app:app/3-0 (det) app.m:26 (app.m:18)
 mdb> continue
 append([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5], [6, 7, 8], [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8]).
Index: tests/debugger/declarative/app.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/app.inp,v
retrieving revision 1.3
diff -u -r1.3 app.inp
--- tests/debugger/declarative/app.inp	2000/01/21 02:44:28	1.3
+++ tests/debugger/declarative/app.inp	2000/02/20 05:48:49
@@ -15,6 +15,7 @@
 no
 no
 no
+yes
 continue
 finish -n
 dd
@@ -28,5 +29,6 @@
 no
 no
 no
+yes
 continue
 
Index: tests/debugger/declarative/backtrack.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/backtrack.exp,v
retrieving revision 1.1
diff -u -r1.1 backtrack.exp
--- tests/debugger/declarative/backtrack.exp	2000/02/17 06:47:48	1.1
+++ tests/debugger/declarative/backtrack.exp	2000/02/20 05:48:49
@@ -9,22 +9,23 @@
 mdb> finish
       17:      2  2 EXIT pred backtrack:p/2-0 (det) backtrack.m:23 (backtrack.m:9)
 mdb> dd
-atom("p", [univ(1 : int), univ(no : bool:bool)])
+p(1, no)
 Valid? no
-atom("q", [univ(1 : int), univ(1 : int)])
+q(1, 1)
 Valid? yes
-atom("q", [univ(1 : int), univ(2 : int)])
+q(1, 2)
 Valid? yes
-atom("q", [univ(1 : int), univ(3 : int)])
+q(1, 3)
 Valid? yes
-Call atom("q", [univ(1 : int)])
+Call q(1, _)
 Solutions:
-	atom("q", [univ(1 : int), univ(1 : int)])
-	atom("q", [univ(1 : int), univ(2 : int)])
-	atom("q", [univ(1 : int), univ(3 : int)])
+	q(1, 1)
+	q(1, 2)
+	q(1, 3)
 Complete? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(1 : int), univ(no : bool:bool)]))
+p(1, no)
+Is this a bug? yes
       17:      2  2 EXIT pred backtrack:p/2-0 (det) backtrack.m:23 (backtrack.m:9)
 mdb> continue
 no
Index: tests/debugger/declarative/backtrack.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/backtrack.inp,v
retrieving revision 1.1
diff -u -r1.1 backtrack.inp
--- tests/debugger/declarative/backtrack.inp	2000/02/17 06:47:48	1.1
+++ tests/debugger/declarative/backtrack.inp	2000/02/20 05:48:49
@@ -9,4 +9,5 @@
 yes
 yes
 yes
+yes
 continue
Index: tests/debugger/declarative/big.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/big.exp,v
retrieving revision 1.2
diff -u -r1.2 big.exp
--- tests/debugger/declarative/big.exp	2000/01/21 02:44:28	1.2
+++ tests/debugger/declarative/big.exp	2000/02/20 05:48:50
@@ -9,143 +9,155 @@
 mdb> finish
       26:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> dd
-atom("p", [univ(-12 : int)])
+p(-12)
 Valid? no
-atom("a", [univ(0 : int)])
+a(0)
 Valid? yes
-atom("b", [univ(0 : int), univ(0 : int)])
+b(0, 0)
 Valid? yes
-atom("c", [univ(0 : int), univ(2 : int)])
+c(0, 2)
 Valid? yes
-Call atom("d", [univ(2 : int)])
-Solutions:
+Call d(2, _)
+No solutions.
 Complete? yes
-atom("c", [univ(2 : int), univ(6 : int)])
+c(2, 6)
 Valid? yes
-atom("f", [univ(6 : int), univ(-12 : int)])
+f(6, -12)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(-12 : int)]))
+p(-12)
+Is this a bug? yes
       26:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> continue
       27:      2  2 REDO pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> finish
       33:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> dd
-atom("p", [univ(-14 : int)])
+p(-14)
 Valid? no
-atom("c", [univ(2 : int), univ(7 : int)])
+c(2, 7)
 Valid? yes
-atom("f", [univ(7 : int), univ(-14 : int)])
+f(7, -14)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(-14 : int)]))
+p(-14)
+Is this a bug? yes
       33:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> continue
       34:      2  2 REDO pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> finish
       65:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> dd
-atom("p", [univ(-20 : int)])
+p(-20)
 Valid? no
-atom("b", [univ(0 : int), univ(1 : int)])
+b(0, 1)
 Valid? yes
-atom("c", [univ(1 : int), univ(15 : int)])
+c(1, 15)
 Valid? yes
-atom("d", [univ(15 : int), univ(45 : int)])
+d(15, 45)
 Valid? yes
-Call atom("c", [univ(1 : int)])
+Call c(1, _)
 Solutions:
-	atom("c", [univ(1 : int), univ(15 : int)])
+	c(1, 15)
 Complete? yes
-atom("e", [univ(1 : int), univ(10 : int)])
+e(1, 10)
 Valid? yes
-atom("f", [univ(10 : int), univ(-20 : int)])
+f(10, -20)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(-20 : int)]))
+p(-20)
+Is this a bug? yes
       65:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> continue
       66:      2  2 REDO pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> finish
       72:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> dd
-atom("p", [univ(-22 : int)])
+p(-22)
 Valid? no
-atom("e", [univ(1 : int), univ(11 : int)])
+e(1, 11)
 Valid? yes
-atom("f", [univ(11 : int), univ(-22 : int)])
+f(11, -22)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(-22 : int)]))
+p(-22)
+Is this a bug? yes
       72:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> continue
       73:      2  2 REDO pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> finish
      109:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> dd
-atom("p", [univ(2 : int)])
+p(2)
 Valid? no
-atom("f", [univ(0 : int), univ(0 : int)])
+f(0, 0)
 Valid? yes
-atom("g", [univ(1 : int), univ(-1 : int)])
+g(1, -1)
 Valid? yes
-atom("f", [univ(-1 : int), univ(2 : int)])
+f(-1, 2)
 Valid? yes
-atom("g", [univ(6 : int), univ(-10 : int)])
+g(6, -10)
 Valid? yes
-atom("g", [univ(7 : int), univ(-11 : int)])
+g(7, -11)
 Valid? yes
-Call atom("c", [univ(2 : int)])
+Call c(2, _)
 Solutions:
-	atom("c", [univ(2 : int), univ(6 : int)])
-	atom("c", [univ(2 : int), univ(7 : int)])
+	c(2, 6)
+	c(2, 7)
 Complete? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(2 : int)]))
+p(2)
+Is this a bug? yes
      109:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> continue
      110:      2  2 REDO pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> finish
      137:      2  2 FAIL pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> dd
-Call atom("p", [])
+Call p(_)
 Solutions:
-	atom("p", [univ(-12 : int)])
-	atom("p", [univ(-14 : int)])
-	atom("p", [univ(-20 : int)])
-	atom("p", [univ(-22 : int)])
-	atom("p", [univ(2 : int)])
+	p(-12)
+	p(-14)
+	p(-20)
+	p(-22)
+	p(2)
 Complete? no
-atom("c", [univ(0 : int), univ(3 : int)])
+c(0, 3)
 Valid? yes
-atom("d", [univ(3 : int), univ(9 : int)])
+d(3, 9)
 Valid? yes
-Call atom("c", [univ(0 : int)])
+Call c(0, _)
 Solutions:
-	atom("c", [univ(0 : int), univ(2 : int)])
-	atom("c", [univ(0 : int), univ(3 : int)])
+	c(0, 2)
+	c(0, 3)
 Complete? yes
-Call atom("e", [univ(1 : int)])
+Call e(1, _)
 Solutions:
-	atom("e", [univ(1 : int), univ(10 : int)])
-	atom("e", [univ(1 : int), univ(11 : int)])
+	e(1, 10)
+	e(1, 11)
 Complete? yes
-Call atom("b", [univ(0 : int)])
+Call b(0, _)
 Solutions:
-	atom("b", [univ(0 : int), univ(0 : int)])
-	atom("b", [univ(0 : int), univ(1 : int)])
+	b(0, 0)
+	b(0, 1)
 Complete? yes
-atom("g", [univ(10 : int), univ(-2 : int)])
+g(10, -2)
 Valid? yes
-atom("f", [univ(-2 : int), univ(4 : int)])
+f(-2, 4)
 Valid? yes
-atom("c", [univ(4 : int), univ(9 : int)])
+c(4, 9)
 Valid? yes
-atom("g", [univ(9 : int), univ(99 : int)])
+g(9, 99)
 Valid? yes
 Incorrect node found:
-missing_answer(atom("p", []), [atom("p", [univ(-12 : int)]), atom("p", [univ(-14 : int)]), atom("p", [univ(-20 : int)]), atom("p", [univ(-22 : int)]), atom("p", [univ(2 : int)])])
+Call p(_)
+Solutions:
+	p(-12)
+	p(-14)
+	p(-20)
+	p(-22)
+	p(2)
+Is this a bug? yes
      137:      2  2 FAIL pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> continue
 no.
Index: tests/debugger/declarative/big.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/big.exp2,v
retrieving revision 1.2
diff -u -r1.2 big.exp2
--- tests/debugger/declarative/big.exp2	2000/01/21 02:44:28	1.2
+++ tests/debugger/declarative/big.exp2	2000/02/20 05:48:51
@@ -9,143 +9,155 @@
 mdb> finish
       28:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> dd
-atom("p", [univ(-12 : int)])
+p(-12)
 Valid? no
-atom("a", [univ(0 : int)])
+a(0)
 Valid? yes
-atom("b", [univ(0 : int), univ(0 : int)])
+b(0, 0)
 Valid? yes
-atom("c", [univ(0 : int), univ(2 : int)])
+c(0, 2)
 Valid? yes
-Call atom("d", [univ(2 : int)])
-Solutions:
+Call d(2, _)
+No solutions.
 Complete? yes
-atom("c", [univ(2 : int), univ(6 : int)])
+c(2, 6)
 Valid? yes
-atom("f", [univ(6 : int), univ(-12 : int)])
+f(6, -12)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(-12 : int)]))
+p(-12)
+Is this a bug? yes
       28:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> continue
       29:      2  2 REDO pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> finish
       35:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> dd
-atom("p", [univ(-14 : int)])
+p(-14)
 Valid? no
-atom("c", [univ(2 : int), univ(7 : int)])
+c(2, 7)
 Valid? yes
-atom("f", [univ(7 : int), univ(-14 : int)])
+f(7, -14)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(-14 : int)]))
+p(-14)
+Is this a bug? yes
       35:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> continue
       36:      2  2 REDO pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> finish
       71:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> dd
-atom("p", [univ(-20 : int)])
+p(-20)
 Valid? no
-atom("b", [univ(0 : int), univ(1 : int)])
+b(0, 1)
 Valid? yes
-atom("c", [univ(1 : int), univ(15 : int)])
+c(1, 15)
 Valid? yes
-atom("d", [univ(15 : int), univ(45 : int)])
+d(15, 45)
 Valid? yes
-Call atom("c", [univ(1 : int)])
+Call c(1, _)
 Solutions:
-	atom("c", [univ(1 : int), univ(15 : int)])
+	c(1, 15)
 Complete? yes
-atom("e", [univ(1 : int), univ(10 : int)])
+e(1, 10)
 Valid? yes
-atom("f", [univ(10 : int), univ(-20 : int)])
+f(10, -20)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(-20 : int)]))
+p(-20)
+Is this a bug? yes
       71:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> continue
       72:      2  2 REDO pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> finish
       78:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> dd
-atom("p", [univ(-22 : int)])
+p(-22)
 Valid? no
-atom("e", [univ(1 : int), univ(11 : int)])
+e(1, 11)
 Valid? yes
-atom("f", [univ(11 : int), univ(-22 : int)])
+f(11, -22)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(-22 : int)]))
+p(-22)
+Is this a bug? yes
       78:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> continue
       79:      2  2 REDO pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> finish
      115:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> dd
-atom("p", [univ(2 : int)])
+p(2)
 Valid? no
-atom("f", [univ(0 : int), univ(0 : int)])
+f(0, 0)
 Valid? yes
-atom("g", [univ(1 : int), univ(-1 : int)])
+g(1, -1)
 Valid? yes
-atom("f", [univ(-1 : int), univ(2 : int)])
+f(-1, 2)
 Valid? yes
-atom("g", [univ(6 : int), univ(-10 : int)])
+g(6, -10)
 Valid? yes
-atom("g", [univ(7 : int), univ(-11 : int)])
+g(7, -11)
 Valid? yes
-Call atom("c", [univ(2 : int)])
+Call c(2, _)
 Solutions:
-	atom("c", [univ(2 : int), univ(6 : int)])
-	atom("c", [univ(2 : int), univ(7 : int)])
+	c(2, 6)
+	c(2, 7)
 Complete? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(2 : int)]))
+p(2)
+Is this a bug? yes
      115:      2  2 EXIT pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> continue
      116:      2  2 REDO pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> finish
      143:      2  2 FAIL pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> dd
-Call atom("p", [])
+Call p(_)
 Solutions:
-	atom("p", [univ(-12 : int)])
-	atom("p", [univ(-14 : int)])
-	atom("p", [univ(-20 : int)])
-	atom("p", [univ(-22 : int)])
-	atom("p", [univ(2 : int)])
+	p(-12)
+	p(-14)
+	p(-20)
+	p(-22)
+	p(2)
 Complete? no
-atom("c", [univ(0 : int), univ(3 : int)])
+c(0, 3)
 Valid? yes
-atom("d", [univ(3 : int), univ(9 : int)])
+d(3, 9)
 Valid? yes
-Call atom("c", [univ(0 : int)])
+Call c(0, _)
 Solutions:
-	atom("c", [univ(0 : int), univ(2 : int)])
-	atom("c", [univ(0 : int), univ(3 : int)])
+	c(0, 2)
+	c(0, 3)
 Complete? yes
-Call atom("e", [univ(1 : int)])
+Call e(1, _)
 Solutions:
-	atom("e", [univ(1 : int), univ(10 : int)])
-	atom("e", [univ(1 : int), univ(11 : int)])
+	e(1, 10)
+	e(1, 11)
 Complete? yes
-Call atom("b", [univ(0 : int)])
+Call b(0, _)
 Solutions:
-	atom("b", [univ(0 : int), univ(0 : int)])
-	atom("b", [univ(0 : int), univ(1 : int)])
+	b(0, 0)
+	b(0, 1)
 Complete? yes
-atom("g", [univ(10 : int), univ(-2 : int)])
+g(10, -2)
 Valid? yes
-atom("f", [univ(-2 : int), univ(4 : int)])
+f(-2, 4)
 Valid? yes
-atom("c", [univ(4 : int), univ(9 : int)])
+c(4, 9)
 Valid? yes
-atom("g", [univ(9 : int), univ(99 : int)])
+g(9, 99)
 Valid? yes
 Incorrect node found:
-missing_answer(atom("p", []), [atom("p", [univ(-12 : int)]), atom("p", [univ(-14 : int)]), atom("p", [univ(-20 : int)]), atom("p", [univ(-22 : int)]), atom("p", [univ(2 : int)])])
+Call p(_)
+Solutions:
+	p(-12)
+	p(-14)
+	p(-20)
+	p(-22)
+	p(2)
+Is this a bug? yes
      143:      2  2 FAIL pred big:p/1-0 (nondet) big.m:23 (big.m:11)
 mdb> continue
 no.
Index: tests/debugger/declarative/big.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/big.inp,v
retrieving revision 1.2
diff -u -r1.2 big.inp
--- tests/debugger/declarative/big.inp	2000/01/21 02:44:28	1.2
+++ tests/debugger/declarative/big.inp	2000/02/20 05:48:51
@@ -11,12 +11,14 @@
 yes
 yes
 yes
+yes
 continue
 finish
 dd
 no
 yes
 yes
+yes
 continue
 finish
 dd
@@ -27,12 +29,14 @@
 yes
 yes
 yes
+yes
 continue
 finish
 dd
 no
 yes
 yes
+yes
 continue
 finish
 dd
@@ -43,10 +47,12 @@
 yes
 yes
 yes
+yes
 continue
 finish
 dd
 no
+yes
 yes
 yes
 yes
Index: tests/debugger/declarative/gcf.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/gcf.exp,v
retrieving revision 1.4
diff -u -r1.4 gcf.exp
--- tests/debugger/declarative/gcf.exp	2000/01/21 02:44:29	1.4
+++ tests/debugger/declarative/gcf.exp	2000/02/20 05:48:51
@@ -9,46 +9,49 @@
 mdb> finish
       23:      2  2 EXIT pred gcf:a/1-0 (nondet) gcf.m:26 (gcf.m:10)
 mdb> dd
-atom("a", [univ(11 : int)])
+a(11)
 Valid? no
-atom("g", [univ(2 : int)])
+g(2)
 Valid? yes
-atom("c", [univ(2 : int), univ(11 : int)])
+c(2, 11)
 Valid? yes
-atom("f", [univ(11 : int)])
+f(11)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("a", [univ(11 : int)]))
+a(11)
+Is this a bug? yes
       23:      2  2 EXIT pred gcf:a/1-0 (nondet) gcf.m:26 (gcf.m:10)
 mdb> continue
       24:      2  2 REDO pred gcf:a/1-0 (nondet) gcf.m:26 (gcf.m:10)
 mdb> finish
       30:      2  2 EXIT pred gcf:a/1-0 (nondet) gcf.m:26 (gcf.m:10)
 mdb> dd
-atom("a", [univ(12 : int)])
+a(12)
 Valid? no
-atom("c", [univ(2 : int), univ(12 : int)])
+c(2, 12)
 Valid? yes
-atom("f", [univ(12 : int)])
+f(12)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("a", [univ(12 : int)]))
+a(12)
+Is this a bug? yes
       30:      2  2 EXIT pred gcf:a/1-0 (nondet) gcf.m:26 (gcf.m:10)
 mdb> continue
       31:      2  2 REDO pred gcf:a/1-0 (nondet) gcf.m:26 (gcf.m:10)
 mdb> finish
       42:      2  2 EXIT pred gcf:a/1-0 (nondet) gcf.m:26 (gcf.m:10)
 mdb> dd
-atom("a", [univ(20 : int)])
+a(20)
 Valid? no
-atom("g", [univ(3 : int)])
+g(3)
 Valid? yes
-atom("c", [univ(3 : int), univ(20 : int)])
+c(3, 20)
 Valid? yes
-atom("f", [univ(20 : int)])
+f(20)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("a", [univ(20 : int)]))
+a(20)
+Is this a bug? yes
       42:      2  2 EXIT pred gcf:a/1-0 (nondet) gcf.m:26 (gcf.m:10)
 mdb> continue
 yes(20)
Index: tests/debugger/declarative/gcf.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/gcf.inp,v
retrieving revision 1.3
diff -u -r1.3 gcf.inp
--- tests/debugger/declarative/gcf.inp	2000/01/21 02:44:29	1.3
+++ tests/debugger/declarative/gcf.inp	2000/02/20 05:48:52
@@ -8,16 +8,19 @@
 yes
 yes
 yes
+yes
 continue
 finish
 dd
 no
 yes
 yes
+yes
 continue
 finish
 dd
 no
+yes
 yes
 yes
 yes
Index: tests/debugger/declarative/if_then_else.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/if_then_else.exp,v
retrieving revision 1.4
diff -u -r1.4 if_then_else.exp
--- tests/debugger/declarative/if_then_else.exp	2000/01/21 02:44:30	1.4
+++ tests/debugger/declarative/if_then_else.exp	2000/02/20 05:48:52
@@ -9,14 +9,15 @@
 mdb> finish
        9:      2  2 EXIT pred if_then_else:ite/2-0 (det) if_then_else.m:22 (if_then_else.m:8)
 mdb> dd
-atom("ite", [univ(0 : int), univ(1 : int)])
+ite(0, 1)
 Valid? no
-atom("a", [univ(0 : int)])
+a(0)
 Valid? yes
-atom("b", [univ(1 : int)])
+b(1)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("ite", [univ(0 : int), univ(1 : int)]))
+ite(0, 1)
+Is this a bug? yes
        9:      2  2 EXIT pred if_then_else:ite/2-0 (det) if_then_else.m:22 (if_then_else.m:8)
 mdb> continue
 ite(0, 1).
@@ -24,13 +25,14 @@
 mdb> finish
       17:      5  2 EXIT pred if_then_else:ite/2-0 (det) if_then_else.m:22 (if_then_else.m:12)
 mdb> dd
-atom("ite", [univ(1 : int), univ(0 : int)])
+ite(1, 0)
 Valid? no
-Call atom("a", [univ(1 : int)])
-Solutions:
+Call a(1)
+No solutions.
 Complete? yes
 Incorrect node found:
-wrong_answer(atom("ite", [univ(1 : int), univ(0 : int)]))
+ite(1, 0)
+Is this a bug? yes
       17:      5  2 EXIT pred if_then_else:ite/2-0 (det) if_then_else.m:22 (if_then_else.m:12)
 mdb> continue
 ite(1, 0).
Index: tests/debugger/declarative/if_then_else.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/if_then_else.exp2,v
retrieving revision 1.4
diff -u -r1.4 if_then_else.exp2
--- tests/debugger/declarative/if_then_else.exp2	2000/02/17 12:04:30	1.4
+++ tests/debugger/declarative/if_then_else.exp2	2000/02/20 05:48:52
@@ -9,28 +9,30 @@
 mdb> finish
        9:      2  2 EXIT pred if_then_else:ite/2-0 (det) if_then_else.m:22 (if_then_else.m:8)
 mdb> dd
-atom("ite", [univ(0 : int), univ(1 : int)])
+ite(0, 1)
 Valid? no
-atom("a", [univ(0 : int)])
+a(0)
 Valid? yes
-atom("b", [univ(1 : int)])
+b(1)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("ite", [univ(0 : int), univ(1 : int)]))
+ite(0, 1)
+Is this a bug? yes
        9:      2  2 EXIT pred if_then_else:ite/2-0 (det) if_then_else.m:22 (if_then_else.m:8)
 mdb> continue
 ite(0, 1).
-      16:    311  2 CALL pred if_then_else:ite/2-0 (det) if_then_else.m:22 (if_then_else.m:12)
+      16:    368  2 CALL pred if_then_else:ite/2-0 (det) if_then_else.m:22 (if_then_else.m:12)
 mdb> finish
-      23:    311  2 EXIT pred if_then_else:ite/2-0 (det) if_then_else.m:22 (if_then_else.m:12)
+      23:    368  2 EXIT pred if_then_else:ite/2-0 (det) if_then_else.m:22 (if_then_else.m:12)
 mdb> dd
-atom("ite", [univ(1 : int), univ(0 : int)])
+ite(1, 0)
 Valid? no
-Call atom("a", [univ(1 : int)])
-Solutions:
+Call a(1)
+No solutions.
 Complete? yes
 Incorrect node found:
-wrong_answer(atom("ite", [univ(1 : int), univ(0 : int)]))
-      23:    311  2 EXIT pred if_then_else:ite/2-0 (det) if_then_else.m:22 (if_then_else.m:12)
+ite(1, 0)
+Is this a bug? yes
+      23:    368  2 EXIT pred if_then_else:ite/2-0 (det) if_then_else.m:22 (if_then_else.m:12)
 mdb> continue
 ite(1, 0).
Index: tests/debugger/declarative/if_then_else.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/if_then_else.inp,v
retrieving revision 1.3
diff -u -r1.3 if_then_else.inp
--- tests/debugger/declarative/if_then_else.inp	2000/01/21 02:44:30	1.3
+++ tests/debugger/declarative/if_then_else.inp	2000/02/20 05:48:52
@@ -7,9 +7,11 @@
 no
 yes
 yes
+yes
 continue
 finish
 dd
 no
+yes
 yes
 continue
Index: tests/debugger/declarative/lpe_example.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/lpe_example.exp,v
retrieving revision 1.2
diff -u -r1.2 lpe_example.exp
--- tests/debugger/declarative/lpe_example.exp	2000/01/21 02:44:31	1.2
+++ tests/debugger/declarative/lpe_example.exp	2000/02/20 05:48:53
@@ -9,55 +9,63 @@
 mdb> finish
       10:      2  2 EXIT pred lpe_example:p/2-0 (nondet) lpe_example.m:17
 mdb> dd
-atom("p", [univ(1 : int), univ(13 : int)])
+p(1, 13)
 Valid? no
-atom("q", [univ(3 : int)])
+q(3)
 Valid? yes
-atom("r", [univ(3 : int), univ(13 : int)])
+r(3, 13)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(1 : int), univ(13 : int)]))
+p(1, 13)
+Is this a bug? yes
       10:      2  2 EXIT pred lpe_example:p/2-0 (nondet) lpe_example.m:17
 mdb> continue
       11:      2  2 REDO pred lpe_example:p/2-0 (nondet) lpe_example.m:17
 mdb> finish
       15:      2  2 EXIT pred lpe_example:p/2-0 (nondet) lpe_example.m:17
 mdb> dd
-atom("p", [univ(1 : int), univ(23 : int)])
+p(1, 23)
 Valid? no
-atom("r", [univ(3 : int), univ(23 : int)])
+r(3, 23)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(1 : int), univ(23 : int)]))
+p(1, 23)
+Is this a bug? yes
       15:      2  2 EXIT pred lpe_example:p/2-0 (nondet) lpe_example.m:17
 mdb> continue
       16:      2  2 REDO pred lpe_example:p/2-0 (nondet) lpe_example.m:17
 mdb> finish
       20:      2  2 EXIT pred lpe_example:p/2-0 (nondet) lpe_example.m:17
 mdb> dd
-atom("p", [univ(1 : int), univ(3 : int)])
+p(1, 3)
 Valid? no
 Incorrect node found:
-wrong_answer(atom("p", [univ(1 : int), univ(3 : int)]))
+p(1, 3)
+Is this a bug? yes
       20:      2  2 EXIT pred lpe_example:p/2-0 (nondet) lpe_example.m:17
 mdb> continue
       21:      2  2 REDO pred lpe_example:p/2-0 (nondet) lpe_example.m:17
 mdb> finish
       22:      2  2 FAIL pred lpe_example:p/2-0 (nondet) lpe_example.m:17
 mdb> dd
-Call atom("p", [univ(1 : int)])
+Call p(1, _)
 Solutions:
-	atom("p", [univ(1 : int), univ(13 : int)])
-	atom("p", [univ(1 : int), univ(23 : int)])
-	atom("p", [univ(1 : int), univ(3 : int)])
+	p(1, 13)
+	p(1, 23)
+	p(1, 3)
 Complete? no
-Call atom("r", [univ(3 : int)])
+Call r(3, _)
 Solutions:
-	atom("r", [univ(3 : int), univ(13 : int)])
-	atom("r", [univ(3 : int), univ(23 : int)])
+	r(3, 13)
+	r(3, 23)
 Complete? yes
 Incorrect node found:
-missing_answer(atom("p", [univ(1 : int)]), [atom("p", [univ(1 : int), univ(13 : int)]), atom("p", [univ(1 : int), univ(23 : int)]), atom("p", [univ(1 : int), univ(3 : int)])])
+Call p(1, _)
+Solutions:
+	p(1, 13)
+	p(1, 23)
+	p(1, 3)
+Is this a bug? yes
       22:      2  2 FAIL pred lpe_example:p/2-0 (nondet) lpe_example.m:17
 mdb> continue
 [3, 13, 23]
Index: tests/debugger/declarative/lpe_example.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/lpe_example.exp2,v
retrieving revision 1.2
diff -u -r1.2 lpe_example.exp2
--- tests/debugger/declarative/lpe_example.exp2	2000/01/21 02:44:31	1.2
+++ tests/debugger/declarative/lpe_example.exp2	2000/02/20 05:48:53
@@ -9,55 +9,63 @@
 mdb> finish
       11:      3  3 EXIT pred lpe_example:p/2-0 (nondet) lpe_example.m:17 (std_util.m:590)
 mdb> dd
-atom("p", [univ(1 : int), univ(13 : int)])
+p(1, 13)
 Valid? no
-atom("q", [univ(3 : int)])
+q(3)
 Valid? yes
-atom("r", [univ(3 : int), univ(13 : int)])
+r(3, 13)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(1 : int), univ(13 : int)]))
+p(1, 13)
+Is this a bug? yes
       11:      3  3 EXIT pred lpe_example:p/2-0 (nondet) lpe_example.m:17 (std_util.m:590)
 mdb> continue
       12:      3  3 REDO pred lpe_example:p/2-0 (nondet) lpe_example.m:17 (std_util.m:590)
 mdb> finish
       16:      3  3 EXIT pred lpe_example:p/2-0 (nondet) lpe_example.m:17 (std_util.m:590)
 mdb> dd
-atom("p", [univ(1 : int), univ(23 : int)])
+p(1, 23)
 Valid? no
-atom("r", [univ(3 : int), univ(23 : int)])
+r(3, 23)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(1 : int), univ(23 : int)]))
+p(1, 23)
+Is this a bug? yes
       16:      3  3 EXIT pred lpe_example:p/2-0 (nondet) lpe_example.m:17 (std_util.m:590)
 mdb> continue
       17:      3  3 REDO pred lpe_example:p/2-0 (nondet) lpe_example.m:17 (std_util.m:590)
 mdb> finish
       21:      3  3 EXIT pred lpe_example:p/2-0 (nondet) lpe_example.m:17 (std_util.m:590)
 mdb> dd
-atom("p", [univ(1 : int), univ(3 : int)])
+p(1, 3)
 Valid? no
 Incorrect node found:
-wrong_answer(atom("p", [univ(1 : int), univ(3 : int)]))
+p(1, 3)
+Is this a bug? yes
       21:      3  3 EXIT pred lpe_example:p/2-0 (nondet) lpe_example.m:17 (std_util.m:590)
 mdb> continue
       22:      3  3 REDO pred lpe_example:p/2-0 (nondet) lpe_example.m:17 (std_util.m:590)
 mdb> finish
       23:      3  3 FAIL pred lpe_example:p/2-0 (nondet) lpe_example.m:17 (std_util.m:590)
 mdb> dd
-Call atom("p", [univ(1 : int)])
+Call p(1, _)
 Solutions:
-	atom("p", [univ(1 : int), univ(13 : int)])
-	atom("p", [univ(1 : int), univ(23 : int)])
-	atom("p", [univ(1 : int), univ(3 : int)])
+	p(1, 13)
+	p(1, 23)
+	p(1, 3)
 Complete? no
-Call atom("r", [univ(3 : int)])
+Call r(3, _)
 Solutions:
-	atom("r", [univ(3 : int), univ(13 : int)])
-	atom("r", [univ(3 : int), univ(23 : int)])
+	r(3, 13)
+	r(3, 23)
 Complete? yes
 Incorrect node found:
-missing_answer(atom("p", [univ(1 : int)]), [atom("p", [univ(1 : int), univ(13 : int)]), atom("p", [univ(1 : int), univ(23 : int)]), atom("p", [univ(1 : int), univ(3 : int)])])
+Call p(1, _)
+Solutions:
+	p(1, 13)
+	p(1, 23)
+	p(1, 3)
+Is this a bug? yes
       23:      3  3 FAIL pred lpe_example:p/2-0 (nondet) lpe_example.m:17 (std_util.m:590)
 mdb> continue
 [3, 13, 23]
Index: tests/debugger/declarative/lpe_example.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/lpe_example.inp,v
retrieving revision 1.2
diff -u -r1.2 lpe_example.inp
--- tests/debugger/declarative/lpe_example.inp	2000/01/21 02:44:31	1.2
+++ tests/debugger/declarative/lpe_example.inp	2000/02/20 05:48:53
@@ -7,18 +7,22 @@
 no
 yes
 yes
+yes
 continue
 finish
 dd
 no
 yes
+yes
 continue
 finish
 dd
 no
+yes
 continue
 finish
 dd
 no
+yes
 yes
 continue
Index: tests/debugger/declarative/neg_conj.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/neg_conj.exp,v
retrieving revision 1.2
diff -u -r1.2 neg_conj.exp
--- tests/debugger/declarative/neg_conj.exp	2000/01/21 02:44:31	1.2
+++ tests/debugger/declarative/neg_conj.exp	2000/02/20 05:48:53
@@ -9,25 +9,26 @@
 mdb> finish
       18:      2  2 EXIT pred neg_conj:p/1-0 (semidet) neg_conj.m:19 (neg_conj.m:9)
 mdb> dd
-atom("p", [univ(0 : int)])
+p(0)
 Valid? no
-atom("q", [univ(0 : int), univ(0 : int)])
+q(0, 0)
 Valid? yes
-Call atom("r", [univ(0 : int)])
-Solutions:
+Call r(0)
+No solutions.
 Complete? yes
-atom("q", [univ(0 : int), univ(1 : int)])
+q(0, 1)
 Valid? yes
-Call atom("r", [univ(1 : int)])
-Solutions:
+Call r(1)
+No solutions.
 Complete? yes
-Call atom("q", [univ(0 : int)])
+Call q(0, _)
 Solutions:
-	atom("q", [univ(0 : int), univ(0 : int)])
-	atom("q", [univ(0 : int), univ(1 : int)])
+	q(0, 0)
+	q(0, 1)
 Complete? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(0 : int)]))
+p(0)
+Is this a bug? yes
       18:      2  2 EXIT pred neg_conj:p/1-0 (semidet) neg_conj.m:19 (neg_conj.m:9)
 mdb> continue
 yes.
Index: tests/debugger/declarative/neg_conj.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/neg_conj.inp,v
retrieving revision 1.2
diff -u -r1.2 neg_conj.inp
--- tests/debugger/declarative/neg_conj.inp	2000/01/21 02:44:32	1.2
+++ tests/debugger/declarative/neg_conj.inp	2000/02/20 05:48:53
@@ -10,5 +10,6 @@
 yes
 yes
 yes
+yes
 continue
 
Index: tests/debugger/declarative/negation.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/negation.exp,v
retrieving revision 1.2
diff -u -r1.2 negation.exp
--- tests/debugger/declarative/negation.exp	2000/01/21 02:44:32	1.2
+++ tests/debugger/declarative/negation.exp	2000/02/20 05:48:53
@@ -9,23 +9,24 @@
 mdb> finish
       23:      2  2 EXIT pred negation:p/2-0 (det) negation.m:29 (negation.m:14)
 mdb> dd
-atom("p", [univ(1 : int), univ(42 : int)])
+p(1, 42)
 Valid? no
-atom("r", [univ(1 : int), univ(11 : int)])
+r(1, 11)
 Valid? yes
-atom("q", [univ(11 : int)])
+q(11)
 Valid? yes
-atom("r", [univ(1 : int), univ(21 : int)])
+r(1, 21)
 Valid? yes
-atom("q", [univ(21 : int)])
+q(21)
 Valid? yes
-Call atom("r", [univ(1 : int)])
+Call r(1, _)
 Solutions:
-	atom("r", [univ(1 : int), univ(11 : int)])
-	atom("r", [univ(1 : int), univ(21 : int)])
+	r(1, 11)
+	r(1, 21)
 Complete? yes
 Incorrect node found:
-wrong_answer(atom("p", [univ(1 : int), univ(42 : int)]))
+p(1, 42)
+Is this a bug? yes
       23:      2  2 EXIT pred negation:p/2-0 (det) negation.m:29 (negation.m:14)
 mdb> continue
 42
Index: tests/debugger/declarative/negation.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/negation.inp,v
retrieving revision 1.2
diff -u -r1.2 negation.inp
--- tests/debugger/declarative/negation.inp	2000/01/21 02:44:32	1.2
+++ tests/debugger/declarative/negation.inp	2000/02/20 05:48:54
@@ -10,5 +10,6 @@
 yes
 yes
 yes
+yes
 continue
 
Index: tests/debugger/declarative/oracle_db.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/oracle_db.exp,v
retrieving revision 1.4
diff -u -r1.4 oracle_db.exp
--- tests/debugger/declarative/oracle_db.exp	2000/01/21 02:44:32	1.4
+++ tests/debugger/declarative/oracle_db.exp	2000/02/20 05:48:54
@@ -9,12 +9,13 @@
 mdb> finish
       10:      2  2 EXIT pred oracle_db:a/3-0 (semidet) oracle_db.m:19 (oracle_db.m:9)
 mdb> dd
-atom("a", [univ(99 : int), univ(99 : int), univ(99 : int)])
+a(99, 99, 99)
 Valid? no
-atom("b", [univ(99 : int)])
+b(99)
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("a", [univ(99 : int), univ(99 : int), univ(99 : int)]))
+a(99, 99, 99)
+Is this a bug? yes
       10:      2  2 EXIT pred oracle_db:a/3-0 (semidet) oracle_db.m:19 (oracle_db.m:9)
 mdb> continue
 yes.
Index: tests/debugger/declarative/oracle_db.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/oracle_db.inp,v
retrieving revision 1.3
diff -u -r1.3 oracle_db.inp
--- tests/debugger/declarative/oracle_db.inp	2000/01/21 02:44:33	1.3
+++ tests/debugger/declarative/oracle_db.inp	2000/02/20 05:48:54
@@ -6,5 +6,6 @@
 dd
 no
 yes
+yes
 continue
 
Index: tests/debugger/declarative/propositional.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/propositional.exp,v
retrieving revision 1.5
diff -u -r1.5 propositional.exp
--- tests/debugger/declarative/propositional.exp	2000/02/17 06:47:51	1.5
+++ tests/debugger/declarative/propositional.exp	2000/02/20 05:48:54
@@ -11,26 +11,28 @@
 mdb> finish
       11:      2  2 EXIT pred propositional:a/0-0 (semidet) propositional.m:27 (propositional.m:10)
 mdb> dd
-atom("a", [])
+a
 Valid? no
-atom("c", [])
+c
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("a", []))
+a
+Is this a bug? yes
       11:      2  2 EXIT pred propositional:a/0-0 (semidet) propositional.m:27 (propositional.m:10)
 mdb> continue
       12:      5  2 CALL pred propositional:b/0-0 (semidet) propositional.m:29 (propositional.m:10)
 mdb> finish
       22:      5  2 EXIT pred propositional:b/0-0 (semidet) propositional.m:29 (propositional.m:10)
 mdb> dd
-atom("b", [])
+b
 Valid? no
-atom("f", [])
+f
 Valid? no
-atom("i", [])
+i
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("f", []))
+f
+Is this a bug? yes
       22:      5  2 EXIT pred propositional:b/0-0 (semidet) propositional.m:29 (propositional.m:10)
 mdb> continue
 yes
Index: tests/debugger/declarative/propositional.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/propositional.exp2,v
retrieving revision 1.4
diff -u -r1.4 propositional.exp2
--- tests/debugger/declarative/propositional.exp2	2000/02/17 12:04:30	1.4
+++ tests/debugger/declarative/propositional.exp2	2000/02/20 05:48:55
@@ -11,26 +11,28 @@
 mdb> finish
       15:      2  2 EXIT pred propositional:a/0-0 (semidet) propositional.m:27 (propositional.m:10)
 mdb> dd
-atom("a", [])
+a
 Valid? no
-atom("c", [])
+c
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("a", []))
+a
+Is this a bug? yes
       15:      2  2 EXIT pred propositional:a/0-0 (semidet) propositional.m:27 (propositional.m:10)
 mdb> continue
-      16:    275  2 CALL pred propositional:b/0-0 (semidet) propositional.m:29 (propositional.m:10)
+      16:    299  2 CALL pred propositional:b/0-0 (semidet) propositional.m:29 (propositional.m:10)
 mdb> finish
-      30:    275  2 EXIT pred propositional:b/0-0 (semidet) propositional.m:29 (propositional.m:10)
+      30:    299  2 EXIT pred propositional:b/0-0 (semidet) propositional.m:29 (propositional.m:10)
 mdb> dd
-atom("b", [])
+b
 Valid? no
-atom("f", [])
+f
 Valid? no
-atom("i", [])
+i
 Valid? yes
 Incorrect node found:
-wrong_answer(atom("f", []))
-      30:    275  2 EXIT pred propositional:b/0-0 (semidet) propositional.m:29 (propositional.m:10)
+f
+Is this a bug? yes
+      30:    299  2 EXIT pred propositional:b/0-0 (semidet) propositional.m:29 (propositional.m:10)
 mdb> continue
 yes
Index: tests/debugger/declarative/propositional.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/propositional.inp,v
retrieving revision 1.4
diff -u -r1.4 propositional.inp
--- tests/debugger/declarative/propositional.inp	2000/02/17 06:47:51	1.4
+++ tests/debugger/declarative/propositional.inp	2000/02/20 05:48:55
@@ -7,10 +7,12 @@
 dd
 no
 yes
+yes
 continue
 finish
 dd
 no
 no
+yes
 yes
 continue
Index: tests/debugger/declarative/queens.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/queens.exp,v
retrieving revision 1.4
diff -u -r1.4 queens.exp
--- tests/debugger/declarative/queens.exp	2000/01/21 02:44:34	1.4
+++ tests/debugger/declarative/queens.exp	2000/02/20 05:48:55
@@ -11,48 +11,50 @@
 mdb> finish
      161:      3  2 FAIL pred queens:queen/2-0 (nondet) queens.m:41 (queens.m:15)
 mdb> dd
-Call atom("queen", [univ([1, 2, 3, 4, 5] : list:list(int))])
-Solutions:
+Call queen([1, 2, 3, 4, 5], _)
+No solutions.
 Complete? no
-Call atom("qperm", [univ([1, 2, 3, 4, 5] : list:list(int)), univ(int : private_builtin:type_info(int))])
-Solutions:
+Call qperm([1, 2, 3, 4, 5], _)
+No solutions.
 Complete? no
-atom("qdelete", [univ(1 : int), univ([1, 2, 3, 4, 5] : list:list(int)), univ([2, 3, 4, 5] : list:list(int)), univ(int : private_builtin:type_info(int))])
+qdelete(1, [1, 2, 3, 4, 5], [2, 3, 4, 5])
 Valid? yes
-atom("qdelete", [univ(2 : int), univ([1, 2, 3, 4, 5] : list:list(int)), univ([1, 3, 4, 5] : list:list(int)), univ(int : private_builtin:type_info(int))])
+qdelete(2, [1, 2, 3, 4, 5], [1, 3, 4, 5])
 Valid? yes
-Call atom("qperm", [univ([1, 3, 4, 5] : list:list(int)), univ(int : private_builtin:type_info(int))])
-Solutions:
+Call qperm([1, 3, 4, 5], _)
+No solutions.
 Complete? no
-atom("qdelete", [univ(1 : int), univ([1, 3, 4, 5] : list:list(int)), univ([3, 4, 5] : list:list(int)), univ(int : private_builtin:type_info(int))])
+qdelete(1, [1, 3, 4, 5], [3, 4, 5])
 Valid? yes
-atom("qdelete", [univ(3 : int), univ([1, 3, 4, 5] : list:list(int)), univ([1, 4, 5] : list:list(int)), univ(int : private_builtin:type_info(int))])
+qdelete(3, [1, 3, 4, 5], [1, 4, 5])
 Valid? yes
-Call atom("qperm", [univ([1, 4, 5] : list:list(int)), univ(int : private_builtin:type_info(int))])
-Solutions:
+Call qperm([1, 4, 5], _)
+No solutions.
 Complete? no
-atom("qdelete", [univ(1 : int), univ([1, 4, 5] : list:list(int)), univ([4, 5] : list:list(int)), univ(int : private_builtin:type_info(int))])
+qdelete(1, [1, 4, 5], [4, 5])
 Valid? yes
-atom("qdelete", [univ(4 : int), univ([1, 4, 5] : list:list(int)), univ([1, 5] : list:list(int)), univ(int : private_builtin:type_info(int))])
+qdelete(4, [1, 4, 5], [1, 5])
 Valid? yes
-Call atom("qperm", [univ([1, 5] : list:list(int)), univ(int : private_builtin:type_info(int))])
-Solutions:
+Call qperm([1, 5], _)
+No solutions.
 Complete? no
-atom("qdelete", [univ(1 : int), univ([1, 5] : list:list(int)), univ([5] : list:list(int)), univ(int : private_builtin:type_info(int))])
+qdelete(1, [1, 5], [5])
 Valid? yes
-atom("qdelete", [univ(5 : int), univ([1, 5] : list:list(int)), univ([1] : list:list(int)), univ(int : private_builtin:type_info(int))])
+qdelete(5, [1, 5], [1])
 Valid? yes
-Call atom("qperm", [univ([1] : list:list(int)), univ(int : private_builtin:type_info(int))])
-Solutions:
+Call qperm([1], _)
+No solutions.
 Complete? no
-atom("qdelete", [univ(1 : int), univ([1] : list:list(int)), univ([] : list:list(int)), univ(int : private_builtin:type_info(int))])
+qdelete(1, [1], [])
 Valid? yes
-Call atom("qdelete", [univ([1] : list:list(int)), univ(int : private_builtin:type_info(int))])
+Call qdelete(_, [1], _)
 Solutions:
-	atom("qdelete", [univ(1 : int), univ([1] : list:list(int)), univ([] : list:list(int)), univ(int : private_builtin:type_info(int))])
+	qdelete(1, [1], [])
 Complete? yes
 Incorrect node found:
-missing_answer(atom("qperm", [univ([1] : list:list(int)), univ(int : private_builtin:type_info(int))]), [])
+Call qperm([1], _)
+No solutions.
+Is this a bug? yes
      161:      3  2 FAIL pred queens:queen/2-0 (nondet) queens.m:41 (queens.m:15)
 mdb> continue
 No solution
Index: tests/debugger/declarative/queens.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/queens.inp,v
retrieving revision 1.3
diff -u -r1.3 queens.inp
--- tests/debugger/declarative/queens.inp	2000/01/21 02:44:34	1.3
+++ tests/debugger/declarative/queens.inp	2000/02/20 05:48:55
@@ -21,4 +21,5 @@
 no
 yes
 yes
+yes
 continue
Index: tests/debugger/declarative/small.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/small.exp,v
retrieving revision 1.2
diff -u -r1.2 small.exp
--- tests/debugger/declarative/small.exp	2000/01/21 02:44:34	1.2
+++ tests/debugger/declarative/small.exp	2000/02/20 05:48:55
@@ -9,10 +9,11 @@
 mdb> finish
        3:      2  2 EXIT pred small:p/1-0 (det) small.m:14 (small.m:8)
 mdb> dd
-atom("p", [univ(42 : int)])
+p(42)
 Valid? no
 Incorrect node found:
-wrong_answer(atom("p", [univ(42 : int)]))
+p(42)
+Is this a bug? yes
        3:      2  2 EXIT pred small:p/1-0 (det) small.m:14 (small.m:8)
 mdb> continue
 42
Index: tests/debugger/declarative/small.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/small.inp,v
retrieving revision 1.2
diff -u -r1.2 small.inp
--- tests/debugger/declarative/small.inp	2000/01/21 02:44:35	1.2
+++ tests/debugger/declarative/small.inp	2000/02/20 05:48:55
@@ -5,5 +5,6 @@
 finish
 dd
 no
+yes
 continue
 
Index: trace/mercury_trace_declarative.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_declarative.c,v
retrieving revision 1.17
diff -u -r1.17 mercury_trace_declarative.c
--- trace/mercury_trace_declarative.c	2000/02/17 12:04:37	1.17
+++ trace/mercury_trace_declarative.c	2000/02/20 05:49:21
@@ -37,6 +37,7 @@
 #include "mercury_trace_internal.h"
 #include "mercury_trace_tables.h"
 #include "mercury_trace_util.h"
+#include "mercury_trace_vars.h"
 #include "mercury_layout_util.h"
 #include "mercury_deep_copy.h"
 #include "mercury_stack_trace.h"
@@ -202,7 +203,8 @@
 MR_trace_single_component(const char *path);
 
 static	Word
-MR_decl_make_atom(const MR_Stack_Layout_Label *layout, Word *saved_regs);
+MR_decl_make_atom(const MR_Stack_Layout_Label *layout, Word *saved_regs,
+		MR_Trace_Port port);
 
 static	ConstString
 MR_decl_atom_name(const MR_Stack_Layout_Entry *entry);
@@ -376,7 +378,8 @@
 	Word				atom;
 	const MR_Stack_Layout_Label	*layout = event_info->MR_event_sll;
 
-	atom = MR_decl_make_atom(layout, event_info->MR_saved_regs);
+	atom = MR_decl_make_atom(layout, event_info->MR_saved_regs,
+			MR_PORT_CALL);
 	MR_TRACE_CALL_MERCURY(
 		node = (MR_Trace_Node) MR_DD_construct_call_node(
 					(Word) prev, atom,
@@ -400,7 +403,8 @@
 	Word			atom;
 
 	atom = MR_decl_make_atom(event_info->MR_event_sll,
-				event_info->MR_saved_regs);
+				event_info->MR_saved_regs,
+				MR_PORT_EXIT);
 
 #ifdef MR_USE_DECL_STACK_SLOT
 	call = MR_trace_decl_get_slot(event_info->MR_event_sll->MR_sll_entry,
@@ -902,19 +906,63 @@
 }
 
 static	Word
-MR_decl_make_atom(const MR_Stack_Layout_Label *layout, Word *saved_regs)
+MR_decl_make_atom(const MR_Stack_Layout_Label *layout, Word *saved_regs,
+		MR_Trace_Port port)
 {
-	ConstString		name;
-	Word			args;
-	Word			atom;
+	ConstString			name;
+	Word				arity;
+	Word				atom;
+	int				i;
+	const MR_Stack_Layout_Vars	*vars;
+	int				arg_count;
+	Word				*type_params;
+	const MR_Stack_Layout_Entry	*entry = layout->MR_sll_entry;
 
-	name = MR_decl_atom_name(layout->MR_sll_entry);
-	args = MR_decl_atom_args(layout, saved_regs);
+	MR_trace_init_point_vars(layout, saved_regs, port);
 
-	MR_TRACE_USE_HP(
-		MR_trace_atom(atom, name, args);
+	name = MR_decl_atom_name(entry);
+	if (MR_ENTRY_LAYOUT_COMPILER_GENERATED(layout->MR_sll_entry)) {
+		arity = (Word) entry->MR_sle_comp.MR_comp_arity;
+	} else {
+		arity = (Word) entry->MR_sle_user.MR_user_arity;
+	}
+	MR_TRACE_CALL_MERCURY(
+		atom = MR_DD_construct_trace_atom((String) name, arity);
 	);
 
+	arg_count = MR_trace_var_count();
+	for (i = 1; i <= arg_count; i++) {
+		Word		arg;
+		Word		arg_type;
+		Word		arg_value;
+		int		arg_pos;
+		const char	*problem;
+
+		problem = MR_trace_return_var_info(i, NULL, &arg_type,
+					&arg_value);
+		if (problem != NULL) {
+			fatal_error(problem);
+		}
+
+		problem = MR_trace_headvar_num(i, &arg_pos);
+		if (problem != NULL) {
+			fatal_error(problem);
+		}
+
+		MR_TRACE_USE_HP(
+			tag_incr_hp(arg, MR_mktag(0), 2);
+		);
+		MR_field(MR_mktag(0), arg, UNIV_OFFSET_FOR_TYPEINFO) =
+				arg_type;
+		MR_field(MR_mktag(0), arg, UNIV_OFFSET_FOR_DATA) =
+				arg_value;
+
+		MR_TRACE_CALL_MERCURY(
+			atom = MR_DD_add_trace_atom_arg(atom,
+						(Word) arg_pos, arg);
+		);
+	}
+
 	return atom;
 }
 
@@ -938,61 +986,6 @@
 	}
 
 	return name;
-}
-
-static	Word
-MR_decl_atom_args(const MR_Stack_Layout_Label *layout, Word *saved_regs)
-{
-	int				i;
-	Word				arglist;
-	Word				tail;
-	Word				head;
-	const MR_Stack_Layout_Vars	*vars;
-	int				arg_count;
-	Word				*base_sp;
-	Word				*base_curfr;
-	Word				*type_params;
-	Word				arg_type;
-	Word				arg_value;
-
-	MR_TRACE_USE_HP(
-		arglist = MR_list_empty();
-	);
-
-	vars = &layout->MR_sll_var_info;
-	if (!MR_has_valid_var_count(vars)) {
-		fprintf(MR_mdb_err, "mdb: no info about live variables.\n");
-	}
-
-	if (!MR_has_valid_var_info(vars)) {
-		/* there are no live variables */
-
-		return arglist;
-	}
-
-	arg_count = MR_all_desc_var_count(vars);
-	base_sp = MR_saved_sp(saved_regs);
-	base_curfr = MR_saved_curfr(saved_regs);
-	type_params = MR_materialize_typeinfos_base(vars, saved_regs, 
-			base_sp, base_curfr);
-
-	MR_TRACE_USE_HP(
-		for (i = arg_count - 1; i >= 0; i--) {
-			MR_get_type_and_value_base(vars, i, saved_regs,
-					base_sp, base_curfr, type_params,
-					&arg_type, &arg_value);
-
-			tail = arglist;
-			tag_incr_hp(head, MR_mktag(0), 2);
-			MR_field(MR_mktag(0), head, UNIV_OFFSET_FOR_TYPEINFO) =
-					arg_type;
-			MR_field(MR_mktag(0), head, UNIV_OFFSET_FOR_DATA) =
-					arg_value;
-			arglist = MR_list_cons(head, tail);
-		}
-	);
-
-	return arglist;
 }
 
 static	void
Index: trace/mercury_trace_declarative.h
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_declarative.h,v
retrieving revision 1.8
diff -u -r1.8 mercury_trace_declarative.h
--- trace/mercury_trace_declarative.h	2000/02/17 12:04:37	1.8
+++ trace/mercury_trace_declarative.h	2000/02/20 05:49:21
@@ -41,11 +41,4 @@
 #define MR_TRACE_STATUS_FAILED		(Word) 1
 #define MR_TRACE_STATUS_UNDECIDED	(Word) 2
 
-#define MR_trace_atom(atom, name, args)					    \
-	do {								    \
-		tag_incr_hp((atom), MR_mktag(0), 2);			    \
-		MR_field(MR_mktag(0), (atom), (Integer) 0) = (Word) (name); \
-		MR_field(MR_mktag(0), (atom), (Integer) 1) = (args);	    \
-	} while(0)
-
 #endif	/* MERCURY_TRACE_DECLARATIVE_H */
Index: trace/mercury_trace_vars.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_vars.c,v
retrieving revision 1.11
diff -u -r1.11 mercury_trace_vars.c
--- trace/mercury_trace_vars.c	1999/12/10 04:24:09	1.11
+++ trace/mercury_trace_vars.c	2000/02/20 05:49:27
@@ -111,6 +111,8 @@
 static	void	MR_trace_browse_var(FILE *out, MR_Var_Details *var,
 			MR_Browser browser);
 static	int	MR_trace_print_var_name(FILE *out, MR_Var_Details *var);
+static	const char *
+		MR_trace_valid_var_number(int var_number);
 
 #define	MR_INIT_VAR_DETAIL_COUNT	20
 #define	MR_TRACE_PADDED_VAR_NAME_LENGTH	23
@@ -559,17 +561,16 @@
 MR_trace_return_var_info(int var_number, const char **name_ptr,
 	Word *type_info_ptr, Word *value_ptr)
 {
-	const MR_Var_Details *details;
+	const MR_Var_Details	*details;
+	const char		*problem;
 
 	if (MR_point.MR_point_problem != NULL) {
 		return MR_point.MR_point_problem;
 	}
 
-	if (var_number < 1) {
-		return "invalid variable number";
-	}
-	if (var_number > MR_point.MR_point_var_count) {
-		return "there aren't that many variables";
+	problem = MR_trace_valid_var_number(var_number);
+	if (problem != NULL) {
+		return problem;
 	}
 
 	details = &MR_point.MR_point_vars[var_number - 1];
@@ -588,24 +589,48 @@
 }
 
 const char *
+MR_trace_headvar_num(int var_number, int *arg_pos)
+{
+	const MR_Var_Details	*details;
+	const char		*problem;
+
+	if (MR_point.MR_point_problem != NULL) {
+		return MR_point.MR_point_problem;
+	}
+
+	problem = MR_trace_valid_var_number(var_number);
+	if (problem != NULL) {
+		return problem;
+	}
+
+	details = &MR_point.MR_point_vars[var_number - 1];
+
+	if (!details->MR_var_is_headvar) {
+		return "not a head variable";
+	}
+
+	*arg_pos = details->MR_var_num_suffix;
+	return NULL;
+}
+
+const char *
 MR_trace_browse_one(FILE *out, MR_Var_Spec var_spec, MR_Browser browser,
 	bool must_be_unique)
 {
-	int	i;
-	bool	found;
+	int		i;
+	bool		found;
+	const char	*problem;
 
 	if (MR_point.MR_point_problem != NULL) {
 		return MR_point.MR_point_problem;
 	}
 
 	if (var_spec.MR_var_spec_kind == MR_VAR_SPEC_NUMBER) {
-		if (var_spec.MR_var_spec_number < 1) {
-			return "invalid variable number";
+		problem = MR_trace_valid_var_number(
+					var_spec.MR_var_spec_number);
+		if (problem != NULL) {
+			return problem;
 		}
-		if (var_spec.MR_var_spec_number > MR_point.MR_point_var_count)
-		{
-			return "there aren't that many variables";
-		}
 		MR_trace_browse_var(out, &MR_point.MR_point_vars
 			[var_spec.MR_var_spec_number - 1], browser);
 	} else if (var_spec.MR_var_spec_kind == MR_VAR_SPEC_NAME) {
@@ -711,4 +736,17 @@
 	}
 
 	return len;
+}
+
+static	const char *
+MR_trace_valid_var_number(int var_number)
+{
+	if (var_number < 1) {
+		return "invalid variable number";
+	}
+	if (var_number > MR_point.MR_point_var_count) {
+		return "there aren't that many variables";
+	}
+
+	return NULL;
 }
Index: trace/mercury_trace_vars.h
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_vars.h,v
retrieving revision 1.5
diff -u -r1.5 mercury_trace_vars.h
--- trace/mercury_trace_vars.h	2000/02/18 16:11:09	1.5
+++ trace/mercury_trace_vars.h	2000/02/20 05:49:29
@@ -17,10 +17,10 @@
 ** MR_trace_current_level returns this information, while enquiry function
 ** MR_trace_current_level_details returns information about this level.
 **
-** The five functions MR_trace_var_count, MR_trace_list_vars,
-** MR_trace_return_var_info, MR_trace_browse_one and MR_trace_browse_all
-** all work in the context established by the MR_trace_init_point_vars and
-** possibly MR_trace_set_level.
+** The six functions MR_trace_var_count, MR_trace_list_vars,
+** MR_trace_return_var_info, MR_trace_headvar_num, MR_trace_browse_one
+** and MR_trace_browse_all all work in the context established by the
+** MR_trace_init_point_vars and possibly MR_trace_set_level.
 **
 ** This context may say that there is no information available about
 ** the variables live at the current location (this is possible if the
@@ -84,6 +84,13 @@
 
 extern	const char	*MR_trace_return_var_info(int n, const char **name_ptr,
 				Word *type_info_ptr, Word *value_ptr);
+
+/*
+** If the variable specified by n is a head variable, then return
+** its argument position, otherwise return an error.
+*/
+
+extern	const char	*MR_trace_headvar_num(int n, int *num);
 
 /*
 ** Print the (names and) values of the specified variables.


New file tests/debugger/declarative/args.m:

:- module args.
:- interface.
:- import_module io.
:- pred main(io__state::di, io__state::uo) is cc_multi.
:- implementation.
:- import_module std_util, int.

main -->
	(
		{ p(1, X, 3, Y, 5) },
		{ my_fail }
	->
		io__write_int(X),
		io__nl,
		io__write_int(Y),
		io__nl
	;
		io__write_string("no.\n")
	).

:- pred p(int, int, int, int, int).
:- mode p(in, out, in, out, in) is nondet.

p(A, A + (B * C), B, (A + B) * C, C) :-
	my_succeed.
p(A, A - B, B, C - B, C) :-
	my_succeed.

	% The purpose of the following two procedures is to ensure
	% that the test cases work consistently in both debugging
	% and non-debugging grades.
	%
:- pred my_succeed is semidet.
my_succeed :-
	semidet_succeed.

:- pred my_fail is semidet.
my_fail :-
	semidet_fail.


New file tests/debugger/declarative/args.inp:

echo on
register --quiet
break p
continue
finish
dd
no
yes
yes
continue
finish
dd
no
yes
continue
finish
dd
no
yes
continue


New file tests/debugger/declarative/args.exp:

       1:      1  1 CALL pred args:main/2-0 (cc_multi) args.m:17
mdb> echo on
Command echo enabled.
mdb> register --quiet
mdb> break p
 0: + stop  interface pred args:p/5-0 (nondet)
mdb> continue
       3:      2  2 CALL pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> finish
       7:      2  2 EXIT pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> dd
p(1, 16, 3, 20, 5)
Valid? no
my_succeed
Valid? yes
Incorrect node found:
p(1, 16, 3, 20, 5)
Is this a bug? yes
       7:      2  2 EXIT pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> continue
      10:      2  2 REDO pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> finish
      14:      2  2 EXIT pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> dd
p(1, -2, 3, 2, 5)
Valid? no
Incorrect node found:
p(1, -2, 3, 2, 5)
Is this a bug? yes
      14:      2  2 EXIT pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> continue
      17:      2  2 REDO pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> finish
      18:      2  2 FAIL pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> dd
Call p(1, _, 3, _, 5)
Solutions:
	p(1, 16, 3, 20, 5)
	p(1, -2, 3, 2, 5)
Complete? no
Incorrect node found:
Call p(1, _, 3, _, 5)
Solutions:
	p(1, 16, 3, 20, 5)
	p(1, -2, 3, 2, 5)
Is this a bug? yes
      18:      2  2 FAIL pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> continue
no.


New file tests/debugger/declarative/args.exp2:

       1:      1  1 CALL pred args:main/2-0 (cc_multi) args.m:17
mdb> echo on
Command echo enabled.
mdb> register --quiet
mdb> break p
 0: + stop  interface pred args:p/5-0 (nondet)
mdb> continue
       3:      2  2 CALL pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> finish
       9:      2  2 EXIT pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> dd
p(1, 16, 3, 20, 5)
Valid? no
my_succeed
Valid? yes
Incorrect node found:
p(1, 16, 3, 20, 5)
Is this a bug? yes
       9:      2  2 EXIT pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> continue
      14:      2  2 REDO pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> finish
      20:      2  2 EXIT pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> dd
p(1, -2, 3, 2, 5)
Valid? no
Incorrect node found:
p(1, -2, 3, 2, 5)
Is this a bug? yes
      20:      2  2 EXIT pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> continue
      25:      2  2 REDO pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> finish
      26:      2  2 FAIL pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> dd
Call p(1, _, 3, _, 5)
Solutions:
	p(1, 16, 3, 20, 5)
	p(1, -2, 3, 2, 5)
Complete? no
Incorrect node found:
Call p(1, _, 3, _, 5)
Solutions:
	p(1, 16, 3, 20, 5)
	p(1, -2, 3, 2, 5)
Is this a bug? yes
      26:      2  2 FAIL pred args:p/5-0 (nondet) args.m:24 (args.m:10)
mdb> continue
no.

-- 
Mark Brown, PhD student            )O+  |  "Another of Fortran's breakthroughs
(m.brown at cs.mu.oz.au)                   |  was the GOTO statement, which was...
Dept. of Computer Science and Software  |  uniquely simple and understandable"
Engineering, University of Melbourne    |              -- IEEE, 1994
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list