mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-24 13:53:54 +00:00
Estimated hours taken: 12
Branches: main
Add a new form of tabling pragma, fast_loose_memo. It differs from memo in
only one way: for arguments of user-defined types, instead of tabling every
single function symbol in the value, it tables a pointer to the term instead.
(Actually, it tables the contents of the selected argument register, so it
works even if the value is not a pointer.)
As the name implies, this form of tabling is faster than memo. The tradeoff
is that it is looser: if two invocations specify two terms that are at
different addresses but have the same value, this new form of tabling will
not recognize the commonality.
doc/reference_manual.texi:
Document the new pragma.
compiler/prog_data.m:
Generalize the type specifying eval methods to allow the expression
of the new form of tabling.
compiler/prog_io_pragma.m:
Parse the new form of tabling pragma.
compiler/hlds_pred.m:
Handle the new, more general form of memoing.
Add the required provisions for the representation of the new form
of trie step in tables.
compiler/table_gen.m:
Implement the new form of tabling as a minor variant of memo tabling.
Convert this module to four-space indentation to reduce the number
of bad line breaks.
compiler/layout_out.m:
compiler/prog_out.m:
Conform to the changes above.
library/table_builtins.m:
Add the primitives required to implement fast_loose_memo.
Fix an old bug: make table_lookup_insert_poly call the right macro.
runtime/mercury_tabling.h:
runtime/mercury_tabling_macros.h:
runtime/mercury_tabling_preds.h:
Provide the basic mechanism of fast_loose_memo tabling: a hash table
that works on MR_Words.
runtime/mercury_stack_layout.h:
Allow the representation of the new evaluation method and the new form
of trie step.
tests/tabling/fast_loose.{m,exp}:
Add this test case of the operation of fast_loose tabling. The test
case pronounces success only if fast_loose_memo is measured to be
significantly faster than plain memo.
tests/tabling/Mmakefile:
Enable the new test case.
2 lines
17 B
Plaintext
2 lines
17 B
Plaintext
fast_loose works
|