[m-rev.] diff: more tabling improvements

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri Mar 12 20:20:59 AEDT 2004


These have not been bootchecked yet, but they have been reviewed by Kostis,
and they only affect an not yet officially supported grade.

Zoltan.

runtime/mercury_minimal_model.c:
	The fixpoint loop for detecting whether we have returned all answers
	to all consumers had an incorrect termination condition. Fix the bug,
	and rewrite the loop to be clearer by putting its test at the bottom,
	to make text order and temporal order agree.

	At each iteration of the fixpoint algorithm, check whether the
	generator doing the completion operation is still the leader.

	Fix a bug in the recording of leaders at coups.

runtime/mercury_minimal_model.[ch]:
library/table_builtin.m:
	Add support for recording, for each generator, the deepest of the
	nearest common ancestor between the generator and one of its consumers.
	We will need this soon.

tests/tabling/Mmakefile:
	Record that we now pass the coup2 test case.

tests/tabling/sg.{m,exp}:
	Test the tabling of the same generation predicate in the out,out mode
	as well as the in,out mode.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing java
cvs diff: Diffing java/library
cvs diff: Diffing java/runtime
cvs diff: Diffing library
Index: library/table_builtin.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/table_builtin.m,v
retrieving revision 1.33
diff -u -b -r1.33 table_builtin.m
--- library/table_builtin.m	7 Nov 2003 16:51:36 -0000	1.33
+++ library/table_builtin.m	12 Mar 2004 04:12:08 -0000
@@ -752,6 +752,7 @@
 		}
 #endif
 		subgoal->MR_sg_generator_fr = MR_curfr;
+		subgoal->MR_sg_deepest_nca_fr = MR_curfr;
 		T->MR_subgoal = subgoal;
 	}
 	Subgoal = T->MR_subgoal;
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/mercury_minimal_model.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_minimal_model.c,v
retrieving revision 1.6
diff -u -b -r1.6 mercury_minimal_model.c
--- runtime/mercury_minimal_model.c	12 Mar 2004 06:02:06 -0000	1.6
+++ runtime/mercury_minimal_model.c	12 Mar 2004 08:33:23 -0000
@@ -833,8 +833,9 @@
             MR_save_transient_registers();
             extend_consumer_stacks(leader, suspend_list->MR_cl_item);
             MR_restore_transient_registers();
-            /* suspend_list->item->leader = leader;      XXX */
         }
+
+        sub_follower->MR_sl_item->MR_sg_leader = leader;
     }
 
     /* XXX extend saved state of this_follower */
@@ -1013,23 +1014,22 @@
 MR_declare_entry(MR_do_trace_redo_fail);
 MR_declare_entry(MR_table_nondet_commit);
 
-MR_declare_label(RESUME_LABEL(ChangeLoop));
-MR_declare_label(RESUME_LABEL(ReachedFixpoint));
+MR_declare_label(RESUME_LABEL(StartCompletionOp));
 MR_declare_label(RESUME_LABEL(LoopOverSubgoals));
 MR_declare_label(RESUME_LABEL(LoopOverSuspensions));
 MR_declare_label(RESUME_LABEL(ReturnAnswer));
 MR_declare_label(RESUME_LABEL(RedoPoint));
 MR_declare_label(RESUME_LABEL(RestartPoint));
+MR_declare_label(RESUME_LABEL(FixPointCheck));
+MR_declare_label(RESUME_LABEL(ReachedFixpoint));
 
 MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
     SUSPEND_LABEL(Call), MR_SUSPEND_ENTRY);
 MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
-    RESUME_LABEL(ChangeLoop), MR_RESUME_ENTRY);
-MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
-    RESUME_LABEL(ReachedFixpoint), MR_RESUME_ENTRY);
-MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
     RESUME_LABEL(LoopOverSubgoals), MR_RESUME_ENTRY);
 MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
+    RESUME_LABEL(StartCompletionOp), MR_RESUME_ENTRY);
+MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
     RESUME_LABEL(LoopOverSuspensions), MR_RESUME_ENTRY);
 MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
     RESUME_LABEL(ReturnAnswer), MR_RESUME_ENTRY);
@@ -1037,6 +1037,10 @@
     RESUME_LABEL(RedoPoint), MR_RESUME_ENTRY);
 MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
     RESUME_LABEL(RestartPoint), MR_RESUME_ENTRY);
+MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
+    RESUME_LABEL(FixPointCheck), MR_RESUME_ENTRY);
+MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
+    RESUME_LABEL(ReachedFixpoint), MR_RESUME_ENTRY);
 
 MR_BEGIN_MODULE(table_nondet_suspend_resume_module)
     MR_init_entry_sl(MR_SUSPEND_ENTRY);
@@ -1045,13 +1049,14 @@
 
     MR_init_entry_sl(MR_RESUME_ENTRY);
     MR_INIT_PROC_LAYOUT_ADDR(MR_RESUME_ENTRY);
-    MR_init_label_sl(RESUME_LABEL(ChangeLoop));
-    MR_init_label_sl(RESUME_LABEL(ReachedFixpoint));
+    MR_init_label_sl(RESUME_LABEL(StartCompletionOp));
     MR_init_label_sl(RESUME_LABEL(LoopOverSubgoals));
     MR_init_label_sl(RESUME_LABEL(LoopOverSuspensions));
     MR_init_label_sl(RESUME_LABEL(ReturnAnswer));
     MR_init_label_sl(RESUME_LABEL(RedoPoint));
     MR_init_label_sl(RESUME_LABEL(RestartPoint));
+    MR_init_label_sl(RESUME_LABEL(FixPointCheck));
+    MR_init_label_sl(RESUME_LABEL(ReachedFixpoint));
 
     MR_init_entry_an(MR_table_nondet_commit);
 MR_BEGIN_CODE
@@ -1120,6 +1125,21 @@
     cur_cut = MR_cut_next - 1;
     cur_pneg = MR_pneg_next - 1;
     stop_addr = consumer->MR_cns_saved_state.MR_ss_non_stack_real_start;
+
+    if (stop_addr < subgoal->MR_sg_deepest_nca_fr) {
+#ifdef  MR_TABLE_DEBUG
+        if (MR_tabledebug) {
+            printf("resetting deepest nca for subgoal %s from ",
+                MR_subgoal_addr_name(subgoal));
+            MR_print_nondstackptr(stdout, subgoal->MR_sg_deepest_nca_fr);
+            printf(" to ");
+            MR_print_nondstackptr(stdout, stop_addr);
+            printf("\n");
+        }
+#endif
+        subgoal->MR_sg_deepest_nca_fr = stop_addr;
+    }
+
     for (fr = MR_maxfr; fr > stop_addr; fr = MR_prevfr_slot(fr)) {
         offset = MR_redoip_addr(fr) -
             consumer->MR_cns_saved_state.MR_ss_non_stack_real_start;
@@ -1236,7 +1256,6 @@
     MR_fail();
 
 MR_define_entry(MR_RESUME_ENTRY);
-
     /*
     ** The resume procedure restores answers to suspended consumers.
     ** It works by restoring the consumer state saved by the consumer's call
@@ -1257,6 +1276,11 @@
 
     MR_cur_leader = MR_top_generator_table();
 
+MR_define_label(RESUME_LABEL(StartCompletionOp));
+{
+    MR_ResumeInfo   *resume_info;
+
+
     if (MR_cur_leader->MR_sg_leader != NULL) {
         /*
         ** The predicate that called table_nondet_resume is not the leader
@@ -1287,10 +1311,11 @@
             printf("using existing resume info %p\n",
                 MR_cur_leader->MR_sg_resume_info);
         }
+        resume_info = MR_cur_leader->MR_sg_resume_info;
 #endif  /* MR_TABLE_DEBUG */
     } else {
-        MR_cur_leader->MR_sg_resume_info = MR_TABLE_NEW(MR_ResumeInfo);
-        MR_cur_leader->MR_sg_resume_info->MR_ri_saved_succip = MR_succip;/*NEW*/
+        resume_info = MR_TABLE_NEW(MR_ResumeInfo);
+        MR_cur_leader->MR_sg_resume_info = resume_info;
 
 #ifdef  MR_TABLE_DEBUG
         if (MR_tabledebug) {
@@ -1311,70 +1336,26 @@
         */
 
         MR_save_transient_registers();
-        save_state(&(MR_cur_leader->MR_sg_resume_info->MR_ri_leader_state),
+        save_state(&(resume_info->MR_ri_leader_state),
             MR_cur_leader->MR_sg_generator_fr, "resumption", "generator",
             NULL);
         MR_restore_transient_registers();
 
-#ifdef  MR_TABLE_DEBUG
-        if (MR_tabledebug) {
-            printf("creating new resume info %p\n",
-                MR_cur_leader->MR_sg_resume_info);
-        }
-#endif  /* MR_TABLE_DEBUG */
-    }
-
-    /* XXX try doing the test at the bottom */
-    MR_cur_leader->MR_sg_resume_info->MR_ri_changed = MR_TRUE;
-
-MR_define_label(RESUME_LABEL(ChangeLoop));
-{
-    MR_ResumeInfo   *resume_info;
-    
-    resume_info = MR_cur_leader->MR_sg_resume_info;
-
-    if (resume_info->MR_ri_changed) {
-#ifdef  MR_TABLE_DEBUG
-        if (MR_tabledebug) {
-            printf("changed flag set\n");
-        }
-#endif  /* MR_TABLE_DEBUG */
-    } else {
-        MR_SubgoalList  table_list;
-
-        /* XXX make sure subgoal_list is initialized early */
-        for (table_list = resume_info->MR_ri_subgoal_list;
-            table_list != NULL;
-            table_list = table_list->MR_sl_next)
-        {
-            if (table_list->MR_sl_item->MR_sg_num_committed_ans
-                != table_list->MR_sl_item->MR_sg_num_ans)
-            {
-                resume_info->MR_ri_changed = MR_TRUE;
-#ifdef  MR_TABLE_DEBUG
-                if (MR_tabledebug) {
-                    printf("table %s has new answers\n",
-                        MR_subgoal_addr_name(table_list->MR_sl_item));
-                }
-#endif  /* MR_TABLE_DEBUG */
-            }
-        }
-    }
+        resume_info->MR_ri_subgoal_list = MR_cur_leader->MR_sg_followers;
+        resume_info->MR_ri_cur_subgoal = NULL;
+        resume_info->MR_ri_consumer_list = NULL;
+        resume_info->MR_ri_cur_consumer = NULL;
+        resume_info->MR_ri_cur_consumer_answer_list = NULL;
+        resume_info->MR_ri_saved_succip = MR_succip;         /*NEW*/
 
-    if (! resume_info->MR_ri_changed) {
 #ifdef  MR_TABLE_DEBUG
         if (MR_tabledebug) {
-            printf("no more changes\n");
+            printf("creating new resume info %p\n", resume_info);
         }
 #endif  /* MR_TABLE_DEBUG */
-
-        MR_GOTO_LABEL(RESUME_LABEL(ReachedFixpoint));
     }
 
-    resume_info->MR_ri_subgoal_list = MR_cur_leader->MR_sg_followers;
-    if (resume_info->MR_ri_subgoal_list == NULL) {
-        resume_info->MR_ri_changed = MR_FALSE; /* XXX NEW */
-    }
+    /* fall through to LoopOverSubgoals */
 }
 
     /* For each of the subgoals on our list of followers */
@@ -1391,7 +1372,7 @@
         }
 #endif  /* MR_TABLE_DEBUG */
 
-        MR_GOTO_LABEL(RESUME_LABEL(ChangeLoop));
+        MR_GOTO_LABEL(RESUME_LABEL(FixPointCheck));
     }
 
     resume_info->MR_ri_cur_subgoal =
@@ -1402,9 +1383,10 @@
     resume_info->MR_ri_consumer_list =
         resume_info->MR_ri_cur_subgoal->MR_sg_consumer_list;
 
-    resume_info->MR_ri_changed = MR_FALSE;
     resume_info->MR_ri_cur_subgoal->MR_sg_num_committed_ans =
         resume_info->MR_ri_cur_subgoal->MR_sg_num_ans;
+
+    /* fall through to LoopOverSuspensions */
 }
 
     /* For each of the suspended nodes for cur_subgoal */
@@ -1457,10 +1439,17 @@
     assert((MR_maxfr - MR_prevfr_slot(MR_maxfr)) ==
         (MR_NONDET_FIXED_SIZE + 1));
 
-    MR_gen_next = resume_info->MR_ri_leader_state.MR_ss_gen_next;
+    /*
+    ** We set up the stack frame of the suspend predicate so that a redo into
+    ** the call to suspend from the consumer will return the next answer
+    */
+
+    /* MR_gen_next = resume_info->MR_ri_leader_state.MR_ss_gen_next; BUG? */
     MR_redoip_slot(MR_maxfr) = MR_LABEL(RESUME_LABEL(RedoPoint));
     MR_redofr_slot(MR_maxfr) = MR_maxfr;
     MR_based_framevar(MR_maxfr, 1) = (MR_Word) MR_cur_leader;
+
+    /* fall through to ReturnAnswer */
 }
 
 MR_define_label(RESUME_LABEL(ReturnAnswer));
@@ -1506,10 +1495,11 @@
 
     MR_cur_leader = (MR_Subgoal *) MR_based_framevar(MR_maxfr, 1);
 
+    /* fall through to RestartPoint */
+
 MR_define_label(RESUME_LABEL(RestartPoint));
 {
     MR_ResumeInfo   *resume_info;
-    MR_Subgoal      *cur_subgoal;
     
     resume_info = MR_cur_leader->MR_sg_resume_info;
 
@@ -1533,31 +1523,75 @@
     }
 #endif  /* MR_TABLE_DEBUG */
 
-    cur_subgoal = resume_info->MR_ri_cur_subgoal;
-    if (cur_subgoal->MR_sg_num_committed_ans != cur_subgoal->MR_sg_num_ans) {
-        resume_info->MR_ri_changed = MR_TRUE;
+    MR_GOTO_LABEL(RESUME_LABEL(LoopOverSuspensions));
+}
+
+MR_define_label(RESUME_LABEL(FixPointCheck));
+{
+    MR_ResumeInfo   *resume_info;
+    MR_SubgoalList  subgoal_list;
+    MR_Subgoal      *subgoal;
+    MR_ConsumerList consumer_list;
+    MR_Consumer     *consumer;
+    MR_bool         found_changes;
+
+    resume_info = MR_cur_leader->MR_sg_resume_info;
+    found_changes = MR_FALSE;
+    for (subgoal_list = MR_cur_leader->MR_sg_followers;
+        subgoal_list != NULL;
+        subgoal_list = subgoal_list->MR_sl_next)
+    {
+        subgoal = subgoal_list->MR_sl_item;
+        for (consumer_list = subgoal->MR_sg_consumer_list;
+            consumer_list != NULL;
+            consumer_list = consumer_list->MR_cl_next)
+        {
+            consumer = consumer_list->MR_cl_item;
+            if (*(consumer->MR_cns_remaining_answer_list_ptr) != NULL) {
+#ifdef  MR_TABLE_DEBUG
+                if (MR_tabledebug) {
+                    printf("consumer %s of subgoal %s has unconsumed answers\n",
+                        MR_consumer_addr_name(consumer),
+                        MR_subgoal_addr_name(subgoal));
+                }
+#endif  /* MR_TABLE_DEBUG */
+                found_changes = MR_TRUE;
+            }
+        }
+    }
+
+    if (found_changes) {
+#ifdef  MR_TABLE_DEBUG
+        if (MR_tabledebug) {
+            printf("no fixpoint; start completion op all over again\n");
     }
+#endif  /* MR_TABLE_DEBUG */
 
-    MR_GOTO_LABEL(RESUME_LABEL(LoopOverSuspensions));
+        resume_info->MR_ri_subgoal_list = MR_cur_leader->MR_sg_followers;
+        MR_GOTO_LABEL(RESUME_LABEL(StartCompletionOp));
+    }
+
+    /* fall through to ReachedFixpoint */
 }
+
 MR_define_label(RESUME_LABEL(ReachedFixpoint));
 {
-    MR_SubgoalList  table_list;
+    MR_SubgoalList  subgoal_list;
     MR_ResumeInfo   *resume_info;
 
-    for (table_list = MR_cur_leader->MR_sg_followers;
-        table_list != NULL;
-        table_list = table_list->MR_sl_next)
+    for (subgoal_list = MR_cur_leader->MR_sg_followers;
+        subgoal_list != NULL;
+        subgoal_list = subgoal_list->MR_sl_next)
     {
 #ifdef  MR_TABLE_DEBUG
         if (MR_tabledebug) {
             printf("marking table %s complete\n",
-                MR_subgoal_addr_name(table_list->MR_sl_item));
+                MR_subgoal_addr_name(subgoal_list->MR_sl_item));
         }
 #endif
 
-        table_list->MR_sl_item->MR_sg_status = MR_SUBGOAL_COMPLETE;
-        table_list->MR_sl_item->MR_sg_num_committed_ans = -1;
+        subgoal_list->MR_sl_item->MR_sg_status = MR_SUBGOAL_COMPLETE;
+        subgoal_list->MR_sl_item->MR_sg_num_committed_ans = -1;
     }
 
     resume_info = MR_cur_leader->MR_sg_resume_info;
Index: runtime/mercury_minimal_model.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_minimal_model.h,v
retrieving revision 1.4
diff -u -b -r1.4 mercury_minimal_model.h
--- runtime/mercury_minimal_model.h	12 Mar 2004 06:02:06 -0000	1.4
+++ runtime/mercury_minimal_model.h	12 Mar 2004 06:02:33 -0000
@@ -160,6 +160,9 @@
 ** MR_sg_consumer_list_tail allowing fast appending to the end.
 **
 ** The MR_sg_generator_fr points to the generator's nondet stack frame.
+**
+** The MR_sg_deepest_nca_fr points to the deepest nondet stack frame that is
+** a nearest common ancestor (nca) of the generator and one of its consumers.
 */
 
 struct MR_Subgoal_Struct {
@@ -177,6 +180,7 @@
 	MR_ConsumerList		MR_sg_consumer_list;
 	MR_ConsumerList		*MR_sg_consumer_list_tail;
 	MR_Word			*MR_sg_generator_fr;
+	MR_Word			*MR_sg_deepest_nca_fr;
 #ifdef	MR_TABLE_DEBUG
 	const MR_Proc_Layout	*MR_sg_proc_layout;
 #endif	/* MR_TABLE_DEBUG */
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
Index: tests/tabling/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/tabling/Mmakefile,v
retrieving revision 1.23
diff -u -b -r1.23 Mmakefile
--- tests/tabling/Mmakefile	12 Mar 2004 06:02:15 -0000	1.23
+++ tests/tabling/Mmakefile	12 Mar 2004 08:35:21 -0000
@@ -23,6 +23,7 @@
 	completed_consumer_in_solutions \
 	consumer_in_commit \
 	coup \
+	coup2 \
 	coup_det_frame \
 	coup_no_commit \
 	coup_non_tabled_frame \
@@ -42,10 +43,6 @@
 # as committed or negated contexts.
 #
 #	consumer_in_solutions
-#
-# We don't yet pass the following minimal model tests for undetermined reasons.
-#
-#	coup2
 
 # Tabling does not yet work in .rt grades
 ifneq "$(findstring .gc,$(GRADE))" ""
Index: tests/tabling/sg.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/tabling/sg.exp,v
retrieving revision 1.1
diff -u -b -r1.1 sg.exp
--- tests/tabling/sg.exp	12 Mar 2004 03:01:22 -0000	1.1
+++ tests/tabling/sg.exp	12 Mar 2004 09:13:28 -0000
@@ -1 +1,2 @@
 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]
+12572
Index: tests/tabling/sg.m
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/tabling/sg.m,v
retrieving revision 1.1
diff -u -b -r1.1 sg.m
--- tests/tabling/sg.m	12 Mar 2004 03:01:22 -0000	1.1
+++ tests/tabling/sg.m	12 Mar 2004 09:02:40 -0000
@@ -15,13 +15,13 @@
 main -->
 	{ solutions(sg1, Solns1) },
 	io__write(Solns1),
-	%% io__write_string("\n"),
-	%% { solutions(sg, Solns) },
-	%% io__write(Solns),
+	io__write_string("\n"),
+	{ solutions(sg, Solns) },
+	io__write_int(list__length(Solns)),
 	io__write_string("\n").
 
-% :- pred sg(pair(int,int)::out) is nondet.
-% sg(X-Y) :- tsg(X,Y).
+:- pred sg(pair(int,int)::out) is nondet.
+sg(X-Y) :- tsg(X,Y).
 
 % just to test a non-open call.
 :- pred sg1(int::out) is nondet.
@@ -29,15 +29,17 @@
 
 :- pred tsg(int, int).
 :- mode tsg(in, out) is nondet.
-% :- mode tsg(out, out) is nondet.
+:- mode tsg(out, out) is nondet.
 :- pragma minimal_model(tsg/2).
+:- pragma promise_pure(tsg/2).
 
 tsg(X,Y) :- cyl(X,X1), tsg(X1,Y1), acyl(Y1,Y).
-tsg(X,X).
+tsg(X::in,X::out).
+tsg(X::out,X::out) :- ( X = 1 ; cyl(_, X) ).
 
 :- pred cyl(int, int).
 :- mode cyl(in, out) is nondet.
-% :- mode cyl(out, out) is multi.
+:- mode cyl(out, out) is multi.
 
 cyl(1,30).
 cyl(1,40).
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list