Implementations of Knuth-Bendix completion
In KnuthBendix.jl
There are currently two actively developed implementations available:
KBIndex- a modification ofKBStack(see below) which usesIndexAutomatonfor rewrites andPrefixAutomatonfor reducing the rewriting system.KBPrefix- usesPrefixAutomatonfor both rewriting and (partial!) reduction of the rewriting system.
Three more implementations following Sims book directly are available, however their simplistic nature makes them suitable for educational purposes only.
KBPlainwhich follows the naive version,KBStackwhich uses stack and rule deactivation to maintain reducedness.KBS2AlgRuleDel- a modification ofKBStackwhich frequently deletes the rules which are deemed redundant.
In general all of those methods dispatch through a common interface:
KnuthBendix.knuthbendix — Functionknuthbendix(rws::AbstractRewritingSystem)
knuthbendix(settings::Settings, rws::AbstractRewritingSystem)Perform Knuth-Bendix completion on rewriting system rws using algorithm defined by method.
Rewriting systems returned by the completion algorithm may not be confluent. Usually this happens when
- number of rules stored in
rwsexceeds the one permitted insettings, - the completion process is manually interrupted,
- or when the
settingsallow the algorithm to skip the processing of certain critical pairs.
You should always assume that the rewriting system is not confluent, unless isconfluent returns true.
Unless manually interrupted the returned rewriting system will be reduced.
KnuthBendix.Settings — TypeSettings{CA<:CompletionAlgorithm}
Settings(alg; kwargs...)Struct encompassing knobs and switches for the knuthbendix completion.
Arguments:
alg::CompletionAlgorithm: the algorithms used for Knuth-Bendix completion
Keyword arguments
max_rules: forcefully terminate Knuth-Bendix completion if the number of rules exceedsmax_rules. Note: this is only a hint, the returnedrwsmay contain more or fewer rewriting rules.reduce_delay: Reduce the rws (and incorporate new found rules intorws) whenever the number of discovered rules since last reduction exceedsreduce_delay.confluence_delay: Attempt a confluence check whenever no new critical pairs are discovered after consideringconfluence_delaypairs of rules.max_length_lhs: The upper bound on the length of lhs of new rules considered in the algorithm.max_length_lhs: The upper bound on the length of rhs of new rules considered in the algorithm.max_length_overlap: The upper bound on the overlaps considered when finding new critical pairs.collect_dropped: The discovered critical pairs which are not admissible ( due to the length limiting options above) will be collected during completion. To access those pairs you will need to useknuthbendix!function and passWorkspacedirectly.verbosity: Specifies the level of verbosity.
Knuth-Bendix on Monoids and Automatic Groups (kbmag)
The baseline C-implementation of the Knuth-Bendix completion (and much more!) used by the GAP System. See kbmag source code and the documentation of the GAP interface.
Much wider functionality (automatic structures, etc.) and way more tuning options. In maintainance mode since ca. 1996.
Monoid Automata Factory (maf)
Somehow more advanced and modern C++-implementation of similar functionality to kbmag (it even has kbmag interface!). According to their docs
MAF succeeds on many examples where KBMAG either fails, or requires a very careful selection of options to succeed. In particular, MAF will usually work better with recursive orderings.
See package documentation and its source code. Not actively developed since 2011.