for review: cleanup of tests/debugger

Zoltan Somogyi zs at cs.mu.OZ.AU
Thu Apr 15 20:22:48 AEST 1999


For review by Fergus.

Clean up the debugger tests directory by (a) removing the long obsolete
*_lib files, and (b) separating out the three roles of the queens.m
into mdb_command_test.m and interactive.m as well as queens.m.

tests/debugger/mdb_command_test.m:
	Add a trivial source file for this test. The other files of the test
	case (.inp, .exp) already existed.

tests/debugger/queens.{m,exp,inp}:
	Remove the tests of interactive functionality.

tests/debugger/interactive.{m,exp,inp}:
	A renamed copy of the old queens.m, with the interactive functionality
	intact. Note: since this test case is currently disabled, I cannot
	be sure that the .exp file may is quite correct in every detail.

tests/debugger/*_lib.*:
	Removed these obsolete test cases, since for a while now we have
	avoided depending on whether the library was compiled with tracing
	or not by leaving all library code to the end and not printing
	or stopping at any event inside library code.

tests/debugger/Mmakefile:
	Make the necessary updates to accommodate the above changes.

Zoltan.

cvs diff: Diffing .
Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/Mmakefile,v
retrieving revision 1.22
diff -u -b -u -r1.22 Mmakefile
--- Mmakefile	1999/04/12 05:35:23	1.22
+++ Mmakefile	1999/04/15 09:48:59
@@ -21,11 +21,13 @@
 	existential_type_classes	\
 	implied_instance		\
 	interpreter			\
-	multi_parameter
+	mdb_command_test		\
+	multi_parameter			\
+	queens
 
 # The following tests are disabled, since currently they get some spurious
 # failures if readline support is enabled:
-#	queens
+#	interactive
 
 MCFLAGS = --trace deep
 MLFLAGS = --trace
@@ -33,8 +35,8 @@
 
 # We need to use shared libraries for interactive queries to work.
 # The following is necessary for shared libraries to work on Linux.
-MGNUCFLAGS-queens = --pic-reg
-MLFLAGS-queens = --shared
+MGNUCFLAGS-interactive = --pic-reg
+MLFLAGS-interactive = --shared
 
 # Base grades `jump' and `fast' cannot be used with
 # stack layouts (which are required for tracing).
@@ -53,9 +55,6 @@
     endif
 endif
 
-LIBPROGS=	$(PROGS:%=%_lib)
-ALLPROGS=	$(PROGS)
-
 #-----------------------------------------------------------------------------#
 
 debugger_regs.out: debugger_regs debugger_regs.inp
@@ -77,19 +76,23 @@
 multi_parameter.out: multi_parameter multi_parameter.inp
 	$(MDB) ./multi_parameter < multi_parameter.inp \
 		> multi_parameter.out 2>&1
+
+queens.out: queens queens.inp
+	$(MDB) ./queens < queens.inp > queens.out 2>&1
 
-# Note that queens.out.orig depends on $(queens.ints) because queens.inp
-# contains interactive queries that require queens.ints to have been built.
-queens.out.orig: queens queens.inp $(queens.ints)
-	$(MDB) ./queens < queens.inp > queens.out.orig 2>&1
+# Note that interactive.out.orig depends on $(interactive.ints) because
+# interactive.inp contains interactive queries that require interactive.ints
+# to have been built.
+interactive.out.orig: interactive interactive.inp $(interactive.ints)
+	$(MDB) ./interactive < interactive.inp > interactive.out.orig 2>&1
 
 # We pipe the output through sed to remove some spurious warnings that
 # `ld' issues.
 # XXX we should fix the spurious warnings about unresolved symbols.
 # (The spurious warnings about exception handling are due to a flaw
 # in the Digital Unix 3.2 linker, so that one is DEC's problem.)
-queens.out: queens.out.orig
-	cat queens.out.orig | \
+interactive.out: interactive.out.orig
+	cat interactive.out.orig | \
 		sed \
 		    -e '/\/usr\/bin\/ld:$$/N' \
 		    -e 's/\/usr\/bin\/ld:.//' \
@@ -103,8 +106,8 @@
 		    -e 's/Warning: Unresolved:.//' \
 		    -e '/<predicate .main.\/2 mode 0>$$/N' \
 		    -e 's/<predicate .main.\/2 mode 0>.//' \
-		    -e '/<predicate .queens:qperm.\/2 mode 0>$$/N' \
-		    -e 's/<predicate .queens:qperm.\/2 mode 0>.//' \
+		    -e '/<predicate .interactive:qperm.\/2 mode 0>$$/N' \
+		    -e 's/<predicate .interactive:qperm.\/2 mode 0>.//' \
 		    -e '/__start$$/N' \
 		    -e 's/__start.//' \
 		    > queens.out
@@ -115,19 +118,17 @@
 
 # We ignore the result of this action because
 # the exit status of grep is not useful in this case
-mdb_command_test.out: queens mdb_command_test.inp
-	-$(MDB) ./queens < mdb_command_test.inp 2>&1 \
+mdb_command_test.out: mdb_command_test mdb_command_test.inp
+	-$(MDB) ./mdb_command_test < mdb_command_test.inp 2>&1 \
 		| egrep "internal error in the trace help system" \
 		> mdb_command_test.out
 
 #-----------------------------------------------------------------------------#
 
-DEPS=		$(ALLPROGS:%=$(deps_subdir)%.dep) queens.dep
-DEPENDS=	$(ALLPROGS:%=%.depend) queens.depend
+DEPS=		$(PROGS:%=$(deps_subdir)%.dep)
+DEPENDS=	$(PROGS:%=%.depend)
 OUTS=		$(PROGS:%=%.out)
-LIBOUTS=	$(LIBPROGS:%=%.out)
-RESS=		$(PROGS:%=%.res) mdb_command_test.res
-LIBRESS=	$(LIBPROGS:%=%.res) mdb_command_test.res
+RESS=		$(PROGS:%=%.res)
 
 #-----------------------------------------------------------------------------#
 
@@ -136,9 +137,7 @@
 depend:		$(DEPENDS)
 
 check:		$(OUTS) $(RESS)
-
-check_lib:	$(LIBOUTS) $(LIBRESS)
 
-all:		$(ALLPROGS)
+all:		$(PROGS)
 
 #-----------------------------------------------------------------------------#
Index: debugger_regs_lib.exp
===================================================================
RCS file: debugger_regs_lib.exp
diff -N debugger_regs_lib.exp
--- /tmp/cvs18207baa	Thu Apr 15 20:01:12 1999
+++ /dev/null	Wed May 28 10:49:58 1997
@@ -1,54 +0,0 @@
-       1:      1  1 CALL pred debugger_regs_lib:main/2-0 (det) 
-mdb> echo on
-Command echo enabled
-mdb> 
-       2:      2  2 CALL pred debugger_regs_lib:data/41-0 (det) 
-mdb> 
-       3:      2  2 EXIT pred debugger_regs_lib:data/41-0 (det) 
-mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
-       HeadVar__10          		a8
-       HeadVar__11          		a9
-       HeadVar__12          		b0
-       HeadVar__13          		b1
-       HeadVar__14          		b2
-       HeadVar__15          		b3
-       HeadVar__16          		b4
-       HeadVar__17          		b5
-       HeadVar__18          		b6
-       HeadVar__19          		b7
-       HeadVar__2           		a0
-       HeadVar__20          		b8
-       HeadVar__21          		b9
-       HeadVar__22          		c0
-       HeadVar__23          		c1
-       HeadVar__24          		c2
-       HeadVar__25          		c3
-       HeadVar__26          		c4
-       HeadVar__27          		c5
-       HeadVar__28          		c6
-       HeadVar__29          		c7
-       HeadVar__3           		a1
-       HeadVar__30          		c8
-       HeadVar__31          		c9
-       HeadVar__32          		d0
-       HeadVar__33          		d1
-       HeadVar__34          		d2
-       HeadVar__35          		d3
-       HeadVar__36          		d4
-       HeadVar__37          		d5
-       HeadVar__38          		d6
-       HeadVar__39          		d7
-       HeadVar__4           		a2
-       HeadVar__40          		d8
-       HeadVar__41          		d9
-       HeadVar__5           		a3
-       HeadVar__6           		a4
-       HeadVar__7           		a5
-       HeadVar__8           		a6
-       HeadVar__9           		a7
-mdb> continue
-a0a1a2a3a4a5a6a7a8a9
-b0b1b2b3b4b5b6b7b8b9
-c0c1c2c3c4c5c6c7c8c9
-d0d1d2d3d4d5d6d7d8d9
Index: debugger_regs_lib.inp
===================================================================
RCS file: debugger_regs_lib.inp
diff -N debugger_regs_lib.inp
--- /tmp/cvs18207caa	Thu Apr 15 20:01:12 1999
+++ /dev/null	Wed May 28 10:49:58 1997
@@ -1,5 +0,0 @@
-echo on
-
-
-print *
-continue
Index: debugger_regs_lib.m
===================================================================
RCS file: debugger_regs_lib.m
diff -N debugger_regs_lib.m
--- /tmp/cvs18207daa	Thu Apr 15 20:01:12 1999
+++ /dev/null	Wed May 28 10:49:58 1997
@@ -1,92 +0,0 @@
-% This program tests whether the tracer works for procedures with
-% lots of arguments (beyond NUM_REAL_REGS and MAX_REAL_REGS).
-% At the moment, MAX_REAL_REGS is 32, so a procedure with 41 args
-% is a full test.
-
-:- module debugger_regs_lib.
-
-:- interface.
-
-:- import_module io.
-
-:- pred main(io__state, io__state).
-:- mode main(di, uo) is det.
-
-:- implementation.
-
-:- import_module list, int.
-
-main -->
-	% The purpose of list is to force the tracer to call the Mercury
-	% code to print a list of integers, when the input script asks
-	% for the outputs of data to be printed. In the past this was
-	% sufficed to cause part of the C stack to be overwritten.
-	% It also tests whether the values of A0 etc that the tracer prints
-	% are derived from the register contents produced by data,
-	% or from the register contents left there by the code that
-	% prints _List.
-	{ data(_List,
-		A0, A1, A2, A3, A4, A5, A6, A7, A8, A9,
-		B0, B1, B2, B3, B4, B5, B6, B7, B8, B9,
-		C0, C1, C2, C3, C4, C5, C6, C7, C8, C9,
-		D0, D1, D2, D3, D4, D5, D6, D7, D8, D9) },
-	io__write_string(A0),
-	io__write_string(A1),
-	io__write_string(A2),
-	io__write_string(A3),
-	io__write_string(A4),
-	io__write_string(A5),
-	io__write_string(A6),
-	io__write_string(A7),
-	io__write_string(A8),
-	io__write_string(A9),
-	io__write_string("\n"),
-	io__write_string(B0),
-	io__write_string(B1),
-	io__write_string(B2),
-	io__write_string(B3),
-	io__write_string(B4),
-	io__write_string(B5),
-	io__write_string(B6),
-	io__write_string(B7),
-	io__write_string(B8),
-	io__write_string(B9),
-	io__write_string("\n"),
-	io__write_string(C0),
-	io__write_string(C1),
-	io__write_string(C2),
-	io__write_string(C3),
-	io__write_string(C4),
-	io__write_string(C5),
-	io__write_string(C6),
-	io__write_string(C7),
-	io__write_string(C8),
-	io__write_string(C9),
-	io__write_string("\n"),
-	io__write_string(D0),
-	io__write_string(D1),
-	io__write_string(D2),
-	io__write_string(D3),
-	io__write_string(D4),
-	io__write_string(D5),
-	io__write_string(D6),
-	io__write_string(D7),
-	io__write_string(D8),
-	io__write_string(D9),
-	io__write_string("\n").
-
-:- pred data(list(int)::out,
-	string::out, string::out, string::out, string::out, string::out,
-	string::out, string::out, string::out, string::out, string::out,
-	string::out, string::out, string::out, string::out, string::out,
-	string::out, string::out, string::out, string::out, string::out,
-	string::out, string::out, string::out, string::out, string::out,
-	string::out, string::out, string::out, string::out, string::out,
-	string::out, string::out, string::out, string::out, string::out,
-	string::out, string::out, string::out, string::out, string::out) is det.
-
-data([1, 2, 3, 4, 5],
-	"a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9",
-	"b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9",
-	"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9",
-	"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9").
Index: interactive.exp
===================================================================
RCS file: interactive.exp
diff -N interactive.exp
--- /dev/null	Wed May 28 10:49:58 1997
+++ interactive.exp	Thu Apr 15 19:55:56 1999
@@ -0,0 +1,277 @@
+       1:      1  1 CALL pred interactive:main/2-0 (cc_multi) 
+mdb> echo on
+Command echo enabled.
+mdb> print *
+       HeadVar__1           		state('<<c_pointer>>')
+mdb> 
+       2:      2  2 CALL pred interactive:data/1-0 (det) 
+mdb> print *
+mdb: there are no live variables.
+mdb> 
+       3:      2  2 EXIT pred interactive:data/1-0 (det) 
+mdb> print *
+       HeadVar__1           		[1, 2, 3, 4, 5]
+mdb> 
+       4:      3  2 CALL pred interactive:queen/2-0 (nondet) 
+mdb> print *
+       HeadVar__1           		[1, 2, 3, 4, 5]
+mdb> 
+       5:      4  3 CALL pred interactive:qperm/2-0 (nondet) 
+mdb> print *
+       HeadVar__1           		[1, 2, 3, 4, 5]
+mdb> 
+       6:      4  3 SWTC pred interactive:qperm/2-0 (nondet) s1;
+mdb> print *
+       HeadVar__1           		[1, 2, 3, 4, 5]
+mdb> 
+       7:      5  4 CALL pred interactive:qdelete/3-0 (nondet) 
+mdb> print *
+       HeadVar__2           		[1, 2, 3, 4, 5]
+mdb> 
+       8:      5  4 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1;
+mdb> print *
+       HeadVar__2           		[1, 2, 3, 4, 5]
+       V_10                 		[2, 3, 4, 5]
+       V_11                 		1
+mdb> level 1
+   1       5       4    3 pred interactive:qperm/2-0 (nondet) 
+Ancestor level set to 1.
+mdb> print *
+       HeadVar__1           		[1, 2, 3, 4, 5]
+mdb> up 1
+   2       4       3    2 pred interactive:queen/2-0 (nondet) 
+Ancestor level set to 2.
+mdb> vars
+        0 HeadVar__1
+mdb> print *
+       HeadVar__1           		[1, 2, 3, 4, 5]
+mdb> 
+       9:      5  4 EXIT pred interactive:qdelete/3-0 (nondet) 
+mdb> print HeadVar__1
+       HeadVar__1           		1
+mdb> print HeadVar__2
+       HeadVar__2           		[1, 2, 3, 4, 5]
+mdb> print HeadVar__3
+       HeadVar__3           		[2, 3, 4, 5]
+mdb> 
+      10:      6  4 CALL pred interactive:qperm/2-0 (nondet) 
+mdb> print *
+       HeadVar__1           		[2, 3, 4, 5]
+mdb> 
+      11:      6  4 SWTC pred interactive:qperm/2-0 (nondet) s1;
+mdb> print *
+       HeadVar__1           		[2, 3, 4, 5]
+mdb> 
+      12:      7  5 CALL pred interactive:qdelete/3-0 (nondet) 
+mdb> print *
+       HeadVar__2           		[2, 3, 4, 5]
+mdb> 
+      13:      7  5 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1;
+mdb> print *
+       HeadVar__2           		[2, 3, 4, 5]
+       V_10                 		[3, 4, 5]
+       V_11                 		2
+mdb> 
+      14:      7  5 EXIT pred interactive:qdelete/3-0 (nondet) 
+mdb> print *
+       HeadVar__1           		2
+       HeadVar__2           		[2, 3, 4, 5]
+       HeadVar__3           		[3, 4, 5]
+mdb> 
+      15:      8  5 CALL pred interactive:qperm/2-0 (nondet) 
+mdb> goto -a 20
+      16:      8  5 SWTC pred interactive:qperm/2-0 (nondet) s1;
+      17:      9  6 CALL pred interactive:qdelete/3-0 (nondet) 
+      18:      9  6 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1;
+      19:      9  6 EXIT pred interactive:qdelete/3-0 (nondet) 
+      20:     10  6 CALL pred interactive:qperm/2-0 (nondet) 
+mdb> stack
+   0    4* pred interactive:qperm/2-0 (nondet)
+   4       pred interactive:queen/2-0 (nondet)
+   5       pred interactive:main/2-0 (cc_multi)
+mdb> stack -d
+   0      20      10    6 pred interactive:qperm/2-0 (nondet)
+   1      15       8    5 pred interactive:qperm/2-0 (nondet)
+   2      10       6    4 pred interactive:qperm/2-0 (nondet)
+   3       5       4    3 pred interactive:qperm/2-0 (nondet)
+   4       4       3    2 pred interactive:queen/2-0 (nondet)
+   5       1       1    1 pred interactive:main/2-0 (cc_multi)
+mdb> print *
+       HeadVar__1           		[4, 5]
+mdb> #
+Unknown command `#'. Give the command `help' for help.
+mdb> # Test interactive queries.
+Unknown command `#'. Give the command `help' for help.
+mdb> #
+Unknown command `#'. Give the command `help' for help.
+mdb> mmc_options --use-subdirs
+mdb> mmc_options
+mdb> query queens list
+?- <stdin>:026: Inferred :- pred query((list:list(character)), (list:list(character))).
+<stdin>:026: Inferred :- mode query(out, out) is multi.
+X = [], Y = ['a', 'b', 'c'], true ;
+X = ['a'], Y = ['b', 'c'], true ;
+X = ['a', 'b'], Y = ['c'], true ;
+X = ['a', 'b', 'c'], Y = [], true ;
+fail.
+No (more) solutions.
+?- <stdin>:026: Inferred :- pred query((list:list(int))).
+<stdin>:026: Inferred :- mode query(out) is nondet.
+List = [1, 2, 3], true ;
+List = [1, 3, 2], true ;
+List = [2, 1, 3], true ;
+List = [2, 3, 1], true ;
+List = [3, 1, 2], true ;
+List = [3, 2, 1], true ;
+fail.
+No (more) solutions.
+?- <stdin>:012: In clause for predicate `query:run/2':
+<stdin>:012:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:014: In clause for predicate `query:run/2':
+<stdin>:014:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:012: In clause for predicate `query:run/2':
+<stdin>:012:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:015: In clause for predicate `query:run/2':
+<stdin>:015:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:026: In clause for predicate `query:query/2':
+<stdin>:026:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:001: In clause for predicate `query:query/2':
+<stdin>:001:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:026: Inferred :- pred query((list:list(int)), (list:list(int))).
+<stdin>:026: Inferred :- mode query(out, out) is nondet.
+List = [2, 1, 3], _2 = [1, 3], true ;
+List = [2, 3, 1], _2 = [3, 1], true ;
+fail.
+No (more) solutions.
+?- <stdin>:012: In clause for predicate `query:run/2':
+<stdin>:012:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:014: In clause for predicate `query:run/2':
+<stdin>:014:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:012: In clause for predicate `query:run/2':
+<stdin>:012:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:015: In clause for predicate `query:run/2':
+<stdin>:015:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:026: In clause for predicate `query:query/2':
+<stdin>:026:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:001: In clause for predicate `query:query/2':
+<stdin>:001:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:026: Inferred :- pred query((list:list(int)), (list:list(int))).
+<stdin>:026: Inferred :- mode query(out, out) is nondet.
+fail.
+No (more) solutions.
+?- <stdin>:001: In clause for predicate `query:query/1':
+<stdin>:001:   in argument 1 of call to predicate `qperm/2':
+<stdin>:001:   in argument 2 of functor `./2':
+<stdin>:001:   in argument 2 of functor `./2':
+<stdin>:001:   in argument 1 of functor `./2':
+<stdin>:001:   type error in unification of argument
+<stdin>:001:   and constant `"foo"'.
+<stdin>:001:   argument has type `int',
+<stdin>:001:   constant `"foo"' has type `string'.
+For more information, try recompiling with `-E'.
+Compilation error(s) occurred.
+?- <stdin>:026: Inferred :- pred query((list:list(int))).
+<stdin>:001: In clause for `query(out(not_reached))':
+<stdin>:001:   in argument 1 of call to predicate `interactive:qperm/2':
+<stdin>:001:   mode error: variable `List' has instantiatedness `free',
+<stdin>:001:   expected instantiatedness was `ground'.
+<stdin>:026: Inferred :- mode query(out(free)).
+For more information, try recompiling with `-E'.
+Compilation error(s) occurred.
+?- 
+mdb>  cc_query queens list
+?- <stdin>:017: Inferred :- pred query((list:list(character)), (list:list(character))).
+<stdin>:017: Inferred :- mode query(out, out) is multi.
+X = [], Y = ['a', 'b', 'c'], true.
+?- <stdin>:017: Inferred :- pred query((list:list(int))).
+<stdin>:017: Inferred :- mode query(out) is nondet.
+List = [1, 2, 3], true.
+?- <stdin>:011: In clause for predicate `query:run/2':
+<stdin>:011:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:012: In clause for predicate `query:run/2':
+<stdin>:012:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:017: In clause for predicate `query:query/2':
+<stdin>:017:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:001: In clause for predicate `query:query/2':
+<stdin>:001:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:017: Inferred :- pred query((list:list(int)), (list:list(int))).
+<stdin>:017: Inferred :- mode query(out, out) is nondet.
+List = [2, 1, 3], _2 = [1, 3], true.
+?- <stdin>:011: In clause for predicate `query:run/2':
+<stdin>:011:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:012: In clause for predicate `query:run/2':
+<stdin>:012:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:017: In clause for predicate `query:query/2':
+<stdin>:017:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:001: In clause for predicate `query:query/2':
+<stdin>:001:   warning: variable `_2' occurs more than once in this scope.
+<stdin>:017: Inferred :- pred query((list:list(int)), (list:list(int))).
+<stdin>:017: Inferred :- mode query(out, out) is nondet.
+No solution.
+?- 
+mdb>  io_query queens list
+run <-- [1, 3, 5, 2, 4]
+run <-- X = [], Y = ['a', 'b', 'c']
+run <-- [1, 2, 3]
+run <-- [2, 1, 3]
+run <-- No solution, as expected.
+run <-- 
+mdb> 
+      21:     10  6 SWTC pred interactive:qperm/2-0 (nondet) s1;
+mdb> retry
+      34:     10  6 EXIT pred interactive:qperm/2-0 (nondet) 
+retry
+      20:     10  6 CALL pred interactive:qperm/2-0 (nondet) 
+mdb> print *
+       HeadVar__1           		[4, 5]
+mdb> finish -a
+      21:     10  6 SWTC pred interactive:qperm/2-0 (nondet) s1;
+      22:     11  7 CALL pred interactive:qdelete/3-0 (nondet) 
+      23:     11  7 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1;
+      24:     11  7 EXIT pred interactive:qdelete/3-0 (nondet) 
+      25:     12  7 CALL pred interactive:qperm/2-0 (nondet) 
+      26:     12  7 SWTC pred interactive:qperm/2-0 (nondet) s1;
+      27:     13  8 CALL pred interactive:qdelete/3-0 (nondet) 
+      28:     13  8 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1;
+      29:     13  8 EXIT pred interactive:qdelete/3-0 (nondet) 
+      30:     14  8 CALL pred interactive:qperm/2-0 (nondet) 
+      31:     14  8 SWTC pred interactive:qperm/2-0 (nondet) s2;
+      32:     14  8 EXIT pred interactive:qperm/2-0 (nondet) 
+      33:     12  7 EXIT pred interactive:qperm/2-0 (nondet) 
+      34:     10  6 EXIT pred interactive:qperm/2-0 (nondet) 
+mdb> register --quiet
+mdb> break print_list
+ 0: + stop  interface pred interactive:print_list/3-0 (det)
+mdb> break qdelete
+ 1: + stop  interface pred interactive:qdelete/3-0 (nondet)
+mdb> continue -a
+      35:      8  5 EXIT pred interactive:qperm/2-0 (nondet) 
+      36:      6  4 EXIT pred interactive:qperm/2-0 (nondet) 
+      37:      4  3 EXIT pred interactive:qperm/2-0 (nondet) 
+      38:     15  3 CALL pred interactive:safe/1-0 (semidet) 
+      39:     15  3 SWTC pred interactive:safe/1-0 (semidet) s1;
+      40:     16  4 CALL pred interactive:nodiag/3-0 (semidet) 
+      41:     16  4 SWTC pred interactive:nodiag/3-0 (semidet) s1;
+      42:     16  4 THEN pred interactive:nodiag/3-0 (semidet) s1;c4;t;
+      43:     16  4 FAIL pred interactive:nodiag/3-0 (semidet) 
+      44:     15  3 FAIL pred interactive:safe/1-0 (semidet) 
+      45:      4  3 REDO pred interactive:qperm/2-0 (nondet) 
+      46:      6  4 REDO pred interactive:qperm/2-0 (nondet) 
+      47:      8  5 REDO pred interactive:qperm/2-0 (nondet) 
+      48:     10  6 REDO pred interactive:qperm/2-0 (nondet) 
+      49:     12  7 REDO pred interactive:qperm/2-0 (nondet) 
+      50:     14  8 REDO pred interactive:qperm/2-0 (nondet) 
+      51:     14  8 FAIL pred interactive:qperm/2-0 (nondet) 
+      52:     13  8 REDO pred interactive:qdelete/3-0 (nondet) 
+mdb> step -aS 5
+      53:     13  8 DISJ pred interactive:qdelete/3-0 (nondet) c2;d2;
+      54:     17  9 CALL pred interactive:qdelete/3-0 (nondet) 
+      55:     17  9 FAIL pred interactive:qdelete/3-0 (nondet) 
+      56:     13  8 FAIL pred interactive:qdelete/3-0 (nondet) 
+      57:     12  7 FAIL pred interactive:qperm/2-0 (nondet) 
+mdb> disable 1
+ 1: - stop  interface pred interactive:qdelete/3-0 (nondet)
+mdb> continue -n
+     675:    141  2 CALL pred interactive:print_list/3-0 (det) 
+mdb> continue -n -S
+[1, 3, 5, 2, 4]
Index: interactive.inp
===================================================================
RCS file: interactive.inp
diff -N interactive.inp
--- /dev/null	Wed May 28 10:49:58 1997
+++ interactive.inp	Thu Apr 15 19:52:02 1999
@@ -0,0 +1,80 @@
+echo on
+print *
+
+print *
+
+print *
+
+print *
+
+print *
+
+print *
+
+print *
+
+print *
+level 1
+print *
+up 1
+vars
+print *
+
+print HeadVar__1
+print HeadVar__2
+print HeadVar__3
+
+print *
+
+print *
+
+print *
+
+print *
+
+print *
+
+goto -a 20
+stack
+stack -d
+print *
+#
+# Test interactive queries.
+#
+mmc_options --use-subdirs
+mmc_options
+query queens list
+append(X, Y, ['a', 'b', 'c']).
+qperm([1,2,3], List).
+qperm([1,2,3], List), List = [2 | _].
+qperm([1,2,3], List), List = [4 | _].
+qperm([1,2,"foo"], List).
+qperm(List, [1]).
+quit. cc_query queens list
+append(X, Y, ['a', 'b', 'c']).
+qperm([1,2,3], List).
+qperm([1,2,3], List), List = [2 | _].
+qperm([1,2,3], List), List = [4 | _].
+quit. io_query queens list
+main.
+if { append(X, Y, ['a', 'b', 'c']) } then
+	print("X = "), print(X), 
+	print(", Y = "), print(Y), nl
+else
+	print("No solution\n").
+if { qperm([1,2,3], List) } then print(List), nl else [].
+if { qperm([1,2,3], List), List = [2 | _] } then print(List), nl else { true }.
+if { qperm([1,2,3], List), List = [4 | _] } then print(List), nl
+else print("No solution, as expected."), io__nl.
+quit.
+retry
+print *
+finish -a
+register --quiet
+break print_list
+break qdelete
+continue -a
+step -aS 5
+disable 1
+continue -n
+continue -n -S
Index: interactive.m
===================================================================
RCS file: interactive.m
diff -N interactive.m
--- /dev/null	Wed May 28 10:49:58 1997
+++ interactive.m	Thu Apr 15 19:57:12 1999
@@ -0,0 +1,102 @@
+:- module interactive.
+
+:- interface.
+
+:- import_module io, list.
+
+:- pred main(io__state, io__state).
+:- mode main(di, uo) is cc_multi.
+
+	% exported for use with interactive queries in the debugger
+:- pred qperm(list(T), list(T)).
+:- mode qperm(in, out) is nondet.
+
+:- implementation.
+
+:- import_module list, int.
+
+main -->
+	( { data(Data), queen(Data, Out) } ->
+		print_list(Out)
+	;
+		io__write_string("No solution\n")
+	).
+
+:- pred data(list(int)).
+:- mode data(out) is det.
+
+:- pred queen(list(int), list(int)).
+:- mode queen(in, out) is nondet.
+
+:- pred qdelete(T, list(T), list(T)).
+:- mode qdelete(out, in, out) is nondet.
+
+:- pred safe(list(int)).
+:- mode safe(in) is semidet.
+
+:- pred nodiag(int, int, list(int)).
+:- mode nodiag(in, in, in) is semidet.
+
+data([1,2,3,4,5]).
+
+queen(Data, Out) :-
+	qperm(Data, Out),
+	safe(Out).
+
+qperm([], []).
+qperm([X|Y], K) :-
+	qdelete(U, [X|Y], Z),
+	K = [U|V],
+	qperm(Z, V).
+
+qdelete(A, [A|L], L).
+qdelete(X, [A|Z], [A|R]) :-
+	qdelete(X, Z, R).
+
+safe([]).
+safe([N|L]) :-
+	nodiag(N, 1, L),
+	safe(L).
+
+nodiag(_, _, []).
+nodiag(B, D, [N|L]) :-
+	NmB is N - B,
+	BmN is B - N,
+	( D = NmB ->
+		fail
+	; D = BmN ->
+		fail
+	;
+		true
+	),
+	D1 is D + 1,
+	nodiag(B, D1, L).
+
+:- pred print_list(list(int), io__state, io__state).
+:- mode print_list(in, di, uo) is det.
+
+print_list(Xs) -->
+	(
+		{ Xs = [] }
+	->
+		io__write_string("[]\n")
+	;
+		io__write_string("["),
+		print_list_2(Xs),
+		io__write_string("]\n")
+	).
+
+:- pred print_list_2(list(int), io__state, io__state).
+:- mode print_list_2(in, di, uo) is det.
+
+print_list_2([]) --> [].
+print_list_2([X|Xs]) --> 
+	io__write_int(X),
+	(
+		{ Xs = [] }
+	->
+		[]
+	;
+		io__write_string(", "),
+		print_list_2(Xs)
+	).
Index: interpreter_lib.exp
===================================================================
RCS file: interpreter_lib.exp
diff -N interpreter_lib.exp
--- /tmp/cvs18207eaa	Thu Apr 15 20:01:14 1999
+++ /dev/null	Wed May 28 10:49:58 1997
@@ -1,41 +0,0 @@
-       1:      1  1 CALL pred interpreter_lib:main/2-0 (det) 
-mdb> echo on
-Command echo enabled
-mdb> 45step
-Pure Prolog Interpreter.
-
-Consulting file `interpreter_lib.m'...
-      46:     21  5 CALL pred term_io:read_term/3-0 (det) 
-mdb> vars
-        0 HeadVar__2
-mdb> print *
-       HeadVar__2           		state('<<c_pointer>>')
-mdb> break database_assert_clause
-Registering all debuggable procedures... done
- 0: + stop  interface pred interpreter_lib:database_assert_clause/4-0 (det)
-mdb> continue
-   13446:   5011  6 CALL pred interpreter_lib:database_assert_clause/4-0 (det) 
-mdb> print *
-       HeadVar__1           		[]
-       HeadVar__2           		varset(0, empty, empty)
-       HeadVar__3           		functor(atom(":-"), [functor(atom("module"), [functor(atom("interpreter_lib"), [], context("interpreter_lib.m", 22))], context("interpreter_lib.m", 22))], context("interpreter_lib.m", 22))
-mdb> finish -a
-   13447:   5011  6 ELSE pred interpreter_lib:database_assert_clause/4-0 (det) e;
-   13448:   5012  7 CALL pred term:context_init/1-0 (det) 
-   13449:   5012  7 EXIT pred term:context_init/1-0 (det) 
-   13450:   5011  6 EXIT pred interpreter_lib:database_assert_clause/4-0 (det) 
-mdb> print *
-       HeadVar__1           		[]
-       HeadVar__2           		varset(0, empty, empty)
-       HeadVar__3           		functor(atom(":-"), [functor(atom("module"), [functor(atom("interpreter_lib"), [], context("interpreter_lib.m", 22))], context("interpreter_lib.m", 22))], context("interpreter_lib.m", 22))
-       HeadVar__4           		[clause(varset(0, empty, empty), functor(atom(":-"), [functor(atom("module"), [functor(atom("interpreter_lib"), [], context("interpreter_lib.m", 22))], context("interpreter_lib.m", 22))], context("interpreter_lib.m", 22)), functor(atom("true"), [], context("", 0)))]
-mdb> 
-   13451:   5013  6 CALL pred interpreter_lib:consult_until_eof/4-0 (det) 
-mdb> finish -n
-  368828:   5013  6 EXIT pred interpreter_lib:consult_until_eof/4-0 (det) 
-mdb> 
-  368829:   5010  5 EXIT pred interpreter_lib:consult_until_eof_2/5-0 (det) 
-mdb> 
-  368830:     20  4 EXIT pred interpreter_lib:consult_until_eof/4-0 (det) 
-mdb> continue -S
-?- 
\ No newline at end of file
Index: interpreter_lib.inp
===================================================================
RCS file: interpreter_lib.inp
diff -N interpreter_lib.inp
--- /tmp/cvs18207faa	Thu Apr 15 20:01:14 1999
+++ /dev/null	Wed May 28 10:49:58 1997
@@ -1,15 +0,0 @@
-echo on
-register --quiet
-45step
-vars
-print *
-break database_assert_clause
-continue
-print *
-finish -a
-print *
-
-finish -n
-
-
-continue -S
Index: interpreter_lib.m
===================================================================
RCS file: interpreter_lib.m
diff -N interpreter_lib.m
--- /tmp/cvs18207gaa	Thu Apr 15 20:01:14 1999
+++ /dev/null	Wed May 28 10:49:58 1997
@@ -1,373 +0,0 @@
-%-----------------------------------------------------------------------------%
-
-% File: interpreter_lib.m.
-% Main author: fjh.
-
-% This is an interpreter for definite logic programs
-% (i.e. pure Prolog with no negation or if-then-else.)
-%
-% This is just intended as a demonstration of the use of the
-% meta-programming library modules term, varset, and term_io.
-
-% There are many extensions/improvements that could be made;
-% they're left as an exercise for the reader.
-
-% For a more efficient version (using backtrackable destructive update),
-% see extras/trailed_update/samples/interpreter.m.
-
-% This source file is hereby placed in the public domain.  -fjh (the author).
-
-%-----------------------------------------------------------------------------%
-
-:- module interpreter_lib.
-:- interface.
-:- import_module io.
-
-:- pred main(io__state, io__state).
-:- mode main(di, uo) is det.
-
-%-----------------------------------------------------------------------------%
-
-:- implementation.
-:- import_module list, string, term, varset, term_io, require, std_util.
-
-main -->
-	io__write_string("Pure Prolog Interpreter.\n\n"),
-	io__command_line_arguments(Args),
-	( { Args = [] } ->
-		io__stderr_stream(StdErr),
-		io__write_string(StdErr, "Usage: interpreter filename ...\n"),
-		io__set_exit_status(1)
-	;
-		{ database_init(Database0) },
-		consult_list(Args, Database0, Database),
-		main_loop(Database)
-	).
-
-:- pred main_loop(database, io__state, io__state).
-:- mode main_loop(in, di, uo) is det.
-
-main_loop(Database) -->
-	io__write_string("?- "),
-	term_io__read_term(ReadTerm),
-	main_loop_2(ReadTerm, Database).
-
-:- pred main_loop_2(read_term, database, io__state, io__state).
-:- mode main_loop_2(in, in, di, uo) is det.
-
-main_loop_2(eof, _Database) --> [].
-main_loop_2(error(ErrorMessage, LineNumber), Database) -->
-	io__write_string("Error reading term at line "),
-	io__write_int(LineNumber),
-	io__write_string(" of standard input: "),
-	io__write_string(ErrorMessage),
-	io__write_string("\n"),
-	main_loop(Database).
-main_loop_2(term(VarSet0, Goal), Database) -->
-	%%% It would be a good idea to add some special commands
-	%%% with side-effects (such as `consult' and `listing');
-	%%% these could be identified and processed here.
-	{ solutions(solve(Database, Goal, VarSet0), Solutions) },
-	write_solutions(Solutions, Goal),
-	main_loop(Database).
-
-:- pred write_solutions(list(varset), term, io__state, io__state).
-:- mode write_solutions(in, in, di, uo) is det.
-
-write_solutions(Solutions, Goal) -->
-	( { Solutions = [] } ->
-		io__write_string("No.\n")
-	;
-		write_solutions_2(Solutions, Goal),
-		io__write_string("Yes.\n")
-	).
-
-:- pred write_solutions_2(list(varset), term, io__state, io__state).
-:- mode write_solutions_2(in, in, di, uo) is det.
-
-write_solutions_2([], _) --> [].
-write_solutions_2([VarSet | VarSets], Goal) -->
-	term_io__write_term_nl(VarSet, Goal),
-	write_solutions_2(VarSets, Goal).
-
-%-----------------------------------------------------------------------------%
-
-:- pred consult_list(list(string), database, database, io__state, io__state).
-:- mode consult_list(in, in, out, di, uo) is det.
-
-consult_list([], Database, Database) --> [].
-consult_list([File | Files], Database0, Database) -->
-	consult(File, Database0, Database1),
-	consult_list(Files, Database1, Database).
-
-:- pred consult(string, database, database, io__state, io__state).
-:- mode consult(in, in, out, di, uo) is det.
-
-consult(File, Database0, Database) -->
-	io__write_string("Consulting file `"),
-	io__write_string(File),
-	io__write_string("'...\n"),
-	io__see(File, Result),
-	( { Result = ok } ->
-		consult_until_eof(Database0, Database),
-		io__seen
-	;
-		io__write_string("Error opening file `"),
-		io__write_string(File),
-		io__write_string("' for input.\n"),
-		{ Database = Database0 }
-	).
-
-:- pred consult_until_eof(database, database, io__state, io__state).
-:- mode consult_until_eof(in, out, di, uo) is det.
-
-consult_until_eof(Database0, Database) -->
-	term_io__read_term(ReadTerm),
-	consult_until_eof_2(ReadTerm, Database0, Database).
-
-:- pred consult_until_eof_2(read_term, database, database,
-				io__state, io__state).
-:- mode consult_until_eof_2(in, in, out, di, uo) is det.
-
-consult_until_eof_2(eof, Database, Database) --> [].
-
-consult_until_eof_2(error(ErrorMessage, LineNumber), Database0, Database) -->
-	io__write_string("Error reading term at line "),
-	io__write_int(LineNumber),
-	io__write_string(" of standard input: "),
-	io__write_string(ErrorMessage),
-	io__write_string("\n"),
-	consult_until_eof(Database0, Database).
-
-consult_until_eof_2(term(VarSet, Term), Database0, Database) -->
-	{ database_assert_clause(Database0, VarSet, Term, Database1) },
-	consult_until_eof(Database1, Database).
-
-%-----------------------------------------------------------------------------%
-
-% Solve takes a database of rules and facts, a goal to be solved,
-% and a varset (which includes a supply of fresh vars, a substitution,
-% and names for [some subset of] the variables).  It updates
-% the varset, producing a new substitution and perhaps introducing
-% some new vars, and returns the result.
-
-% Goals are stored just as terms.
-% (It might be more efficient to parse them 
-% before storing them in the database.  Currently we do
-% this parsing work every time we interpret a clause.)
-
-:- pred solve(database, term, varset, varset).
-:- mode solve(in, in, in, out) is nondet.
-
-solve(_Database, term__functor(term__atom("true"), [], _)) --> [].
-
-solve(Database, term__functor(term__atom(","), [A, B], _)) -->
-	solve(Database, A),
-	solve(Database, B).
-
-solve(Database, term__functor(term__atom(";"), [A, B], _)) -->
-	solve(Database, A)
-	;
-	solve(Database, B).
-
-solve(_Database, term__functor(term__atom("="), [A, B], _)) -->
-	unify(A, B).
-
-solve(Database, Goal) -->
-	{ database_lookup_clause(Database, Goal, ClauseVarSet, Head0, Body0) },
-	rename_apart(ClauseVarSet, [Head0, Body0], [Head, Body]),
-	unify(Goal, Head),
-	solve(Database, Body).
-
-%-----------------------------------------------------------------------------%
-
-:- pred rename_apart(varset, list(term), list(term), varset, varset).
-:- mode rename_apart(in, in, out, in, out) is det.
-
-rename_apart(NewVarSet, Terms0, Terms, VarSet0, VarSet) :-
-	varset__merge(VarSet0, NewVarSet, Terms0, VarSet, Terms).
-
-%-----------------------------------------------------------------------------%
-
-% The standard library module `term' contains routines for
-% unifying terms based on separate substitutions, but we are
-% using the substitutions that are contained in the `varset',
-% so we can't use those versions.
-
-:- pred unify(term, term, varset, varset).
-:- mode unify(in, in, in, out) is semidet.
-
-unify(term__variable(X), term__variable(Y), VarSet0, VarSet) :-
-	(
-		varset__search_var(VarSet0, X, BindingOfX)
-	->
-		(
-			varset__search_var(VarSet0, Y, BindingOfY)
-		->
-			% both X and Y already have bindings - just
-			% unify the terms they are bound to
-			unify(BindingOfX, BindingOfY, VarSet0, VarSet)
-		;
-			% Y is a variable which hasn't been bound yet
-			apply_rec_substitution(BindingOfX, VarSet0,
-				SubstBindingOfX),
-			( SubstBindingOfX = term__variable(Y) ->
-			 	VarSet = VarSet0
-			;
-				\+ occurs(SubstBindingOfX, Y, VarSet0),
-				varset__bind_var(VarSet0, Y, SubstBindingOfX,
-					VarSet)
-			)
-		)
-	;
-		(
-			varset__search_var(VarSet0, Y, BindingOfY2)
-		->
-			% X is a variable which hasn't been bound yet
-			apply_rec_substitution(BindingOfY2, VarSet0,
-				SubstBindingOfY2),
-			( SubstBindingOfY2 = term__variable(X) ->
-				VarSet = VarSet0
-			;
-				\+ occurs(SubstBindingOfY2, X, VarSet0),
-				varset__bind_var(VarSet0, X, SubstBindingOfY2,
-					VarSet)
-			)
-		;
-			% both X and Y are unbound variables -
-			% bind one to the other
-			( X = Y ->
-				VarSet = VarSet0
-			;
-				varset__bind_var(VarSet0, X, term__variable(Y),
-					VarSet)
-			)
-		)
-	).
-
-unify(term__variable(X), term__functor(F, As, C), VarSet0, VarSet) :-
-	(
-		varset__search_var(VarSet0, X, BindingOfX)
-	->
-		unify(BindingOfX, term__functor(F, As, C), VarSet0,
-			VarSet)
-	;
-		\+ occurs_list(As, X, VarSet0),
-		varset__bind_var(VarSet0, X, term__functor(F, As, C), VarSet)
-	).
-
-unify(term__functor(F, As, C), term__variable(X), VarSet0, VarSet) :-
-	(
-		varset__search_var(VarSet0, X, BindingOfX)
-	->
-		unify(term__functor(F, As, C), BindingOfX, VarSet0,
-			VarSet)
-	;
-		\+ occurs_list(As, X, VarSet0),
-		varset__bind_var(VarSet0, X, term__functor(F, As, C), VarSet)
-	).
-
-unify(term__functor(F, AsX, _), term__functor(F, AsY, _)) -->
-	unify_list(AsX, AsY).
-
-:- pred unify_list(list(term), list(term), varset, varset).
-:- mode unify_list(in, in, in, out) is semidet.
-
-unify_list([], []) --> [].
-unify_list([X | Xs], [Y | Ys]) -->
-	unify(X, Y),
-	unify_list(Xs, Ys).
-
-%-----------------------------------------------------------------------------%
-
-	% occurs(Term, Var, Subst) succeeds if Term contains Var,
-	% perhaps indirectly via the substitution.  (The variable must
-	% not be mapped by the substitution.)
-
-:- pred occurs(term, var, varset).
-:- mode occurs(in, in, in) is semidet.
-
-occurs(term__variable(X), Y, VarSet) :-
-	X = Y
-	;
-	varset__search_var(VarSet, X, BindingOfX),
-	occurs(BindingOfX, Y, VarSet).
-occurs(term__functor(_F, As, _), Y, VarSet) :-
-	occurs_list(As, Y, VarSet).
-
-:- pred occurs_list(list(term), var, varset).
-:- mode occurs_list(in, in, in) is semidet.
-
-occurs_list([Term | Terms], Y, VarSet) :-
-	occurs(Term, Y, VarSet)
-	;
-	occurs_list(Terms, Y, VarSet).
-
-%-----------------------------------------------------------------------------%
-
-%	apply_rec_substitution(Term0, VarSet, Term) :
-%		recursively apply substitution to Term0 until
-%		no more substitions can be applied, and then
-%		return the result in Term.
-
-:- pred apply_rec_substitution(term, varset, term).
-:- mode apply_rec_substitution(in, in, out) is det.
-
-apply_rec_substitution(term__variable(Var), VarSet, Term) :-
-	(
-		varset__search_var(VarSet, Var, Replacement)
-	->
-		% recursively apply the substition to the replacement
-		apply_rec_substitution(Replacement, VarSet, Term)
-	;
-		Term = term__variable(Var)
-	).
-apply_rec_substitution(term__functor(Name, Args0, Context), VarSet,
-		 term__functor(Name, Args, Context)) :-
-	apply_rec_substitution_to_list(Args0, VarSet, Args).
-
-:- pred apply_rec_substitution_to_list(list(term), varset, list(term)).
-:- mode apply_rec_substitution_to_list(in, in, out) is det.
-
-apply_rec_substitution_to_list([], _VarSet, []).
-apply_rec_substitution_to_list([Term0 | Terms0], VarSet,
-		[Term | Terms]) :-
-	apply_rec_substitution(Term0, VarSet, Term),
-	apply_rec_substitution_to_list(Terms0, VarSet, Terms).
-
-%-----------------------------------------------------------------------------%
-
-% We store the database just as a list of clauses.
-% (It would be more realistic to index this on the predicate name/arity
-% and subindex on the name/arity of the first argument.)
-
-:- type database == list(clause).
-:- type clause ---> clause(varset, term, term).
-
-:- pred database_init(database).
-:- mode database_init(out) is det.
-
-database_init([]).
-
-:- pred database_assert_clause(database, varset, term, database).
-:- mode database_assert_clause(in, in, in, out) is det.
-
-database_assert_clause(Database, VarSet, Term, [Clause | Database]) :-
-	( Term = term__functor(term__atom(":-"), [H, B], _) ->
-		Head = H,
-		Body = B
-	;
-		Head = Term,
-		term__context_init(Context),
-		Body = term__functor(term__atom("true"), [], Context)
-	),
-	Clause = clause(VarSet, Head, Body).
-
-:- pred database_lookup_clause(database, term, varset, term, term).
-:- mode database_lookup_clause(in, in, out, out, out) is nondet.
-
-database_lookup_clause(Database, _Goal, VarSet, Head, Body) :-
-	list__member(Clause, Database),
-	Clause = clause(VarSet, Head, Body).
-
-%-----------------------------------------------------------------------------%
Index: mdb_command_test.m
===================================================================
RCS file: mdb_command_test.m
diff -N mdb_command_test.m
--- /dev/null	Wed May 28 10:49:58 1997
+++ mdb_command_test.m	Thu Apr 15 19:51:32 1999
@@ -0,0 +1,13 @@
+:- module mdb_command_test.
+
+:- interface.
+
+:- import_module io.
+
+:- pred main(io__state, io__state).
+:- mode main(di, uo) is cc_multi.
+
+:- implementation.
+
+main -->
+	[].
Index: queens.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/queens.inp,v
retrieving revision 1.6
diff -u -b -u -r1.6 queens.inp
--- queens.inp	1999/03/25 22:24:57	1.6
+++ queens.inp	1999/04/15 09:53:42
@@ -38,35 +38,7 @@
 stack
 stack -d
 print *
-#
-# Test interactive queries.
-#
-mmc_options --use-subdirs
-mmc_options
-query queens list
-append(X, Y, ['a', 'b', 'c']).
-qperm([1,2,3], List).
-qperm([1,2,3], List), List = [2 | _].
-qperm([1,2,3], List), List = [4 | _].
-qperm([1,2,"foo"], List).
-qperm(List, [1]).
-quit. cc_query queens list
-append(X, Y, ['a', 'b', 'c']).
-qperm([1,2,3], List).
-qperm([1,2,3], List), List = [2 | _].
-qperm([1,2,3], List), List = [4 | _].
-quit. io_query queens list
-main.
-if { append(X, Y, ['a', 'b', 'c']) } then
-	print("X = "), print(X), 
-	print(", Y = "), print(Y), nl
-else
-	print("No solution\n").
-if { qperm([1,2,3], List) } then print(List), nl else [].
-if { qperm([1,2,3], List), List = [2 | _] } then print(List), nl else { true }.
-if { qperm([1,2,3], List), List = [4 | _] } then print(List), nl
-else print("No solution, as expected."), io__nl.
-quit.
+
 retry
 print *
 finish -a
Index: queens.m
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/queens.m,v
retrieving revision 1.2
diff -u -b -u -r1.2 queens.m
--- queens.m	1999/03/25 22:24:59	1.2
+++ queens.m	1999/04/15 09:54:54
@@ -2,15 +2,11 @@
 
 :- interface.
 
-:- import_module io, list.
+:- import_module io.
 
 :- pred main(io__state, io__state).
 :- mode main(di, uo) is cc_multi.
 
-	% exported for use with interactive queries in the debugger
-:- pred qperm(list(T), list(T)).
-:- mode qperm(in, out) is nondet.
-
 :- implementation.
 
 :- import_module list, int.
@@ -27,6 +23,9 @@
 
 :- pred queen(list(int), list(int)).
 :- mode queen(in, out) is nondet.
+
+:- pred qperm(list(T), list(T)).
+:- mode qperm(in, out) is nondet.
 
 :- pred qdelete(T, list(T), list(T)).
 :- mode qdelete(out, in, out) is nondet.
Index: queens_lib.exp
===================================================================
RCS file: queens_lib.exp
diff -N queens_lib.exp
--- /tmp/cvs18207jaa	Thu Apr 15 20:01:15 1999
+++ /dev/null	Wed May 28 10:49:58 1997
@@ -1,790 +0,0 @@
-       1:      1  1 CALL pred queens_lib:main/2-0 (cc_multi) 
-mdb> echo on
-Command echo enabled
-mdb> print *
-       HeadVar__1           		state('<<c_pointer>>')
-mdb> 
-       2:      2  2 CALL pred queens_lib:data/1-0 (det) 
-mdb> print *
-mdb: there are no live variables
-mdb> 
-       3:      2  2 EXIT pred queens_lib:data/1-0 (det) 
-mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
-mdb> 
-       4:      3  2 CALL pred queens_lib:queen/2-0 (nondet) 
-mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
-mdb> 
-       5:      4  3 CALL pred queens_lib:qperm/2-0 (nondet) 
-mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
-mdb> 
-       6:      4  3 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
-mdb> 
-       7:      5  4 CALL pred queens_lib:qdelete/3-0 (nondet) 
-mdb> print *
-       HeadVar__2           		[1, 2, 3, 4, 5]
-mdb> 
-       8:      5  4 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-mdb> print *
-       HeadVar__2           		[1, 2, 3, 4, 5]
-       V_10                 		[2, 3, 4, 5]
-       V_11                 		1
-mdb> level 1
-Ancestor level set to 1
-mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
-mdb> up 1
-Ancestor level set to 2
-mdb> vars
-        0 HeadVar__1
-mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
-mdb> 
-       9:      5  4 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-mdb> print *
-       HeadVar__1           		1
-       HeadVar__2           		[1, 2, 3, 4, 5]
-       HeadVar__3           		[2, 3, 4, 5]
-mdb> 
-      10:      6  4 CALL pred queens_lib:qperm/2-0 (nondet) 
-mdb> print *
-       HeadVar__1           		[2, 3, 4, 5]
-mdb> 
-      11:      6  4 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-mdb> print *
-       HeadVar__1           		[2, 3, 4, 5]
-mdb> 
-      12:      7  5 CALL pred queens_lib:qdelete/3-0 (nondet) 
-mdb> print *
-       HeadVar__2           		[2, 3, 4, 5]
-mdb> 
-      13:      7  5 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-mdb> print *
-       HeadVar__2           		[2, 3, 4, 5]
-       V_10                 		[3, 4, 5]
-       V_11                 		2
-mdb> 
-      14:      7  5 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-mdb> print *
-       HeadVar__1           		2
-       HeadVar__2           		[2, 3, 4, 5]
-       HeadVar__3           		[3, 4, 5]
-mdb> 
-      15:      8  5 CALL pred queens_lib:qperm/2-0 (nondet) 
-mdb> print *
-       HeadVar__1           		[3, 4, 5]
-mdb> 
-      16:      8  5 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-mdb> print *
-       HeadVar__1           		[3, 4, 5]
-mdb> 
-      17:      9  6 CALL pred queens_lib:qdelete/3-0 (nondet) 
-mdb> print *
-       HeadVar__2           		[3, 4, 5]
-mdb> 
-      18:      9  6 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-mdb> print *
-       HeadVar__2           		[3, 4, 5]
-       V_10                 		[4, 5]
-       V_11                 		3
-mdb> 
-      19:      9  6 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-mdb> print *
-       HeadVar__1           		3
-       HeadVar__2           		[3, 4, 5]
-       HeadVar__3           		[4, 5]
-mdb> 
-      20:     10  6 CALL pred queens_lib:qperm/2-0 (nondet) 
-mdb> print *
-       HeadVar__1           		[4, 5]
-mdb> 
-      21:     10  6 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-mdb> print *
-       HeadVar__1           		[4, 5]
-mdb> 
-      22:     11  7 CALL pred queens_lib:qdelete/3-0 (nondet) 
-mdb> print *
-       HeadVar__2           		[4, 5]
-mdb> 
-      23:     11  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-mdb> print *
-       HeadVar__2           		[4, 5]
-       V_10                 		[5]
-       V_11                 		4
-mdb> 
-      24:     11  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-mdb> print *
-       HeadVar__1           		4
-       HeadVar__2           		[4, 5]
-       HeadVar__3           		[5]
-mdb> 
-      25:     12  7 CALL pred queens_lib:qperm/2-0 (nondet) 
-mdb> print *
-       HeadVar__1           		[5]
-mdb> 
-      26:     12  7 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-mdb> print *
-       HeadVar__1           		[5]
-mdb> 
-      27:     13  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-mdb> print *
-       HeadVar__2           		[5]
-mdb> 
-      28:     13  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-mdb> print *
-       HeadVar__2           		[5]
-       V_10                 		[]
-       V_11                 		5
-mdb> 
-      29:     13  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-mdb> print *
-       HeadVar__1           		5
-       HeadVar__2           		[5]
-       HeadVar__3           		[]
-mdb> 
-      30:     14  8 CALL pred queens_lib:qperm/2-0 (nondet) 
-mdb> print *
-       HeadVar__1           		[]
-mdb> 
-      31:     14  8 SWTC pred queens_lib:qperm/2-0 (nondet) s2;
-mdb> print *
-mdb> 
-      32:     14  8 EXIT pred queens_lib:qperm/2-0 (nondet) 
-mdb> print *
-       HeadVar__1           		[]
-       HeadVar__2           		[]
-mdb> 
-      33:     12  7 EXIT pred queens_lib:qperm/2-0 (nondet) 
-mdb> print *
-       HeadVar__1           		[5]
-       HeadVar__2           		[5]
-mdb> 
-      34:     10  6 EXIT pred queens_lib:qperm/2-0 (nondet) 
-mdb> print *
-       HeadVar__1           		[4, 5]
-       HeadVar__2           		[4, 5]
-mdb> 
-      35:      8  5 EXIT pred queens_lib:qperm/2-0 (nondet) 
-mdb> print *
-       HeadVar__1           		[3, 4, 5]
-       HeadVar__2           		[3, 4, 5]
-mdb> 
-      36:      6  4 EXIT pred queens_lib:qperm/2-0 (nondet) 
-mdb> print *
-       HeadVar__1           		[2, 3, 4, 5]
-       HeadVar__2           		[2, 3, 4, 5]
-mdb> 
-      37:      4  3 EXIT pred queens_lib:qperm/2-0 (nondet) 
-mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
-       HeadVar__2           		[1, 2, 3, 4, 5]
-mdb> 
-      38:     15  3 CALL pred queens_lib:safe/1-0 (semidet) 
-mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
-mdb> 
-      39:     15  3 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
-mdb> 
-      40:     16  4 CALL pred queens_lib:nodiag/3-0 (semidet) 
-mdb> print *
-       HeadVar__1           		1
-       HeadVar__2           		1
-       HeadVar__3           		[2, 3, 4, 5]
-mdb> 
-      41:     16  4 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-mdb> print *
-       HeadVar__1           		1
-       HeadVar__2           		1
-       HeadVar__3           		[2, 3, 4, 5]
-mdb> continue -a -N
-      42:     16  4 THEN pred queens_lib:nodiag/3-0 (semidet) s1;c4;t;
-      43:     16  4 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-      44:     15  3 FAIL pred queens_lib:safe/1-0 (semidet) 
-      45:     14  8 FAIL pred queens_lib:qperm/2-0 (nondet) 
-      46:     13  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-      47:     17  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-      48:     17  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-      49:     13  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-      50:     12  7 FAIL pred queens_lib:qperm/2-0 (nondet) 
-      51:     11  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-      52:     18  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-      53:     18  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-      54:     18  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-      55:     11  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-      56:     19  7 CALL pred queens_lib:qperm/2-0 (nondet) 
-      57:     19  7 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-      58:     20  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-      59:     20  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-      60:     20  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-      61:     21  8 CALL pred queens_lib:qperm/2-0 (nondet) 
-      62:     21  8 SWTC pred queens_lib:qperm/2-0 (nondet) s2;
-      63:     21  8 EXIT pred queens_lib:qperm/2-0 (nondet) 
-      64:     19  7 EXIT pred queens_lib:qperm/2-0 (nondet) 
-      65:     10  6 EXIT pred queens_lib:qperm/2-0 (nondet) 
-      66:      8  5 EXIT pred queens_lib:qperm/2-0 (nondet) 
-      67:      6  4 EXIT pred queens_lib:qperm/2-0 (nondet) 
-      68:      4  3 EXIT pred queens_lib:qperm/2-0 (nondet) 
-      69:     22  3 CALL pred queens_lib:safe/1-0 (semidet) 
-      70:     22  3 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-      71:     23  4 CALL pred queens_lib:nodiag/3-0 (semidet) 
-      72:     23  4 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-      73:     23  4 THEN pred queens_lib:nodiag/3-0 (semidet) s1;c4;t;
-      74:     23  4 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-      75:     22  3 FAIL pred queens_lib:safe/1-0 (semidet) 
-      76:     21  8 FAIL pred queens_lib:qperm/2-0 (nondet) 
-      77:     20  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-      78:     24  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-      79:     24  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-      80:     20  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-      81:     19  7 FAIL pred queens_lib:qperm/2-0 (nondet) 
-      82:     18  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-      83:     25  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-      84:     25  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-      85:     18  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-      86:     11  7 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-      87:     10  6 FAIL pred queens_lib:qperm/2-0 (nondet) 
-      88:      9  6 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-      89:     26  7 CALL pred queens_lib:qdelete/3-0 (nondet) 
-      90:     26  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-      91:     26  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-      92:      9  6 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-      93:     27  6 CALL pred queens_lib:qperm/2-0 (nondet) 
-      94:     27  6 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-      95:     28  7 CALL pred queens_lib:qdelete/3-0 (nondet) 
-      96:     28  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-      97:     28  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-      98:     29  7 CALL pred queens_lib:qperm/2-0 (nondet) 
-      99:     29  7 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-     100:     30  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     101:     30  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     102:     30  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     103:     31  8 CALL pred queens_lib:qperm/2-0 (nondet) 
-     104:     31  8 SWTC pred queens_lib:qperm/2-0 (nondet) s2;
-     105:     31  8 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     106:     29  7 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     107:     27  6 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     108:      8  5 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     109:      6  4 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     110:      4  3 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     111:     32  3 CALL pred queens_lib:safe/1-0 (semidet) 
-     112:     32  3 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     113:     33  4 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     114:     33  4 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     115:     33  4 THEN pred queens_lib:nodiag/3-0 (semidet) s1;c4;t;
-     116:     33  4 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-     117:     32  3 FAIL pred queens_lib:safe/1-0 (semidet) 
-     118:     31  8 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     119:     30  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     120:     34  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     121:     34  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     122:     30  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     123:     29  7 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     124:     28  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     125:     35  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     126:     35  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     127:     35  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     128:     28  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     129:     36  7 CALL pred queens_lib:qperm/2-0 (nondet) 
-     130:     36  7 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-     131:     37  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     132:     37  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     133:     37  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     134:     38  8 CALL pred queens_lib:qperm/2-0 (nondet) 
-     135:     38  8 SWTC pred queens_lib:qperm/2-0 (nondet) s2;
-     136:     38  8 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     137:     36  7 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     138:     27  6 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     139:      8  5 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     140:      6  4 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     141:      4  3 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     142:     39  3 CALL pred queens_lib:safe/1-0 (semidet) 
-     143:     39  3 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     144:     40  4 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     145:     40  4 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     146:     40  4 THEN pred queens_lib:nodiag/3-0 (semidet) s1;c4;t;
-     147:     40  4 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-     148:     39  3 FAIL pred queens_lib:safe/1-0 (semidet) 
-     149:     38  8 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     150:     37  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     151:     41  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     152:     41  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     153:     37  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     154:     36  7 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     155:     35  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     156:     42  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     157:     42  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     158:     35  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     159:     28  7 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     160:     27  6 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     161:     26  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     162:     43  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     163:     43  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     164:     43  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     165:     26  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     166:      9  6 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     167:     44  6 CALL pred queens_lib:qperm/2-0 (nondet) 
-     168:     44  6 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-     169:     45  7 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     170:     45  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     171:     45  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     172:     46  7 CALL pred queens_lib:qperm/2-0 (nondet) 
-     173:     46  7 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-     174:     47  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     175:     47  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     176:     47  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     177:     48  8 CALL pred queens_lib:qperm/2-0 (nondet) 
-     178:     48  8 SWTC pred queens_lib:qperm/2-0 (nondet) s2;
-     179:     48  8 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     180:     46  7 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     181:     44  6 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     182:      8  5 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     183:      6  4 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     184:      4  3 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     185:     49  3 CALL pred queens_lib:safe/1-0 (semidet) 
-     186:     49  3 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     187:     50  4 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     188:     50  4 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     189:     50  4 THEN pred queens_lib:nodiag/3-0 (semidet) s1;c4;t;
-     190:     50  4 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-     191:     49  3 FAIL pred queens_lib:safe/1-0 (semidet) 
-     192:     48  8 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     193:     47  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     194:     51  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     195:     51  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     196:     47  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     197:     46  7 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     198:     45  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     199:     52  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     200:     52  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     201:     52  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     202:     45  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     203:     53  7 CALL pred queens_lib:qperm/2-0 (nondet) 
-     204:     53  7 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-     205:     54  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     206:     54  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     207:     54  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     208:     55  8 CALL pred queens_lib:qperm/2-0 (nondet) 
-     209:     55  8 SWTC pred queens_lib:qperm/2-0 (nondet) s2;
-     210:     55  8 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     211:     53  7 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     212:     44  6 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     213:      8  5 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     214:      6  4 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     215:      4  3 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     216:     56  3 CALL pred queens_lib:safe/1-0 (semidet) 
-     217:     56  3 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     218:     57  4 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     219:     57  4 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     220:     57  4 THEN pred queens_lib:nodiag/3-0 (semidet) s1;c4;t;
-     221:     57  4 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-     222:     56  3 FAIL pred queens_lib:safe/1-0 (semidet) 
-     223:     55  8 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     224:     54  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     225:     58  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     226:     58  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     227:     54  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     228:     53  7 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     229:     52  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     230:     59  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     231:     59  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     232:     52  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     233:     45  7 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     234:     44  6 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     235:     43  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     236:     60  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     237:     60  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     238:     43  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     239:     26  7 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     240:      9  6 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     241:      8  5 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     242:      7  5 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     243:     61  6 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     244:     61  6 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     245:     61  6 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     246:      7  5 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     247:     62  5 CALL pred queens_lib:qperm/2-0 (nondet) 
-     248:     62  5 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-     249:     63  6 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     250:     63  6 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     251:     63  6 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     252:     64  6 CALL pred queens_lib:qperm/2-0 (nondet) 
-     253:     64  6 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-     254:     65  7 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     255:     65  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     256:     65  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     257:     66  7 CALL pred queens_lib:qperm/2-0 (nondet) 
-     258:     66  7 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-     259:     67  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     260:     67  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     261:     67  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     262:     68  8 CALL pred queens_lib:qperm/2-0 (nondet) 
-     263:     68  8 SWTC pred queens_lib:qperm/2-0 (nondet) s2;
-     264:     68  8 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     265:     66  7 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     266:     64  6 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     267:     62  5 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     268:      6  4 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     269:      4  3 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     270:     69  3 CALL pred queens_lib:safe/1-0 (semidet) 
-     271:     69  3 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     272:     70  4 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     273:     70  4 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     274:     70  4 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     275:     70  4 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     276:     71  5 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     277:     71  5 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     278:     71  5 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     279:     71  5 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     280:     72  6 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     281:     72  6 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     282:     72  6 THEN pred queens_lib:nodiag/3-0 (semidet) s1;c4;t;
-     283:     72  6 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-     284:     71  5 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-     285:     70  4 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-     286:     69  3 FAIL pred queens_lib:safe/1-0 (semidet) 
-     287:     68  8 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     288:     67  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     289:     73  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     290:     73  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     291:     67  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     292:     66  7 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     293:     65  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     294:     74  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     295:     74  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     296:     74  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     297:     65  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     298:     75  7 CALL pred queens_lib:qperm/2-0 (nondet) 
-     299:     75  7 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-     300:     76  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     301:     76  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     302:     76  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     303:     77  8 CALL pred queens_lib:qperm/2-0 (nondet) 
-     304:     77  8 SWTC pred queens_lib:qperm/2-0 (nondet) s2;
-     305:     77  8 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     306:     75  7 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     307:     64  6 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     308:     62  5 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     309:      6  4 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     310:      4  3 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     311:     78  3 CALL pred queens_lib:safe/1-0 (semidet) 
-     312:     78  3 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     313:     79  4 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     314:     79  4 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     315:     79  4 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     316:     79  4 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     317:     80  5 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     318:     80  5 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     319:     80  5 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     320:     80  5 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     321:     81  6 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     322:     81  6 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     323:     81  6 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     324:     81  6 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     325:     82  7 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     326:     82  7 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     327:     82  7 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     328:     82  7 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     329:     83  8 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     330:     83  8 SWTC pred queens_lib:nodiag/3-0 (semidet) s2;
-     331:     83  8 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     332:     82  7 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     333:     81  6 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     334:     80  5 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     335:     79  4 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     336:     84  4 CALL pred queens_lib:safe/1-0 (semidet) 
-     337:     84  4 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     338:     85  5 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     339:     85  5 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     340:     85  5 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     341:     85  5 THEN pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;t;
-     342:     85  5 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-     343:     84  4 FAIL pred queens_lib:safe/1-0 (semidet) 
-     344:     78  3 FAIL pred queens_lib:safe/1-0 (semidet) 
-     345:     77  8 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     346:     76  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     347:     86  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     348:     86  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     349:     76  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     350:     75  7 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     351:     74  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     352:     87  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     353:     87  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     354:     74  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     355:     65  7 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     356:     64  6 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     357:     63  6 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     358:     88  7 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     359:     88  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     360:     88  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     361:     63  6 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     362:     89  6 CALL pred queens_lib:qperm/2-0 (nondet) 
-     363:     89  6 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-     364:     90  7 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     365:     90  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     366:     90  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     367:     91  7 CALL pred queens_lib:qperm/2-0 (nondet) 
-     368:     91  7 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-     369:     92  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     370:     92  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     371:     92  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     372:     93  8 CALL pred queens_lib:qperm/2-0 (nondet) 
-     373:     93  8 SWTC pred queens_lib:qperm/2-0 (nondet) s2;
-     374:     93  8 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     375:     91  7 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     376:     89  6 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     377:     62  5 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     378:      6  4 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     379:      4  3 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     380:     94  3 CALL pred queens_lib:safe/1-0 (semidet) 
-     381:     94  3 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     382:     95  4 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     383:     95  4 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     384:     95  4 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     385:     95  4 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     386:     96  5 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     387:     96  5 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     388:     96  5 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     389:     96  5 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     390:     97  6 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     391:     97  6 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     392:     97  6 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     393:     97  6 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     394:     98  7 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     395:     98  7 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     396:     98  7 THEN pred queens_lib:nodiag/3-0 (semidet) s1;c4;t;
-     397:     98  7 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-     398:     97  6 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-     399:     96  5 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-     400:     95  4 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-     401:     94  3 FAIL pred queens_lib:safe/1-0 (semidet) 
-     402:     93  8 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     403:     92  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     404:     99  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     405:     99  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     406:     92  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     407:     91  7 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     408:     90  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     409:    100  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     410:    100  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     411:    100  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     412:     90  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     413:    101  7 CALL pred queens_lib:qperm/2-0 (nondet) 
-     414:    101  7 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-     415:    102  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     416:    102  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     417:    102  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     418:    103  8 CALL pred queens_lib:qperm/2-0 (nondet) 
-     419:    103  8 SWTC pred queens_lib:qperm/2-0 (nondet) s2;
-     420:    103  8 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     421:    101  7 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     422:     89  6 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     423:     62  5 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     424:      6  4 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     425:      4  3 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     426:    104  3 CALL pred queens_lib:safe/1-0 (semidet) 
-     427:    104  3 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     428:    105  4 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     429:    105  4 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     430:    105  4 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     431:    105  4 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     432:    106  5 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     433:    106  5 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     434:    106  5 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     435:    106  5 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     436:    107  6 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     437:    107  6 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     438:    107  6 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     439:    107  6 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     440:    108  7 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     441:    108  7 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     442:    108  7 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     443:    108  7 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     444:    109  8 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     445:    109  8 SWTC pred queens_lib:nodiag/3-0 (semidet) s2;
-     446:    109  8 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     447:    108  7 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     448:    107  6 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     449:    106  5 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     450:    105  4 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     451:    110  4 CALL pred queens_lib:safe/1-0 (semidet) 
-     452:    110  4 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     453:    111  5 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     454:    111  5 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     455:    111  5 THEN pred queens_lib:nodiag/3-0 (semidet) s1;c4;t;
-     456:    111  5 FAIL pred queens_lib:nodiag/3-0 (semidet) 
-     457:    110  4 FAIL pred queens_lib:safe/1-0 (semidet) 
-     458:    104  3 FAIL pred queens_lib:safe/1-0 (semidet) 
-     459:    103  8 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     460:    102  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     461:    112  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     462:    112  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     463:    102  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     464:    101  7 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     465:    100  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     466:    113  9 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     467:    113  9 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     468:    100  8 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     469:     90  7 FAIL pred queens_lib:qdelete/3-0 (nondet) 
-     470:     89  6 FAIL pred queens_lib:qperm/2-0 (nondet) 
-     471:     88  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d2;
-     472:    114  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     473:    114  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     474:    114  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     475:     88  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     476:     63  6 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     477:    115  6 CALL pred queens_lib:qperm/2-0 (nondet) 
-     478:    115  6 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-     479:    116  7 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     480:    116  7 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     481:    116  7 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     482:    117  7 CALL pred queens_lib:qperm/2-0 (nondet) 
-     483:    117  7 SWTC pred queens_lib:qperm/2-0 (nondet) s1;
-     484:    118  8 CALL pred queens_lib:qdelete/3-0 (nondet) 
-     485:    118  8 DISJ pred queens_lib:qdelete/3-0 (nondet) c2;d1;
-     486:    118  8 EXIT pred queens_lib:qdelete/3-0 (nondet) 
-     487:    119  8 CALL pred queens_lib:qperm/2-0 (nondet) 
-     488:    119  8 SWTC pred queens_lib:qperm/2-0 (nondet) s2;
-     489:    119  8 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     490:    117  7 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     491:    115  6 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     492:     62  5 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     493:      6  4 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     494:      4  3 EXIT pred queens_lib:qperm/2-0 (nondet) 
-     495:    120  3 CALL pred queens_lib:safe/1-0 (semidet) 
-     496:    120  3 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     497:    121  4 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     498:    121  4 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     499:    121  4 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     500:    121  4 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     501:    122  5 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     502:    122  5 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     503:    122  5 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     504:    122  5 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     505:    123  6 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     506:    123  6 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     507:    123  6 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     508:    123  6 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     509:    124  7 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     510:    124  7 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     511:    124  7 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     512:    124  7 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     513:    125  8 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     514:    125  8 SWTC pred queens_lib:nodiag/3-0 (semidet) s2;
-     515:    125  8 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     516:    124  7 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     517:    123  6 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     518:    122  5 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     519:    121  4 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     520:    126  4 CALL pred queens_lib:safe/1-0 (semidet) 
-     521:    126  4 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     522:    127  5 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     523:    127  5 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     524:    127  5 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     525:    127  5 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     526:    128  6 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     527:    128  6 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     528:    128  6 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     529:    128  6 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     530:    129  7 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     531:    129  7 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     532:    129  7 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     533:    129  7 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     534:    130  8 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     535:    130  8 SWTC pred queens_lib:nodiag/3-0 (semidet) s2;
-     536:    130  8 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     537:    129  7 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     538:    128  6 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     539:    127  5 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     540:    131  5 CALL pred queens_lib:safe/1-0 (semidet) 
-     541:    131  5 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     542:    132  6 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     543:    132  6 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     544:    132  6 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     545:    132  6 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     546:    133  7 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     547:    133  7 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     548:    133  7 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     549:    133  7 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     550:    134  8 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     551:    134  8 SWTC pred queens_lib:nodiag/3-0 (semidet) s2;
-     552:    134  8 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     553:    133  7 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     554:    132  6 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     555:    135  6 CALL pred queens_lib:safe/1-0 (semidet) 
-     556:    135  6 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     557:    136  7 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     558:    136  7 SWTC pred queens_lib:nodiag/3-0 (semidet) s1;
-     559:    136  7 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;
-     560:    136  7 ELSE pred queens_lib:nodiag/3-0 (semidet) s1;c4;e;e;
-     561:    137  8 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     562:    137  8 SWTC pred queens_lib:nodiag/3-0 (semidet) s2;
-     563:    137  8 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     564:    136  7 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     565:    138  7 CALL pred queens_lib:safe/1-0 (semidet) 
-     566:    138  7 SWTC pred queens_lib:safe/1-0 (semidet) s1;
-     567:    139  8 CALL pred queens_lib:nodiag/3-0 (semidet) 
-     568:    139  8 SWTC pred queens_lib:nodiag/3-0 (semidet) s2;
-     569:    139  8 EXIT pred queens_lib:nodiag/3-0 (semidet) 
-     570:    140  8 CALL pred queens_lib:safe/1-0 (semidet) 
-     571:    140  8 SWTC pred queens_lib:safe/1-0 (semidet) s2;
-     572:    140  8 EXIT pred queens_lib:safe/1-0 (semidet) 
-     573:    138  7 EXIT pred queens_lib:safe/1-0 (semidet) 
-     574:    135  6 EXIT pred queens_lib:safe/1-0 (semidet) 
-     575:    131  5 EXIT pred queens_lib:safe/1-0 (semidet) 
-     576:    126  4 EXIT pred queens_lib:safe/1-0 (semidet) 
-     577:    120  3 EXIT pred queens_lib:safe/1-0 (semidet) 
-     578:      3  2 EXIT pred queens_lib:queen/2-0 (nondet) 
-     579:      1  1 THEN pred queens_lib:main/2-0 (cc_multi) t;
-     580:    141  2 CALL pred queens_lib:print_list/3-0 (det) 
-     581:    141  2 ELSE pred queens_lib:print_list/3-0 (det) e;
-     582:    142  3 CALL pred io:write_string/3-0 (det) 
-[     583:    142  3 EXIT pred io:write_string/3-0 (det) 
-     584:    143  3 CALL pred queens_lib:print_list_2/3-0 (det) 
-     585:    143  3 SWTC pred queens_lib:print_list_2/3-0 (det) s1;
-     586:    144  4 CALL pred io:write_int/3-0 (det) 
-1     587:    144  4 EXIT pred io:write_int/3-0 (det) 
-     588:    143  3 ELSE pred queens_lib:print_list_2/3-0 (det) s1;c3;e;
-     589:    145  4 CALL pred io:write_string/3-0 (det) 
-,      590:    145  4 EXIT pred io:write_string/3-0 (det) 
-     591:    146  4 CALL pred queens_lib:print_list_2/3-0 (det) 
-     592:    146  4 SWTC pred queens_lib:print_list_2/3-0 (det) s1;
-     593:    147  5 CALL pred io:write_int/3-0 (det) 
-3     594:    147  5 EXIT pred io:write_int/3-0 (det) 
-     595:    146  4 ELSE pred queens_lib:print_list_2/3-0 (det) s1;c3;e;
-     596:    148  5 CALL pred io:write_string/3-0 (det) 
-,      597:    148  5 EXIT pred io:write_string/3-0 (det) 
-     598:    149  5 CALL pred queens_lib:print_list_2/3-0 (det) 
-     599:    149  5 SWTC pred queens_lib:print_list_2/3-0 (det) s1;
-     600:    150  6 CALL pred io:write_int/3-0 (det) 
-5     601:    150  6 EXIT pred io:write_int/3-0 (det) 
-     602:    149  5 ELSE pred queens_lib:print_list_2/3-0 (det) s1;c3;e;
-     603:    151  6 CALL pred io:write_string/3-0 (det) 
-,      604:    151  6 EXIT pred io:write_string/3-0 (det) 
-     605:    152  6 CALL pred queens_lib:print_list_2/3-0 (det) 
-     606:    152  6 SWTC pred queens_lib:print_list_2/3-0 (det) s1;
-     607:    153  7 CALL pred io:write_int/3-0 (det) 
-2     608:    153  7 EXIT pred io:write_int/3-0 (det) 
-     609:    152  6 ELSE pred queens_lib:print_list_2/3-0 (det) s1;c3;e;
-     610:    154  7 CALL pred io:write_string/3-0 (det) 
-,      611:    154  7 EXIT pred io:write_string/3-0 (det) 
-     612:    155  7 CALL pred queens_lib:print_list_2/3-0 (det) 
-     613:    155  7 SWTC pred queens_lib:print_list_2/3-0 (det) s1;
-     614:    156  8 CALL pred io:write_int/3-0 (det) 
-4     615:    156  8 EXIT pred io:write_int/3-0 (det) 
-     616:    155  7 THEN pred queens_lib:print_list_2/3-0 (det) s1;c3;t;
-     617:    155  7 EXIT pred queens_lib:print_list_2/3-0 (det) 
-     618:    152  6 EXIT pred queens_lib:print_list_2/3-0 (det) 
-     619:    149  5 EXIT pred queens_lib:print_list_2/3-0 (det) 
-     620:    146  4 EXIT pred queens_lib:print_list_2/3-0 (det) 
-     621:    143  3 EXIT pred queens_lib:print_list_2/3-0 (det) 
-     622:    157  3 CALL pred io:write_string/3-0 (det) 
-]
-     623:    157  3 EXIT pred io:write_string/3-0 (det) 
-     624:    141  2 EXIT pred queens_lib:print_list/3-0 (det) 
-     625:      1  1 EXIT pred queens_lib:main/2-0 (cc_multi) 
Index: queens_lib.inp
===================================================================
RCS file: queens_lib.inp
diff -N queens_lib.inp
--- /tmp/cvs18207kaa	Thu Apr 15 20:01:15 1999
+++ /dev/null	Wed May 28 10:49:58 1997
@@ -1,91 +0,0 @@
-echo on
-register --quiet
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-level 1
-print *
-up 1
-vars
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-
-print *
-break print_list
-continue -aN
-continue -n -S
Index: queens_lib.m
===================================================================
RCS file: queens_lib.m
diff -N queens_lib.m
--- /tmp/cvs18207laa	Thu Apr 15 20:01:15 1999
+++ /dev/null	Wed May 28 10:49:58 1997
@@ -1,101 +0,0 @@
-:- module queens_lib.
-
-:- interface.
-
-:- import_module io.
-
-:- pred main(io__state, io__state).
-:- mode main(di, uo) is cc_multi.
-
-:- implementation.
-
-:- import_module list, int.
-
-main -->
-	( { data(Data), queen(Data, Out) } ->
-		print_list(Out)
-	;
-		io__write_string("No solution\n")
-	).
-
-:- pred data(list(int)).
-:- mode data(out) is det.
-
-:- pred queen(list(int), list(int)).
-:- mode queen(in, out) is nondet.
-
-:- pred qperm(list(T), list(T)).
-:- mode qperm(in, out) is nondet.
-
-:- pred qdelete(T, list(T), list(T)).
-:- mode qdelete(out, in, out) is nondet.
-
-:- pred safe(list(int)).
-:- mode safe(in) is semidet.
-
-:- pred nodiag(int, int, list(int)).
-:- mode nodiag(in, in, in) is semidet.
-
-data([1,2,3,4,5]).
-
-queen(Data, Out) :-
-	qperm(Data, Out),
-	safe(Out).
-
-qperm([], []).
-qperm([X|Y], K) :-
-	qdelete(U, [X|Y], Z),
-	K = [U|V],
-	qperm(Z, V).
-
-qdelete(A, [A|L], L).
-qdelete(X, [A|Z], [A|R]) :-
-	qdelete(X, Z, R).
-
-safe([]).
-safe([N|L]) :-
-	nodiag(N, 1, L),
-	safe(L).
-
-nodiag(_, _, []).
-nodiag(B, D, [N|L]) :-
-	NmB is N - B,
-	BmN is B - N,
-	( D = NmB ->
-		fail
-	; D = BmN ->
-		fail
-	;
-		true
-	),
-	D1 is D + 1,
-	nodiag(B, D1, L).
-
-:- pred print_list(list(int), io__state, io__state).
-:- mode print_list(in, di, uo) is det.
-
-print_list(Xs) -->
-	(
-		{ Xs = [] }
-	->
-		io__write_string("[]\n")
-	;
-		io__write_string("["),
-		print_list_2(Xs),
-		io__write_string("]\n")
-	).
-
-:- pred print_list_2(list(int), io__state, io__state).
-:- mode print_list_2(in, di, uo) is det.
-
-print_list_2([]) --> [].
-print_list_2([X|Xs]) --> 
-	io__write_int(X),
-	(
-		{ Xs = [] }
-	->
-		[]
-	;
-		io__write_string(", "),
-		print_list_2(Xs)
-	).



More information about the developers mailing list