Copyright | Copyright (c) 2020 Ajay Kumar Eeralla |
---|---|
Maintainer | ajay.eeralla@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Data.LTS
Description
This module implements a labelled transition system
Synopsis
- data LTSState a = LTSState {}
- data Transition a b = Transition {
- transitionFrom :: LTSState a
- transitionGuard :: b
- transitionTo :: LTSState a
- type LTS a b = [Transition a b]
- checkTrans :: (Eq a, Eq b) => LTSState a -> LTS a b -> Bool
- getFromIds :: (Eq a, Eq b) => LTS a b -> [Int]
- getToIds :: (Eq a, Eq b) => LTS a b -> [Int]
- sortById :: Eq a => [LTSState a] -> [LTSState a]
- sortByToSt :: (Eq a, Eq b) => LTS a b -> LTS a b
- sortByFromSt :: (Eq a, Eq b) => LTS a b -> LTS a b
- collectTrans :: (Eq a, Eq b) => LTSState a -> LTS a b -> Bool -> LTS a b
- getStartSt :: (Eq a, Eq b) => LTS a b -> LTSState a
- getFinalSt :: (Eq a, Eq b) => LTS a b -> LTSState a
- depth :: (Eq a, Eq b) => LTS a b -> LTSState a -> Nat
- type Alphabet b = [b]
- findTransIndex :: (Eq a, Eq b) => LTSState a -> b -> LTS a b -> Int
- transExists :: (Eq a, Eq b) => LTSState a -> b -> LTS a b -> Bool
Documentation
LTSState is a record type which may hold id, output, etc.
Instances
Eq a => Eq (LTSState a) Source # | |
Eq a => Ord (LTSState a) Source # | Define Ord instance by id |
Read a => Read (LTSState a) Source # | |
Show a => Show (LTSState a) Source # | |
Generic (LTSState a) Source # | |
type Rep (LTSState a) Source # | |
Defined in Data.LTS type Rep (LTSState a) = D1 (MetaData "LTSState" "Data.LTS" "LTS-0.1.0.0-LMCmeFMnp4HKv6s7g1TTv7" False) (C1 (MetaCons "LTSState" PrefixI True) (S1 (MetaSel (Just "stateId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Just "out") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))) |
data Transition a b Source #
Transition models that on a LTSState, given input symbol from an alphabet [b], | takes to the next LTSState
Constructors
Transition | |
Fields
|
Instances
type LTS a b = [Transition a b] Source #
LTS is a list of Transition
checkTrans :: (Eq a, Eq b) => LTSState a -> LTS a b -> Bool Source #
Check if the set of transitions has same origin
getFromIds :: (Eq a, Eq b) => LTS a b -> [Int] Source #
Sorting related functions
| Get origin LTSState
ids
collectTrans :: (Eq a, Eq b) => LTSState a -> LTS a b -> Bool -> LTS a b Source #
Compute set of transitions (that can be ordered using a flag b) from a given LTSState
depth :: (Eq a, Eq b) => LTS a b -> LTSState a -> Nat Source #
Compute depth of a transition system which is the longest simple path | from the start state to a final state
findTransIndex :: (Eq a, Eq b) => LTSState a -> b -> LTS a b -> Int Source #
Return the index of the Transition
that current state can take on input symbol