Code Monkey home page Code Monkey logo

finite-semigroups's Introduction

Finite Semigroups

Current Version License Issues

A Haskell library for constructing and analyzing finite semigroups.

Originally part of the Language Toolkit, the systems here allow one to specify a finite semigroup via some set of generating actions, with or without an ordering relation, and decide whether the resulting semigroup has certain properties.

Features

Construct an action semigroup from bases:

ghci> s = fromBases [[0,0,2],[1,2,2]]
ghci> s
fromBases [[0,0,2],[1,2,2]]

Construct the multiplication table, either as another semigroup representation or as an actual table:

ghci> fstable s
fstable (fromBases [[1,1,3,3,1,5],[2,4,5,2,5,5]])
ghci> printTable = mapM_ print . getTable . fstable
ghci> printTable s
[0,3,0,3,4]
[2,4,4,1,4]
[2,1,2,1,4]
[0,4,4,3,4]
[4,4,4,4,4]

Convert a semigroup into a monoid, or vice versa:

ghci> printTable (monoid s)
[0,1,2,3,4,5]
[1,1,4,1,4,5]
[2,3,5,5,2,5]
[3,3,2,3,2,5]
[4,1,5,5,4,5]
[5,5,5,5,5,5]
ghci> m = monoid s
ghci> printTable (projectedSubsemigroup m)
[0,3,0,3,4]
[2,4,4,1,4]
[2,1,2,1,4]
[0,4,4,3,4]
[4,4,4,4,4]

Adjoin an order to a semigroup:

ghci> import qualified Data.IntSet as IntSet
ghci> os = assignOrderBy (syntacticOrder 0 (IntSet.fromList [0,2])) s
ghci> os
assignOrder [(1,2),(1,3),(2,0),(3,0),(4,1)] (fromBases [[0,0,2],[1,2,2]])

Determine whether a semigroup satisifies some predefined properties:

ghci> isAperiodic s
True
ghci> isDA s
False
ghci> locally isTrivial s
False
ghci> locally isBand s
True
ghci> locally isCommutative s
True

Determine if an ordered semigroup is in an ordered pseudovariety:

ghci> isVariety "[a*xa* < a*]" os
Just True
ghci> isVariety "[a*xa* = a*]" os
Just False

finite-semigroups's People

Contributors

vvulpes0 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.