[m-rev.] diff: minimal model improvements
Julien Fischer
juliensf at cs.mu.OZ.AU
Fri Jun 10 18:59:10 AEST 2005
On Fri, 10 Jun 2005, Zoltan Somogyi wrote:
> A bunch of improvements for minimal model tabling.
>
>
> library/table_builtin.m:
> runtime/mercury_tabling.h:
> Make the implementation of table_mm_answer_is_not_duplicate be a
> foreign_proc, not hand-written code, for simpler maintenance.
> We gain no speedup from keeping it handwritten; the implementation
> isn't even used with --tabling-via-extra-args, which is now the
> default.
>
...
> Index: library/table_builtin.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/library/table_builtin.m,v
> retrieving revision 1.45
> diff -u -b -r1.45 table_builtin.m
> --- library/table_builtin.m 8 Jun 2005 04:13:06 -0000 1.45
> +++ library/table_builtin.m 8 Jun 2005 07:58:35 -0000
> @@ -833,6 +833,8 @@
> % If the answer has been generated before, fail.
> %
> :- impure pred table_mm_answer_is_not_duplicate(ml_trie_node::in) is semidet.
> +:- impure pred table_mm_answer_is_not_duplicate_shortcut(ml_subgoal::in)
> + is semidet.
>
> % Create a new slot in the answer list of the subgoal, create a new
> % answer block of the given size, and put the answer block in the new
> @@ -881,7 +883,6 @@
> %
> :- external(table_mm_suspend_consumer/2).
> :- external(table_mm_completion/1).
> -:- external(table_mm_answer_is_not_duplicate/1).
> :- external(table_mm_return_all_nondet/2).
> :- external(table_mm_return_all_multi/2).
>
> @@ -900,6 +901,26 @@
> ").
>
> :- pragma foreign_proc("C",
> + table_mm_answer_is_not_duplicate(TrieNode::in),
> + [will_not_call_mercury],
> +"
> + MR_table_mm_answer_is_not_duplicate(TrieNode, SUCCESS_INDICATOR);
> +").
> +
This change also requires the following:
Estimated hours taken: 0.2
Branches: main
runtime/mercury_tabling_preds.h:
Add a macro definition for MR_table_mm_answer_is_not_duplicate
when MR_USE_MINIMAL_MODEL_STACK_COPY is not defined. This
is now necessary for the library to compile in non .mm grades.
Index: runtime/mercury_tabling_preds.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_tabling_preds.h,v
retrieving revision 1.7
diff -u -r1.7 mercury_tabling_preds.h
--- runtime/mercury_tabling_preds.h 8 Jun 2005 04:13:08 -0000 1.7
+++ runtime/mercury_tabling_preds.h 10 Jun 2005 08:42:14 -0000
@@ -771,6 +771,10 @@
do { \
MR_fatal_error(MR_MMSC_ERROR); \
} while(0)
+#define MR_table_mm_answer_is_not_duplicate(T, Succ) \
+ do { \
+ MR_fatal_error(MR_MMSC_ERROR); \
+ } while(0)
#define MR_table_mm_create_answer_block(Subgoal, Size, AnswerBlock) \
do { \
MR_fatal_error(MR_MMSC_ERROR); \
Julien.
--------------------------------------------------------------------------
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