Skip to content

Commit

Permalink
Merge pull request #48 from kalmarek/doc_fixes
Browse files Browse the repository at this point in the history
Doc fixes
  • Loading branch information
mikolajpabiszczak authored May 5, 2021
2 parents 3b2b58b + bbd7fd6 commit 6016a81
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/automata.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
8 changes: 4 additions & 4 deletions src/derive_rule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/force_confluence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ end


#####################################
# KBS with delation of inactive rules
# KBS with deletion of inactive rules
#####################################

# As of now: default implementation
Expand Down
8 changes: 4 additions & 4 deletions src/helper_structures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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`!
"""
Expand Down
16 changes: 7 additions & 9 deletions src/kbs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -191,8 +191,6 @@ end
# General interface
###################

# This does not work:

function knuthbendix!(
rws::RewritingSystem,
o::Ordering = ordering(rws);
Expand Down
6 changes: 3 additions & 3 deletions src/orderings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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).
"""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/rewriting.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
"""
Expand Down

0 comments on commit 6016a81

Please sign in to comment.