This page contains information about the member functions of KnuthBendix that control various settings that influence the running of the Knuth-Bendix algorithm.
There are a fairly large number of settings, they can profoundly alter the run time, but it is hard to predict what settings will work best for any particular input.
See also Runner for further settings.
|
| size_t | check_confluence_interval () const noexcept |
| | Get the current interval at which confluence is checked.
|
| KnuthBendix & | check_confluence_interval (size_t val) |
| | Set the interval at which confluence is checked.
|
| size_t | max_overlap () const noexcept |
| | Get the current maximum length of overlaps to be considered.
|
| KnuthBendix & | max_overlap (size_t val) |
| | Set the maximum length of overlaps to be considered.
|
| size_t | max_pending_rules () const noexcept |
| | Get the current number of rules to accumulate before processing.
|
| KnuthBendix & | max_pending_rules (size_t val) |
| | Set the number of rules to accumulate before they are processed.
|
| size_t | max_rules () const noexcept |
| | Get the current maximum number of rules.
|
| KnuthBendix & | max_rules (size_t val) |
| | Set the maximum number of rules.
|
| options::overlap | overlap_policy () const noexcept |
| | Get the current overlap policy.
|
| KnuthBendix & | overlap_policy (typename options::overlap val) |
| | Set the overlap policy.
|
template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
| KnuthBendix & check_confluence_interval |
( |
size_t | val | ) |
|
|
inline |
The function run periodically checks if the system is already confluent. This function can be used to set how frequently this happens, it is the number of new overlaps that should be considered before checking confluence. Setting this value too low can adversely affect the performance of run.
The default value is 4096, and should be set to LIMIT_MAX if run should never check if the system is already confluent.
- Parameters
-
| val | the new value of the interval. |
- Returns
- A reference to
*this.
- Complexity
- Constant.
- See also
- run.
template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
| KnuthBendix & max_overlap |
( |
size_t | val | ) |
|
|
inline |
This function can be used to specify the maximum length of the overlap of two left hand sides of rules that should be considered in run.
If this value is less than the longest left hand side of a rule, then run can terminate without the system being confluent.
- Parameters
-
| val | the new value of the maximum overlap length. |
- Returns
- A reference to
*this.
- Complexity
- Constant.
- See also
- run.
template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
| size_t max_pending_rules |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
This function can be used to return the number of pending rules that must accumulate before they are reduced, processed, and added to the system.
The default value is 128.
- Returns
- The batch size, a value of type
size_t.
- Exceptions
- This function is noexcept and is guaranteed never to throw.
- Complexity
- Constant.
template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
| KnuthBendix & max_pending_rules |
( |
size_t | val | ) |
|
|
inline |
This function can be used to specify the number of pending rules that must accumulate before they are reduced, processed, and added to the system.
The default value is 128, and should be set to 1 if run should attempt to add each rule as they are created without waiting for rules to accumulate.
- Parameters
-
| val | the new value of the batch size. |
- Returns
- A reference to
*this.
- Complexity
- Constant.