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.
|
|
◆ check_confluence_interval() [1/2]
template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
size_t check_confluence_interval |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
The function run periodically checks if the system is already confluent. This function can be used to return how frequently this happens, it is the number of new overlaps that should be considered before checking confluence.
- Returns
- The interval at which confluence is checked a value of type
size_t
.
- Exceptions
- This function is
noexcept
and is guaranteed never to throw.
- Complexity
- Constant.
- See also
- run.
◆ check_confluence_interval() [2/2]
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.
◆ max_overlap() [1/2]
template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
size_t max_overlap |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
This function returns the maximum length of the overlap of two left hand sides of rules that should be considered in run.
- Returns
- The maximum length of the overlaps to be considered a value of type
size_t
.
- Exceptions
- This function is
noexcept
and is guaranteed never to throw.
- Complexity
- Constant.
- See also
- run.
◆ max_overlap() [2/2]
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.
◆ max_pending_rules() [1/2]
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.
◆ max_pending_rules() [2/2]
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.
◆ max_rules() [1/2]
template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
size_t max_rules |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
This function returns the (approximate) maximum number of rules that the system should contain. If this is number is exceeded in calls to run or by_overlap_length, then they will terminate and the system may not be confluent.
- Returns
- The maximum number of rules the system should contain, a value of type
size_t
.
- Exceptions
- This function is
noexcept
and is guaranteed never to throw.
- Complexity
- Constant.
- See also
- run.
◆ max_rules() [2/2]
template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
KnuthBendix & max_rules |
( |
size_t | val | ) |
|
|
inline |
This function sets the (approximate) maximum number of rules that the system should contain. If this is number is exceeded in calls to run or knuth_bendix::by_overlap_length, then they will terminate and the system may not be confluent.
By default this value is POSITIVE_INFINITY.
- Parameters
-
val | the maximum number of rules. |
- Returns
- A reference to
*this
.
- Complexity
- Constant.
- See also
- run.
◆ overlap_policy() [1/2]
template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
options::overlap overlap_policy |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
This function returns the way that the length of an overlap of two words in the system is measured.
- Returns
- The overlap policy.
- Exceptions
- This function is
noexcept
and is guaranteed never to throw.
- Complexity
- Constant.
- See also
- overlap.
◆ overlap_policy() [2/2]
template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
KnuthBendix & overlap_policy |
( |
typename options::overlap | val | ) |
|
This function can be used to determine the way that the length of an overlap of two words in the system is measured.
- Parameters
-
- Returns
- A reference to
*this
.
- Complexity
- Constant.
- See also
- overlap.