| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Modelling.PetriNet.Reach.Reach
Description
originally from Autotool (https:/gitlab.imn.htwk-leipzig.deautotool/all0) based on revision: ad25a990816a162fdd13941ff889653f22d6ea0a based on file: collectionsrcPetri/Reach.hs
Synopsis
- data ReachInstance s t = ReachInstance {
- netGoal :: NetGoal s t
- minLength :: Int
- noLongerThan :: Maybe Int
- showGoalNet :: Bool
- showPlaceNames :: Bool
- maxDisplayedSolutions :: Int
- shortestSolutions :: Either (NonEmpty [t]) (NonEmpty [t])
- withLengthHint :: Maybe Int
- withMinLengthHint :: Bool
- rejectSpaceballsLength :: Maybe Int
- data NetGoal s t = NetGoal {}
- data ReachConfig = ReachConfig {}
- data NetGoalConfig = NetGoalConfig {}
- checkReachConfig :: ReachConfig -> Maybe String
- generateReach :: (MonadCatch m, MonadDiagrams m, MonadGraphviz m) => ReachConfig -> Int -> m (ReachInstance Place Transition)
- reachTask :: forall (m :: Type -> Type) s t. (MonadCache m, MonadDiagrams m, MonadGraphviz m, MonadThrow m, Ord s, Ord t, OutputCapable m, Show s, Show t) => Bool -> FilePath -> ReachInstance s t -> LangM m
- verifyReach :: forall a t (m :: Type -> Type). (Ord a, Ord t, OutputCapable m, Show a, Show t) => ReachInstance a t -> LangM m
- reachEvaluation :: forall (m :: Type -> Type). (Alternative m, MonadCache m, MonadDiagrams m, MonadGraphviz m, MonadThrow m, OutputCapable m) => FilePath -> ReachInstance Place Transition -> [Transition] -> Rated m
- reachSyntax :: forall (m :: Type -> Type) s. OutputCapable m => ReachInstance s Transition -> [Transition] -> LangM m
- reachInitial :: ReachInstance s Transition -> TransitionsList
- defaultReachConfig :: ReachConfig
- defaultReachInstance :: ReachInstance Place Transition
- bimapReachInstance :: (Ord a, Ord b) => (s -> a) -> (t -> b) -> ReachInstance s t -> ReachInstance a b
- bimapNetGoal :: (Ord a, Ord b) => (s -> a) -> (t -> b) -> NetGoal s t -> NetGoal a b
- toShowReachInstance :: ReachInstance Place Transition -> ReachInstance ShowPlace ShowTransition
- toShowNetGoal :: NetGoal Place Transition -> NetGoal ShowPlace ShowTransition
- assertReachPoints :: forall (m :: Type -> Type) i a b. OutputCapable m => Maybe String -> (i -> a -> Bool) -> (i -> Int) -> i -> [b] -> Either Int a -> Rated m
- isNoLonger :: forall (m :: Type -> Type) a. OutputCapable m => Maybe Int -> [a] -> LangM m
- rejectSpaceballsPattern :: forall t (m :: Type -> Type). (Enum t, Eq t, OutputCapable m, Show t) => Maybe Int -> [t] -> LangM m
- reportReachFor :: forall (m :: Type -> Type). OutputCapable m => Bool -> FilePath -> Maybe Int -> Maybe Int -> Int -> Bool -> Maybe (Either FilePath String) -> LangM m
- transitionsValid :: forall (m :: Type -> Type) s. OutputCapable m => Net s Transition -> [Transition] -> LangM m
- levelsWithAlternatives :: Ord s => Net s t -> [[(State s, [[t]])]]
- provideSolutionsFeedback :: Int -> Either (NonEmpty [Transition]) (NonEmpty [Transition]) -> Maybe String
- validateDrawabilityAndSolutionFiltering :: forall t (m :: Type -> Type) p. (Enum t, MonadCatch m, MonadDiagrams m, MonadGraphviz m, Ord p, Ord t, Show p, Show t) => Net p t -> [GraphvizCommand] -> [[t]] -> FilterConfig -> Int -> Int -> MaybeT (RandT StdGen m) (GraphvizCommand, Either (NonEmpty [t]) (NonEmpty [t]))
Types
data ReachInstance s t Source #
Constructors
| ReachInstance | |
Fields
| |
Instances
Instances
| (Ord s, Ord t, Reader s, Reader t) => Reader (NetGoal s t) Source # | |||||
Defined in Modelling.PetriNet.Reach.Reach Methods atomic_reader :: Parser (NetGoal s t) atomic_readerPrec :: Int -> Parser (NetGoal s t) reader :: Parser (NetGoal s t) readerPrec :: Int -> Parser (NetGoal s t) readerList :: Parser [NetGoal s t] | |||||
| (ToDoc s, ToDoc t) => ToDoc (NetGoal s t) Source # | |||||
| (Data s, Data t, Ord s, Ord t) => Data (NetGoal s t) Source # | |||||
Defined in Modelling.PetriNet.Reach.Reach Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NetGoal s t -> c (NetGoal s t) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NetGoal s t) # toConstr :: NetGoal s t -> Constr # dataTypeOf :: NetGoal s t -> DataType # dataCast1 :: Typeable t0 => (forall d. Data d => c (t0 d)) -> Maybe (c (NetGoal s t)) # dataCast2 :: Typeable t0 => (forall d e. (Data d, Data e) => c (t0 d e)) -> Maybe (c (NetGoal s t)) # gmapT :: (forall b. Data b => b -> b) -> NetGoal s t -> NetGoal s t # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NetGoal s t -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NetGoal s t -> r # gmapQ :: (forall d. Data d => d -> u) -> NetGoal s t -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NetGoal s t -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NetGoal s t -> m (NetGoal s t) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NetGoal s t -> m (NetGoal s t) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NetGoal s t -> m (NetGoal s t) # | |||||
| Generic (NetGoal s t) Source # | |||||
Defined in Modelling.PetriNet.Reach.Reach Associated Types
| |||||
| (Read s, Read t, Ord s, Ord t) => Read (NetGoal s t) Source # | |||||
| (Show s, Show t) => Show (NetGoal s t) Source # | |||||
| type Rep (NetGoal s t) Source # | |||||
Defined in Modelling.PetriNet.Reach.Reach type Rep (NetGoal s t) = D1 ('MetaData "NetGoal" "Modelling.PetriNet.Reach.Reach" "modelling-tasks-0.0.0.1-2KiclaEArwR4yz1IHg8eKf" 'False) (C1 ('MetaCons "NetGoal" 'PrefixI 'True) (S1 ('MetaSel ('Just "drawUsing") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GraphvizCommand) :*: (S1 ('MetaSel ('Just "petriNet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Net s t)) :*: S1 ('MetaSel ('Just "goal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (State s))))) | |||||
data ReachConfig Source #
Constructors
| ReachConfig | |
Fields | |
Instances
| Generic ReachConfig Source # | |||||
Defined in Modelling.PetriNet.Reach.Reach Associated Types
| |||||
| Read ReachConfig Source # | |||||
Defined in Modelling.PetriNet.Reach.Reach Methods readsPrec :: Int -> ReadS ReachConfig # readList :: ReadS [ReachConfig] # readPrec :: ReadPrec ReachConfig # readListPrec :: ReadPrec [ReachConfig] # | |||||
| Show ReachConfig Source # | |||||
Defined in Modelling.PetriNet.Reach.Reach Methods showsPrec :: Int -> ReachConfig -> ShowS # show :: ReachConfig -> String # showList :: [ReachConfig] -> ShowS # | |||||
| type Rep ReachConfig Source # | |||||
Defined in Modelling.PetriNet.Reach.Reach type Rep ReachConfig = D1 ('MetaData "ReachConfig" "Modelling.PetriNet.Reach.Reach" "modelling-tasks-0.0.0.1-2KiclaEArwR4yz1IHg8eKf" 'False) (C1 ('MetaCons "ReachConfig" 'PrefixI 'True) (((S1 ('MetaSel ('Just "netGoalConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NetGoalConfig) :*: S1 ('MetaSel ('Just "maxPrintedSolutions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "rejectLongerThan") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "showLengthHint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) :*: ((S1 ('MetaSel ('Just "showMinLengthHint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "showTargetNet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "showPlaceNamesInNet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "filterConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilterConfig))))) | |||||
data NetGoalConfig Source #
Constructors
| NetGoalConfig | |
Fields
| |
Instances
| Generic NetGoalConfig Source # | |||||
Defined in Modelling.PetriNet.Reach.Reach Associated Types
| |||||
| Read NetGoalConfig Source # | |||||
Defined in Modelling.PetriNet.Reach.Reach Methods readsPrec :: Int -> ReadS NetGoalConfig # readList :: ReadS [NetGoalConfig] # | |||||
| Show NetGoalConfig Source # | |||||
Defined in Modelling.PetriNet.Reach.Reach Methods showsPrec :: Int -> NetGoalConfig -> ShowS # show :: NetGoalConfig -> String # showList :: [NetGoalConfig] -> ShowS # | |||||
| type Rep NetGoalConfig Source # | |||||
Defined in Modelling.PetriNet.Reach.Reach type Rep NetGoalConfig = D1 ('MetaData "NetGoalConfig" "Modelling.PetriNet.Reach.Reach" "modelling-tasks-0.0.0.1-2KiclaEArwR4yz1IHg8eKf" 'False) (C1 ('MetaCons "NetGoalConfig" 'PrefixI 'True) (((S1 ('MetaSel ('Just "numPlaces") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "numTransitions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "capacity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Capacity Place)) :*: S1 ('MetaSel ('Just "graphLayouts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [GraphvizCommand]))) :*: ((S1 ('MetaSel ('Just "maxTransitionLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "minTransitionLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "maxPlacesChanged") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: (S1 ('MetaSel ('Just "transitionBehaviorConstraints") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TransitionBehaviorConstraints) :*: S1 ('MetaSel ('Just "arrowDensityConstraints") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ArrowDensityConstraints)))))) | |||||
Generation
generateReach :: (MonadCatch m, MonadDiagrams m, MonadGraphviz m) => ReachConfig -> Int -> m (ReachInstance Place Transition) Source #
Task creation
reachTask :: forall (m :: Type -> Type) s t. (MonadCache m, MonadDiagrams m, MonadGraphviz m, MonadThrow m, Ord s, Ord t, OutputCapable m, Show s, Show t) => Bool -> FilePath -> ReachInstance s t -> LangM m Source #
verifyReach :: forall a t (m :: Type -> Type). (Ord a, Ord t, OutputCapable m, Show a, Show t) => ReachInstance a t -> LangM m Source #
Evaluation
reachEvaluation :: forall (m :: Type -> Type). (Alternative m, MonadCache m, MonadDiagrams m, MonadGraphviz m, MonadThrow m, OutputCapable m) => FilePath -> ReachInstance Place Transition -> [Transition] -> Rated m Source #
reachSyntax :: forall (m :: Type -> Type) s. OutputCapable m => ReachInstance s Transition -> [Transition] -> LangM m Source #
Configuration
Utilities
bimapReachInstance :: (Ord a, Ord b) => (s -> a) -> (t -> b) -> ReachInstance s t -> ReachInstance a b Source #
toShowReachInstance :: ReachInstance Place Transition -> ReachInstance ShowPlace ShowTransition Source #
assertReachPoints :: forall (m :: Type -> Type) i a b. OutputCapable m => Maybe String -> (i -> a -> Bool) -> (i -> Int) -> i -> [b] -> Either Int a -> Rated m Source #
rejectSpaceballsPattern :: forall t (m :: Type -> Type). (Enum t, Eq t, OutputCapable m, Show t) => Maybe Int -> [t] -> LangM m Source #
reportReachFor :: forall (m :: Type -> Type). OutputCapable m => Bool -> FilePath -> Maybe Int -> Maybe Int -> Int -> Bool -> Maybe (Either FilePath String) -> LangM m Source #
transitionsValid :: forall (m :: Type -> Type) s. OutputCapable m => Net s Transition -> [Transition] -> LangM m Source #
levelsWithAlternatives :: Ord s => Net s t -> [[(State s, [[t]])]] Source #
Find all shortest paths to all reachable markings segmented by the length of paths starting with 0.
Each returned trace for a state is in reversed order.
provideSolutionsFeedback :: Int -> Either (NonEmpty [Transition]) (NonEmpty [Transition]) -> Maybe String Source #
validateDrawabilityAndSolutionFiltering Source #
Arguments
| :: forall t (m :: Type -> Type) p. (Enum t, MonadCatch m, MonadDiagrams m, MonadGraphviz m, Ord p, Ord t, Show p, Show t) | |
| => Net p t | Petri net to validate for drawability and from which the solutions were derived. |
| -> [GraphvizCommand] | List of Graphviz commands (drawing backends) to try for rendering the net. A random order is used. |
| -> [[t]] | All shortest solutions found, represented as sequences of transitions. |
| -> FilterConfig | Configuration describing how to filter or discard solutions before output. |
| -> Int | Total number of transitions in the Petri net, used in filtering decisions. |
| -> Int | Maximum number of solutions meant to be displayed to students. |
| -> MaybeT (RandT StdGen m) (GraphvizCommand, Either (NonEmpty [t]) (NonEmpty [t])) |
Validate drawability and solution filter criteria, then prepare solutions for output