| Copyright | (c) Andrey Mokhov 2016-2022 |
|---|---|
| License | MIT (see the file LICENSE) |
| Maintainer | [email protected] |
| Stability | experimental |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Algebra.Graph.Labelled.Example.Automaton
Description
Alga is a library for algebraic construction and manipulation of graphs in Haskell. See this paper for the motivation behind the library, the underlying theory, and implementation details.
This module contains a simple example of using edge-labelled graphs defined in the module Algebra.Graph.Labelled for working with finite automata.
Documentation
The alphabet of actions for ordering coffee or tea.
Instances
| Bounded Alphabet Source # | |
| Enum Alphabet Source # | |
Defined in Algebra.Graph.Labelled.Example.Automaton Methods succ :: Alphabet -> Alphabet Source # pred :: Alphabet -> Alphabet Source # toEnum :: Int -> Alphabet Source # fromEnum :: Alphabet -> Int Source # enumFrom :: Alphabet -> [Alphabet] Source # enumFromThen :: Alphabet -> Alphabet -> [Alphabet] Source # enumFromTo :: Alphabet -> Alphabet -> [Alphabet] Source # enumFromThenTo :: Alphabet -> Alphabet -> Alphabet -> [Alphabet] Source # | |
| Show Alphabet Source # | |
| Eq Alphabet Source # | |
| Ord Alphabet Source # | |
Defined in Algebra.Graph.Labelled.Example.Automaton | |
The state of the order.
Instances
| Bounded State Source # | |
| Enum State Source # | |
Defined in Algebra.Graph.Labelled.Example.Automaton Methods succ :: State -> State Source # pred :: State -> State Source # toEnum :: Int -> State Source # fromEnum :: State -> Int Source # enumFrom :: State -> [State] Source # enumFromThen :: State -> State -> [State] Source # enumFromTo :: State -> State -> [State] Source # enumFromThenTo :: State -> State -> State -> [State] Source # | |
| Show State Source # | |
| Eq State Source # | |
| Ord State Source # | |
Defined in Algebra.Graph.Labelled.Example.Automaton | |
reachability :: Map State [State] Source #
The map of State reachability.
reachability = Map.fromList$ map (id&&&reachableskeleton) [Choice..] where skeleton = emap (Any . not .isZero) coffeeTeaAutomaton
Or, when evaluated:
reachability = Map.fromList[ (Choice, [Choice,Payment,Complete]) , (Payment, [Payment,Choice,Complete]) , (Complete, [Complete]) ]