modelling-tasks-0.0.0.1
Safe HaskellNone
LanguageHaskell2010

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

Types

data ReachInstance s t Source #

Constructors

ReachInstance 

Fields

Instances

Instances details
(Ord s, Ord t, Reader s, Reader t) => Reader (ReachInstance s t) Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

(ToDoc s, ToDoc t) => ToDoc (ReachInstance s t) Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

Methods

toDocPrec :: Int -> ReachInstance s t -> Doc

toDocList :: [ReachInstance s t] -> Doc

(Data s, Data t, Ord s, Ord t) => Data (ReachInstance s t) Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ReachInstance s t -> c (ReachInstance s t) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ReachInstance s t) #

toConstr :: ReachInstance s t -> Constr #

dataTypeOf :: ReachInstance s t -> DataType #

dataCast1 :: Typeable t0 => (forall d. Data d => c (t0 d)) -> Maybe (c (ReachInstance s t)) #

dataCast2 :: Typeable t0 => (forall d e. (Data d, Data e) => c (t0 d e)) -> Maybe (c (ReachInstance s t)) #

gmapT :: (forall b. Data b => b -> b) -> ReachInstance s t -> ReachInstance s t #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ReachInstance s t -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ReachInstance s t -> r #

gmapQ :: (forall d. Data d => d -> u) -> ReachInstance s t -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ReachInstance s t -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ReachInstance s t -> m (ReachInstance s t) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ReachInstance s t -> m (ReachInstance s t) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ReachInstance s t -> m (ReachInstance s t) #

Generic (ReachInstance s t) Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

Associated Types

type Rep (ReachInstance s t) 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

type Rep (ReachInstance s t) = D1 ('MetaData "ReachInstance" "Modelling.PetriNet.Reach.Reach" "modelling-tasks-0.0.0.1-2KiclaEArwR4yz1IHg8eKf" 'False) (C1 ('MetaCons "ReachInstance" 'PrefixI 'True) (((S1 ('MetaSel ('Just "netGoal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NetGoal s t)) :*: S1 ('MetaSel ('Just "minLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "noLongerThan") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: (S1 ('MetaSel ('Just "showGoalNet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "showPlaceNames") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) :*: ((S1 ('MetaSel ('Just "maxDisplayedSolutions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "shortestSolutions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either (NonEmpty [t]) (NonEmpty [t])))) :*: (S1 ('MetaSel ('Just "withLengthHint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: (S1 ('MetaSel ('Just "withMinLengthHint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "rejectSpaceballsLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)))))))

Methods

from :: ReachInstance s t -> Rep (ReachInstance s t) x #

to :: Rep (ReachInstance s t) x -> ReachInstance s t #

(Read s, Read t, Ord s, Ord t) => Read (ReachInstance s t) Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

(Show s, Show t) => Show (ReachInstance s t) Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

type Rep (ReachInstance s t) Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

type Rep (ReachInstance s t) = D1 ('MetaData "ReachInstance" "Modelling.PetriNet.Reach.Reach" "modelling-tasks-0.0.0.1-2KiclaEArwR4yz1IHg8eKf" 'False) (C1 ('MetaCons "ReachInstance" 'PrefixI 'True) (((S1 ('MetaSel ('Just "netGoal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NetGoal s t)) :*: S1 ('MetaSel ('Just "minLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "noLongerThan") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: (S1 ('MetaSel ('Just "showGoalNet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "showPlaceNames") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) :*: ((S1 ('MetaSel ('Just "maxDisplayedSolutions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "shortestSolutions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either (NonEmpty [t]) (NonEmpty [t])))) :*: (S1 ('MetaSel ('Just "withLengthHint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: (S1 ('MetaSel ('Just "withMinLengthHint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "rejectSpaceballsLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)))))))

data NetGoal s t Source #

Constructors

NetGoal 

Fields

Instances

Instances details
(Ord s, Ord t, Reader s, Reader t) => Reader (NetGoal s t) Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

(ToDoc s, ToDoc t) => ToDoc (NetGoal s t) Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

Methods

toDocPrec :: Int -> NetGoal s t -> Doc

toDocList :: [NetGoal s t] -> Doc

(Data s, Data t, Ord s, Ord t) => Data (NetGoal s t) Source # 
Instance details

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 # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

Associated Types

type Rep (NetGoal s t) 
Instance details

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)))))

Methods

from :: NetGoal s t -> Rep (NetGoal s t) x #

to :: Rep (NetGoal s t) x -> NetGoal s t #

(Read s, Read t, Ord s, Ord t) => Read (NetGoal s t) Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

(Show s, Show t) => Show (NetGoal s t) Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

Methods

showsPrec :: Int -> NetGoal s t -> ShowS #

show :: NetGoal s t -> String #

showList :: [NetGoal s t] -> ShowS #

type Rep (NetGoal s t) Source # 
Instance details

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 #

Instances

Instances details
Generic ReachConfig Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

Associated Types

type Rep ReachConfig 
Instance details

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)))))
Read ReachConfig Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

Show ReachConfig Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

type Rep ReachConfig Source # 
Instance details

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

Instances details
Generic NetGoalConfig Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

Associated Types

type Rep NetGoalConfig 
Instance details

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))))))
Read NetGoalConfig Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

Show NetGoalConfig Source # 
Instance details

Defined in Modelling.PetriNet.Reach.Reach

type Rep NetGoalConfig Source # 
Instance details

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 #

bimapNetGoal :: (Ord a, Ord b) => (s -> a) -> (t -> b) -> NetGoal s t -> NetGoal a b 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 #

isNoLonger :: forall (m :: Type -> Type) a. OutputCapable m => Maybe Int -> [a] -> LangM 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.

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