Last active
August 29, 2015 14:16
-
-
Save mroman42/a43481027bd61c8e3bc8 to your computer and use it in GitHub Desktop.
Computes the multiplication table of a group
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Computes the multiplication table of a group | |
-- Using the Knuth-Bendix algorithm | |
-- Uses HaskellForMath, which can be installed: | |
-- cabal install HaskellForMath | |
import Math.Algebra.Group.StringRewriting | |
-- Computes the multiplication table, given the group generators | |
-- and the set of relations as strings, as in this example: | |
-- multtable "tw" [("www",""),("tt",""),("tw","wwt")] | |
multtable g r = [[rewrite cs (a ++ b) | a <- nf] | b <- nf] | |
where cs = knuthBendix r | |
nf = nfs (g,cs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment