HaskellForMaths-0.4.9: Combinatorics, group theory, commutative algebra, non-commutative algebra

Safe Haskell | Safe
Language | Haskell98

Math.Algebra.Group.StringRewriting

Synopsis

- rewrite :: Eq a => [([a], [a])] -> [a] -> [a]
- rewrite1 :: Eq a => ([a], [a]) -> [a] -> Maybe [a]
- splitSubstring :: Eq a => [a] -> [a] -> Maybe ([a], [a])
- findOverlap :: Eq a => [a] -> [a] -> Maybe ([a], [a], [a])
- knuthBendix1 :: Ord a => [([a], [a])] -> [([a], [a])]
- ordpair :: (Ord (t a), Foldable t) => t a -> t a -> Maybe (t a, t a)
- shortlex :: (Ord (t a), Foldable t) => t a -> t a -> Ordering
- knuthBendix2 :: Ord a => [([a], [a])] -> [([a], [a])]
- merge :: Ord a => [a] -> [a] -> [a]
- knuthBendix3 :: Ord a => [([a], [a])] -> [([a], [a])]
- knuthBendix :: Ord a => [([a], [a])] -> [([a], [a])]
- nfs :: Ord a => ([a], [([a], [a])]) -> [[a]]
- elts :: Ord a => ([a], [([a], [a])]) -> [[a]]
- newtype SGen = S Int
- s_ :: Int -> SGen
- s1 :: SGen
- s2 :: SGen
- s3 :: SGen
- _S :: Int -> ([SGen], [([SGen], [a])])
- _S' :: Int -> ([SGen], [([SGen], [SGen])])
- tri :: Int -> Int -> Int -> ([Char], [([Char], [Char])])
- _D :: Int -> Int -> Int -> ([Char], [([Char], [Char])])

# Documentation

rewrite :: Eq a => [([a], [a])] -> [a] -> [a] Source #

Given a list of rewrite rules of the form (left,right), and a word, rewrite it by repeatedly replacing any left substring in the word by the corresponding right

rewrite1 :: Eq a => ([a], [a]) -> [a] -> Maybe [a] Source #

splitSubstring :: Eq a => [a] -> [a] -> Maybe ([a], [a]) Source #

findOverlap :: Eq a => [a] -> [a] -> Maybe ([a], [a], [a]) Source #

knuthBendix1 :: Ord a => [([a], [a])] -> [([a], [a])] Source #

ordpair :: (Ord (t a), Foldable t) => t a -> t a -> Maybe (t a, t a) Source #

shortlex :: (Ord (t a), Foldable t) => t a -> t a -> Ordering Source #

knuthBendix2 :: Ord a => [([a], [a])] -> [([a], [a])] Source #

merge :: Ord a => [a] -> [a] -> [a] Source #

knuthBendix3 :: Ord a => [([a], [a])] -> [([a], [a])] Source #

knuthBendix :: Ord a => [([a], [a])] -> [([a], [a])] Source #

Implementation of the Knuth-Bendix algorithm. Given a list of relations, return a confluent rewrite system. The algorithm is not guaranteed to terminate.

nfs :: Ord a => ([a], [([a], [a])]) -> [[a]] Source #

Given generators and a confluent rewrite system, return (normal forms of) all elements

elts :: Ord a => ([a], [([a], [a])]) -> [[a]] Source #

Given generators and relations, return (normal forms of) all elements

newtype SGen Source #

Constructors

S Int |

#### Instances

Instances details

Eq SGen Source # |
Instance details Defined in Math.Algebra.Group.StringRewriting Methods (==) :: SGen -> SGen -> Bool (/=) :: SGen -> SGen -> Bool
Ord SGen Source # |
Instance details Defined in Math.Algebra.Group.StringRewriting Methods compare :: SGen -> SGen -> Ordering (<) :: SGen -> SGen -> Bool (<=) :: SGen -> SGen -> Bool (>) :: SGen -> SGen -> Bool (>=) :: SGen -> SGen -> Bool max :: SGen -> SGen -> SGen min :: SGen -> SGen -> SGen
Show SGen Source # |
Instance details Defined in Math.Algebra.Group.StringRewriting Methods showsPrec :: Int -> SGen -> ShowS show :: SGen -> String showList :: [SGen] -> ShowS

s_ :: Int -> SGen Source #

s1 :: SGen Source #

s2 :: SGen Source #

s3 :: SGen Source #

_S :: Int -> ([SGen], [([SGen], [a])]) Source #

_S' :: Int -> ([SGen], [([SGen], [SGen])]) Source #

tri :: Int -> Int -> Int -> ([Char], [([Char], [Char])]) Source #

_D :: Int -> Int -> Int -> ([Char], [([Char], [Char])]) Source #