| Copyright | (c) Andrey Mokhov 2016-2022 |
|---|---|
| License | MIT (see the file LICENSE) |
| Maintainer | andrey.mokhov@gmail.com |
| Stability | experimental |
| Safe Haskell | None |
| 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
The state of the order.
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]) ]