diff --git a/src/automata.jl b/src/automata.jl index 3cb7215f..201d0dde 100644 --- a/src/automata.jl +++ b/src/automata.jl @@ -238,7 +238,7 @@ end walk(a::AbstractAutomaton, signature::AbstractWord[, state=initialstate(a)]) Walk through index automaton according to the path given by the `signature`, starting from `state`. -Return a tuple `(idx, state)` where `idx` is the length of prefix of signature which was successfuly traced and +Return a tuple `(idx, state)` where `idx` is the length of prefix of signature which was successfully traced and `state` is the final state. Note that if `idx ≠ length(signature)` there is no path in the automaton corresponding to the full signature. """ diff --git a/src/derive_rule.jl b/src/derive_rule.jl index 5d1c7527..bf0e473d 100644 --- a/src/derive_rule.jl +++ b/src/derive_rule.jl @@ -26,7 +26,7 @@ end """ deriverule!(rs::RewritingSystem, stack [, o::Ordering=ordering(rs),) Adds a rule to a rewriting system and deactivates others (if necessary) that -insures that the set of rules is reduced while maintining local confluence. +insures that the set of rules is reduced while maintaining local confluence. See [Sims, p. 76]. """ function deriverule!(rs::RewritingSystem, stack, o::Ordering = ordering(rs)) @@ -58,7 +58,7 @@ function deriverule!(rs::RewritingSystem, stack, o::Ordering = ordering(rs)) end ##################################### -# KBS with delation of inactive rules +# KBS with deletion of inactive rules ##################################### # As of now: default implementation @@ -67,7 +67,7 @@ end deriverule!(rs::RewritingSystem, stack, work::kbWork [, o::Ordering=ordering(rs), deleteinactive::Bool = false]) Adds a rule to a rewriting system and deactivates others (if necessary) that -insures that the set of rules is reduced while maintining local confluence. +insures that the set of rules is reduced while maintaining local confluence. See [Sims, p. 76]. """ function deriverule!(rs::RewritingSystem{W}, stack, work::kbWork, @@ -107,7 +107,7 @@ end deriverule!(rs::RewritingSystem, at::Automaton, stack [,work = nothing, o::Ordering=ordering(rs))]) Adds a rule to a rewriting system and deactivates others (if necessary) that -insures that the set of rules is reduced while maintining local confluence. +insures that the set of rules is reduced while maintaining local confluence. See [Sims, p. 76]. """ function deriverule!(rs::RewritingSystem{W}, stack, diff --git a/src/force_confluence.jl b/src/force_confluence.jl index ca38675c..a8a8d88f 100644 --- a/src/force_confluence.jl +++ b/src/force_confluence.jl @@ -57,7 +57,7 @@ end ##################################### -# KBS with delation of inactive rules +# KBS with deletion of inactive rules ##################################### # As of now: default implementation diff --git a/src/helper_structures.jl b/src/helper_structures.jl index 4def1183..9381be04 100644 --- a/src/helper_structures.jl +++ b/src/helper_structures.jl @@ -3,7 +3,7 @@ abstract type AbstractBufferPair{T} end """ struct BufferPair{T} <: AbstractBufferPair{T} A helper struct used to store pair of `BufferWord` used for rewriting. -`BufferPair`s are used in conjucntion with `kbWork` struct. +`BufferPair`s are used in conjunction with `kbWork` struct. """ struct BufferPair{T} <: AbstractBufferPair{T} _vWord::BufferWord{T} @@ -12,14 +12,14 @@ end BufferPair{T}() where {T} = BufferPair(one(BufferWord{T}), one(BufferWord{T})) -get_v_word(bp::BufferPair) = wrk._vWord -get_w_word(bp::BufferPair) = wrk._wWord +get_v_word(bp::BufferPair) = bp._vWord +get_w_word(bp::BufferPair) = bp._wWord """ function rewrite_from_left(u::W, bp::BufferPair, rewriting) Rewrites a word from left using buffer words from `BufferPair` declared in `kbWork` object and `rewriting` object. The `rewriting` object must implement -`rewrite_from_left!(v::AbstractWord, w::AbstractWord, rewriting)` to succesfully +`rewrite_from_left!(v::AbstractWord, w::AbstractWord, rewriting)` to successfully rewrite `u`. Important: this implementation returns an instance of `BufferWord`! """ diff --git a/src/kbs.jl b/src/kbs.jl index 882cab85..f81d042d 100644 --- a/src/kbs.jl +++ b/src/kbs.jl @@ -51,8 +51,8 @@ end Implements the Knuth-Bendix completion algorithm that yields a reduced, confluent rewriting system. See [Sims, p.77]. -Warning: forced termiantion takes place after the number of rules stored within -the RewritngSystem reaches `maxrules`. +Warning: forced termination takes place after the number of rules stored within +the RewritingSystem reaches `maxrules`. """ function knuthbendix2!(rws::RewritingSystem, o::Ordering = ordering(rws); maxrules::Integer = 100) @@ -91,7 +91,7 @@ function knuthbendix2(rws::RewritingSystem, o::Ordering = ordering(rws); maxrule end ##################################### -# KBS with delation of inactive rules +# KBS with deletion of inactive rules ##################################### # As of now: default implementation @@ -102,8 +102,8 @@ end Implements the Knuth-Bendix completion algorithm that yields a reduced, confluent rewriting system. See [Sims, p.77]. -Warning: forced termiantion takes place after the number of rules stored within -the RewritngSystem reaches `maxrules`. +Warning: forced termination takes place after the number of rules stored within +the RewritingSystem reaches `maxrules`. """ function knuthbendix2deleteinactive!(rws::RewritingSystem{W}, o::Ordering = ordering(rws); maxrules::Integer = 100) where {W<:AbstractWord} @@ -148,8 +148,8 @@ end Implements the Knuth-Bendix completion algorithm that yields a reduced, confluent rewriting system. See [Sims, p.77]. -Warning: forced termiantion takes place after the number of rules stored within -the RewritngSystem reaches `maxrules`. +Warning: forced termination takes place after the number of rules stored within +the RewritingSystem reaches `maxrules`. """ function knuthbendix2automaton!(rws::RewritingSystem{W}, o::Ordering = ordering(rws); maxrules::Integer = 100) where {W<:AbstractWord} @@ -191,8 +191,6 @@ end # General interface ################### -# This does not work: - function knuthbendix!( rws::RewritingSystem, o::Ordering = ordering(rws); diff --git a/src/orderings.jl b/src/orderings.jl index f21caad5..ed498682 100644 --- a/src/orderings.jl +++ b/src/orderings.jl @@ -6,7 +6,7 @@ export LenLex, WreathOrder, RecursivePathOrder Abstract type representing word orderings. The subtypes of `WordOrdering` should contain a field `A` storing the `Alphabet` -over which a particular order is defined. Morever, an `Base.lt` method should be +over which a particular order is defined. Moreover, an `Base.lt` method should be defined to compare whether one word is less than the other (in the ordering defined). """ @@ -52,7 +52,7 @@ end struct WreathOrder{T} <: WordOrdering Structure representing Basic Wreath-Product ordering (determined by the Lexicographic -ordering of the Alphabet) of the words over given Alphabet. This Lexicographinc +ordering of the Alphabet) of the words over given Alphabet. This Lexicographic ordering of an Alphabet is implicitly specified inside Alphabet struct. """ struct WreathOrder{T} <: WordOrdering @@ -100,7 +100,7 @@ end struct RecursivePathOrder{T} <: WordOrdering Structure representing Recursive Path Ordering (determined by the Lexicographic -ordering of the Alphabet) of the words over given Alphabet. This Lexicographinc +ordering of the Alphabet) of the words over given Alphabet. This Lexicographic ordering of an Alphabet is implicitly specified inside Alphabet struct. For the definition see > Susan M. Hermiller, Rewriting systems for Coxeter groups diff --git a/src/rewriting.jl b/src/rewriting.jl index c2a8cbdc..d7d80881 100644 --- a/src/rewriting.jl +++ b/src/rewriting.jl @@ -1,7 +1,7 @@ """ rewrite_from_left(u::AbstractWord, rewriting) Rewrites a word from left using `rewriting` object. The object must implement -`rewrite_from_left!(v::AbstractWord, w::AbstractWord, rewriting)` to succesfully rewrite `u`. +`rewrite_from_left!(v::AbstractWord, w::AbstractWord, rewriting)` to successfully rewrite `u`. """ function rewrite_from_left(u::W, rewriting) where {W<:AbstractWord} isempty(rewriting) && return u @@ -48,7 +48,7 @@ methods which constitute `AbstractRewritingSystem` interface: * `Base.pop!`/`Base.popfirst!`: deleting a single rule at the end/beginning * `Base.append!`/`Base.prepend!`: appending a another system at the end/beginning, * `Base.insert!`: inserting a single rule at a given place - * `Base.delateat!`: deleting rules at given positions + * `Base.deleteat!`: deleting rules at given positions * `Base.empty!`: deleting all the rules * `length`: the number of rules (not necessarily unique) stored inside the system """