Rewriting System
It's just a struct that holds things together required for Knuth-Bendix completion.
KnuthBendix.RewritingSystem
— TypeRewritingSystem{W<:AbstractWord, O<:Ordering}
RewritingSystem(rwrules::Vector{Pair{W,W}}, order[; confluent=false, reduced=false])
RewritingSystem
holds the list of ordered (by order
) rewriting rules of W<:AbstractWord
s.
KnuthBendix.rules
— Methodrules(rws::AbstractRewritingSystem)
Return the iterator over active rewriting rules.
KnuthBendix.ordering
— Methodordering(rws::RewritingSystem)
Return the ordering of the rewriting system.
KnuthBendix.alphabet
— Methodalphabet(rws::AbstractRewritingSystem)
Return the underlying Alphabet
of the rewriting system.
KnuthBendix.isreduced
— Functionisreduced(rws::RewritingSystem)
Check whether the rewriting system knows its reducedness.
Rewriting systems assume non-reducedness at creation. knuthbendix
will always return reduced rewriting system, unless manually interrupted.
KnuthBendix.isconfluent
— Functionisconfluent(rws::RewritingSystem)
Check whether the rewriting system is confluent.
Since check_confluence
is relatively cheap only for reduced rewriting systems isconfluent
will not try to reduce the system on its own and will return false
. For definitive answer one should reduce!
the rewrting system before calling isconfluent
.
KnuthBendix.check_confluence
— Functioncheck_confluence(rws::AbstractRewritingSystem)
Check if a reduced rewriting system is confluent.
The check constructs index automaton for rws
and runs a backtrack search for all rules of the system. Return a stack of critical pairs and an index of the rule for which local confluence failed. The returned stack is empty if and only if rws
is confluent.
KnuthBendix.reduce!
— Methodreduce!(rws::RewritingSystem[; kwargs...])
Reduce the rewriting system in-place using the default algorithm
Currently the default algorithm is to use KBPrefix
in reduce!(::KBPrefix, ::RewritingSystem)
KnuthBendix.isirreducible
— Methodisirreducible(w::AbstractWord, rws::RewritingSystem)
Returns whether a word is irreducible with respect to a given rewriting system