Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Program.h
Go to the documentation of this file.
1#pragma once
2
3#include <boost/optional.hpp>
4#include <map>
5#include <memory>
6#include <set>
7#include <vector>
8
22
23namespace storm {
24namespace jani {
25class Model;
26class Property;
27} // namespace jani
28
29namespace prism {
31 public:
35 enum class ModelType { UNDEFINED, DTMC, CTMC, MDP, CTMDP, MA, POMDP, PTA, SMG };
36
37 enum class ValidityCheckLevel : unsigned { VALIDINPUT = 0, READYFORPROCESSING = 1 };
38
61 Program(std::shared_ptr<storm::expressions::ExpressionManager> manager, ModelType modelType, std::vector<Constant> const& constants,
62 std::vector<BooleanVariable> const& globalBooleanVariables, std::vector<IntegerVariable> const& globalIntegerVariables,
63 std::vector<Formula> const& formulas, std::vector<Player> const& players, std::vector<Module> const& modules,
64 std::map<std::string, uint_fast64_t> const& actionToIndexMap, std::vector<RewardModel> const& rewardModels, std::vector<Label> const& labels,
65 std::vector<ObservationLabel> const& observationLabels, boost::optional<InitialConstruct> const& initialConstruct,
66 boost::optional<SystemCompositionConstruct> const& compositionConstruct, bool prismCompatibility, std::string const& filename = "",
67 uint_fast64_t lineNumber = 0, bool finalModel = true);
68
69 // Provide default implementations for constructors and assignments.
70 Program() = default;
71 Program(Program const& other) = default;
72 Program& operator=(Program const& other) = default;
73 Program(Program&& other) = default;
74 Program& operator=(Program&& other) = default;
75
81 ModelType getModelType() const;
82
88 bool isDiscreteTimeModel() const;
89
93 bool isDeterministicModel() const;
94
98 bool isPartiallyObservable() const;
99
103 bool hasUnboundedVariables() const;
104
110 bool hasUndefinedConstants() const;
111
120
126 std::vector<std::reference_wrapper<Constant const>> getUndefinedConstants() const;
127
133 std::string getUndefinedConstantsAsString() const;
134
141 bool hasConstant(std::string const& constantName) const;
142
149 Constant const& getConstant(std::string const& constantName) const;
150
156 std::map<storm::expressions::Variable, storm::expressions::Expression> getConstantsSubstitution() const;
157
163 std::map<storm::expressions::Variable, storm::expressions::Expression> getFormulasSubstitution() const;
164
170 std::map<storm::expressions::Variable, storm::expressions::Expression> getConstantsFormulasSubstitution(bool getConstantsSubstitution = true,
171 bool getFormulasSubstitution = true) const;
172
176 std::map<storm::expressions::Variable, storm::expressions::Expression> getSubstitutionForRenamedModule(
177 Module const& renamedModule, std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const;
178
183 std::map<std::string, std::string> getFinalRenamingOfModule(Module const& renamedModule) const;
184
190 std::vector<Constant> const& getConstants() const;
191
197 std::size_t getNumberOfConstants() const;
198
203 std::vector<Constant> usedConstants() const;
204
208 size_t getNumberOfCommands() const;
209
216 bool globalBooleanVariableExists(std::string const& variableName) const;
217
224 bool globalIntegerVariableExists(std::string const& variableName) const;
225
231 std::vector<BooleanVariable> const& getGlobalBooleanVariables() const;
232
239 BooleanVariable const& getGlobalBooleanVariable(std::string const& variableName) const;
240
246 std::vector<IntegerVariable> const& getGlobalIntegerVariables() const;
247
254 IntegerVariable const& getGlobalIntegerVariable(std::string const& variableName) const;
255
262 std::set<storm::expressions::Variable> getAllExpressionVariables(bool includeConstants = true) const;
263
269 std::vector<storm::expressions::Expression> getAllRangeExpressions() const;
270
276 std::size_t getNumberOfGlobalBooleanVariables() const;
277
283 std::size_t getNumberOfGlobalIntegerVariables() const;
284
290 std::vector<Formula> const& getFormulas() const;
291
295 bool hasFormula(std::string const& formulaName) const;
296
300 Formula const& getFormula(std::string const& formulaName) const;
301
307 std::size_t getNumberOfFormulas() const;
308
314 std::size_t getNumberOfModules() const;
315
322 Module const& getModule(uint_fast64_t index) const;
323
329 bool hasModule(std::string const& moduleName) const;
330
337 Module const& getModule(std::string const& moduleName) const;
338
344 std::vector<Module> const& getModules() const;
345
351 std::vector<Player> const& getPlayers() const;
352
358 std::size_t getNumberOfPlayers() const;
359
365 storm::storage::PlayerIndex const& getIndexOfPlayer(std::string const& playerName) const;
366
370 std::map<std::string, storm::storage::PlayerIndex> const& getPlayerNameToIndexMapping() const;
371
376 std::vector<storm::storage::PlayerIndex> buildModuleIndexToPlayerIndexMap() const;
377
382 std::map<uint_fast64_t, storm::storage::PlayerIndex> buildActionIndexToPlayerIndexMap() const;
383
389 std::map<std::string, uint_fast64_t> const& getActionNameToIndexMapping() const;
390
396
400 bool hasInitialConstruct() const;
401
408
412 bool hasIntervalUpdates() const;
413
420 bool specifiesSystemComposition() const;
421
428
434 boost::optional<SystemCompositionConstruct> getOptionalSystemCompositionConstruct() const;
435
441 std::shared_ptr<Composition> getDefaultSystemComposition() const;
442
448 std::set<std::string> const& getActions() const;
449
455 std::set<uint_fast64_t> const& getSynchronizingActionIndices() const;
456
463 std::string const& getActionName(uint_fast64_t actionIndex) const;
464
471 uint_fast64_t getActionIndex(std::string const& actionName) const;
472
478 bool hasAction(std::string const& actionName) const;
479
485 bool hasAction(uint_fast64_t const& actionIndex) const;
486
494 std::set<uint_fast64_t> const& getModuleIndicesByAction(std::string const& action) const;
495
503 std::set<uint_fast64_t> const& getModuleIndicesByActionIndex(uint_fast64_t actionIndex) const;
504
511 uint_fast64_t getModuleIndexByVariable(std::string const& variableName) const;
512
524 std::pair<uint_fast64_t, uint_fast64_t> getModuleCommandIndexByGlobalCommandIndex(uint_fast64_t globalCommandIndex) const;
525
526 /*
527 * Get total number of unlabeled commands
528 */
529 uint64_t getNumberOfUnlabeledCommands() const;
530
536 bool hasRewardModel() const;
537
544 bool hasRewardModel(std::string const& name) const;
545
551 std::vector<RewardModel> const& getRewardModels() const;
552
558 std::size_t getNumberOfRewardModels() const;
559
566 RewardModel const& getRewardModel(std::string const& rewardModelName) const;
567
574 RewardModel const& getRewardModel(uint_fast64_t index) const;
575
582 bool hasLabel(std::string const& labelName) const;
583
589 std::vector<Label> const& getLabels() const;
590
597 std::vector<storm::expressions::Expression> getAllGuards(bool negated = false) const;
598
604 storm::expressions::Expression const& getLabelExpression(std::string const& label) const;
605
611 std::map<std::string, storm::expressions::Expression> getLabelToExpressionMapping() const;
612
618 std::size_t getNumberOfLabels() const;
619
626 void addLabel(std::string const& name, storm::expressions::Expression const& statePredicateExpression);
627
633 void removeLabel(std::string const& name);
634
641 void filterLabels(std::set<std::string> const& labelSet);
642
643 void removeRewardModels();
644
650 std::vector<ObservationLabel> const& getObservationLabels() const;
651
657 std::size_t getNumberOfObservationLabels() const;
658
665
674 Program defineUndefinedConstants(std::map<storm::expressions::Variable, storm::expressions::Expression> const& constantDefinitions) const;
675
683
691
696
704
712 Program preprocess(std::map<storm::expressions::Variable, storm::expressions::Expression> const& constantDefinitions) const;
713
721 Program preprocess(std::string const& constantDefinitionString = "") const;
722
729
739 bool observable = true) const;
740
746
752
759 Program flattenModules(std::shared_ptr<storm::utility::solver::SmtSolverFactory> const& smtSolverFactory =
760 std::shared_ptr<storm::utility::solver::SmtSolverFactory>(new storm::utility::solver::SmtSolverFactory())) const;
761
769 Program labelUnlabelledCommands(std::map<uint64_t, std::string> const& nameSuggestions = {}) const;
770
771 friend std::ostream& operator<<(std::ostream& stream, Program const& program);
772
779
780 std::unordered_map<uint_fast64_t, std::string> buildCommandIndexToActionNameMap() const;
781
782 std::unordered_map<uint_fast64_t, uint_fast64_t> buildCommandIndexToActionIndex() const;
783
784 std::unordered_map<uint_fast64_t, std::string> buildActionIndexToActionNameMap() const;
785
789 storm::jani::Model toJani(bool allVariablesGlobal = true, std::string suffix = "") const;
790
796 std::pair<storm::jani::Model, std::vector<storm::jani::Property>> toJani(std::vector<storm::jani::Property> const& properties,
797 bool allVariablesGlobal = true, std::string suffix = "") const;
798
804
805 private:
811 InitialConstruct const& getInitialConstruct() const;
812
818 boost::optional<InitialConstruct> const& getOptionalInitialConstruct() const;
819
830 Command synchronizeCommands(uint_fast64_t newCommandIndex, uint_fast64_t actionIndex, uint_fast64_t firstUpdateIndex, std::string const& actionName,
831 std::vector<std::reference_wrapper<Command const>> const& commands) const;
832
836 void createMissingInitialValues();
837
838 // The manager responsible for the variables/expressions of the program.
839 std::shared_ptr<storm::expressions::ExpressionManager> manager;
840
841 // Creates the internal mappings.
842 void createMappings();
843
844 uint64_t getHighestCommandIndex() const;
845
846 // The type of the model.
847 ModelType modelType;
848
849 // The constants of the program.
850 std::vector<Constant> constants;
851
852 // A mapping from constant names to their corresponding indices.
853 std::map<std::string, uint_fast64_t> constantToIndexMap;
854
855 // The global boolean variables.
856 std::vector<BooleanVariable> globalBooleanVariables;
857
858 // A mapping from global boolean variable names to their corresponding indices.
859 std::map<std::string, uint_fast64_t> globalBooleanVariableToIndexMap;
860
861 // The global integer variables.
862 std::vector<IntegerVariable> globalIntegerVariables;
863
864 // A mapping from global integer variable names to their corresponding indices.
865 std::map<std::string, uint_fast64_t> globalIntegerVariableToIndexMap;
866
867 // The formulas defined in the program.
868 std::vector<Formula> formulas;
869
870 // A mapping of formula names to their corresponding indices.
871 std::map<std::string, uint_fast64_t> formulaToIndexMap;
872
873 // The players associated with the program.
874 std::vector<Player> players;
875
876 // A mapping of player names to their indices.
877 std::map<std::string, storm::storage::PlayerIndex> playerToIndexMap;
878
879 // The modules associated with the program.
880 std::vector<Module> modules;
881
882 // A mapping of module names to their indices.
883 std::map<std::string, uint_fast64_t> moduleToIndexMap;
884
885 // The reward models associated with the program.
886 std::vector<RewardModel> rewardModels;
887
888 // A mapping of reward models to their indices.
889 std::map<std::string, uint_fast64_t> rewardModelToIndexMap;
890
891 // The initial construct of the program.
892 boost::optional<InitialConstruct> initialConstruct;
893
894 // If set, this specifies the way the modules are composed to obtain the full system.
895 boost::optional<SystemCompositionConstruct> systemCompositionConstruct;
896
897 // The labels that are defined for this model.
898 std::vector<Label> labels;
899
900 // A mapping from labels to their indices.
901 std::map<std::string, uint_fast64_t> labelToIndexMap;
902
903 // Observation labels
904 std::vector<ObservationLabel> observationLabels;
905
906 // A mapping from action names to their indices.
907 std::map<std::string, uint_fast64_t> actionToIndexMap;
908
909 // A mapping from action indices to their names.
910 std::map<uint_fast64_t, std::string> indexToActionMap;
911
912 // The set of actions present in this program.
913 std::set<std::string> actions;
914
915 // The set of synchronizing actions present in this program.
916 std::set<uint_fast64_t> synchronizingActionIndices;
917
918 // A map of actions to the set of modules containing commands labelled with this action.
919 std::map<uint_fast64_t, std::set<uint_fast64_t>> actionIndicesToModuleIndexMap;
920
921 // A mapping from variable names to the modules in which they were declared.
922 std::map<std::string, uint_fast64_t> variableToModuleIndexMap;
923
924 storage::BitVector possiblySynchronizingCommands;
925
926 bool prismCompatibility;
927};
928
929std::ostream& operator<<(std::ostream& out, Program::ModelType const& type);
930
931} // namespace prism
932} // namespace storm
This class is responsible for managing a set of typed variables and all expressions using these varia...
LocatedInformation(std::string const &filename, uint_fast64_t lineNumber)
Constructs a located information with the given filename and line number.
Program replaceConstantByVariable(Constant const &c, expressions::Expression const &lowerBound, expressions::Expression const &upperBound, bool observable=true) const
Substitutes the given constant by a fresh global variable that is bound between lowerBound and upperB...
Definition Program.cpp:1231
std::set< uint_fast64_t > const & getSynchronizingActionIndices() const
Retrieves the set of synchronizing action indices present in the program.
Definition Program.cpp:747
Formula const & getFormula(std::string const &formulaName) const
Definition Program.cpp:850
Program & operator=(Program &&other)=default
void checkValidity(Program::ValidityCheckLevel lvl=Program::ValidityCheckLevel::READYFORPROCESSING) const
Checks the validity of the program.
Definition Program.cpp:1252
std::map< std::string, std::string > getFinalRenamingOfModule(Module const &renamedModule) const
Gets the renaming of a module after flattening all renamings.
Definition Program.cpp:446
bool hasIntervalUpdates() const
Retrieves whether the program considers at least one update with an interval probability/rate.
Definition Program.cpp:706
ModelType getModelType() const
Retrieves the model type of the model.
Definition Program.cpp:243
Program defineUndefinedConstants(std::map< storm::expressions::Variable, storm::expressions::Expression > const &constantDefinitions) const
Defines the undefined constants according to the given map and returns the resulting program.
Definition Program.cpp:1002
std::vector< storm::expressions::Expression > getAllRangeExpressions() const
Retrieves a list of expressions that characterize the legal ranges of all variables.
Definition Program.cpp:508
std::vector< RewardModel > const & getRewardModels() const
Retrieves the reward models of the program.
Definition Program.cpp:817
std::vector< Player > const & getPlayers() const
Retrieves the players of the program.
Definition Program.cpp:558
RewardModel const & getRewardModel(std::string const &rewardModelName) const
Retrieves the reward model with the given name.
Definition Program.cpp:825
std::vector< BooleanVariable > const & getGlobalBooleanVariables() const
Retrieves the global boolean variables of the program.
Definition Program.cpp:478
ModelType
An enum for the different model types.
Definition Program.h:35
std::set< std::string > const & getActions() const
Retrieves the set of actions present in the program.
Definition Program.cpp:743
std::set< uint_fast64_t > const & getModuleIndicesByAction(std::string const &action) const
Retrieves the indices of all modules within this program that contain commands that are labelled with...
Definition Program.cpp:771
std::vector< std::reference_wrapper< Constant const > > getUndefinedConstants() const
Retrieves the undefined constants in the program.
Definition Program.cpp:364
storm::storage::PlayerIndex const & getIndexOfPlayer(std::string const &playerName) const
Retrieves the index of the player in the program.
Definition Program.cpp:566
bool isPartiallyObservable() const
Retrieves whether the model has restricted observability.
Definition Program.cpp:255
std::pair< uint_fast64_t, uint_fast64_t > getModuleCommandIndexByGlobalCommandIndex(uint_fast64_t globalCommandIndex) const
Retrieves the index of the module and the (local) index of the command with the given global command ...
Definition Program.cpp:791
bool hasAction(std::string const &actionName) const
Retrieves whether the program has an action with the given name.
Definition Program.cpp:763
std::size_t getNumberOfLabels() const
Retrieves the number of labels in the program.
Definition Program.cpp:880
boost::optional< SystemCompositionConstruct > getOptionalSystemCompositionConstruct() const
Retrieves the system composition construct (if any) and none otherwise.
Definition Program.cpp:727
std::map< storm::expressions::Variable, storm::expressions::Expression > getConstantsSubstitution() const
Retrieves a mapping of all defined constants to their defining expressions.
Definition Program.cpp:402
std::string const & getActionName(uint_fast64_t actionIndex) const
Retrieves the action name of the given action index.
Definition Program.cpp:751
std::vector< Module > const & getModules() const
Retrieves all modules of the program.
Definition Program.cpp:625
bool isDiscreteTimeModel() const
Retrieves whether the model is a discrete-time model, i.e.
Definition Program.cpp:247
storm::expressions::Expression const & getLabelExpression(std::string const &label) const
Retrieves the expression associated with the given label, if it exists.
Definition Program.cpp:865
std::unordered_map< uint_fast64_t, std::string > buildCommandIndexToActionNameMap() const
Definition Program.cpp:2264
Program substituteNonStandardPredicates() const
Substitutes all nonstandard predicates in expressions of the program by their defining expressions.
Definition Program.cpp:1052
Program & operator=(Program const &other)=default
std::vector< ObservationLabel > const & getObservationLabels() const
Retrieves all observation labels that are defined by this program.
Definition Program.cpp:918
Module const & getModule(uint_fast64_t index) const
Retrieves the module with the given index.
Definition Program.cpp:611
uint_fast64_t getActionIndex(std::string const &actionName) const
Retrieves the index of the action with the given name.
Definition Program.cpp:757
IntegerVariable const & getGlobalIntegerVariable(std::string const &variableName) const
Retrieves a the global integer variable with the given name.
Definition Program.cpp:539
std::set< uint_fast64_t > const & getModuleIndicesByActionIndex(uint_fast64_t actionIndex) const
Retrieves the indices of all modules within this program that contain commands that are labelled with...
Definition Program.cpp:777
std::map< uint_fast64_t, storm::storage::PlayerIndex > buildActionIndexToPlayerIndexMap() const
Retrieves a vector whose i'th entry corresponds to the player controlling action with index i.
Definition Program.cpp:586
bool isDeterministicModel() const
Retrieves whether the model is one without nondeterministic choices, i.e.
Definition Program.cpp:251
std::map< storm::expressions::Variable, storm::expressions::Expression > getConstantsFormulasSubstitution(bool getConstantsSubstitution=true, bool getFormulasSubstitution=true) const
Retrieves a mapping of all defined constants and formula variables to their defining expressions.
Definition Program.cpp:410
std::vector< storm::expressions::Expression > getAllGuards(bool negated=false) const
Retrieves all guards appearing in the program.
Definition Program.cpp:855
void removeLabel(std::string const &name)
Removes the label with the given name from the program.
Definition Program.cpp:891
bool undefinedConstantsAreGraphPreserving() const
Checks that undefined constants (parameters) of the model preserve the graph of the underlying model.
Definition Program.cpp:290
std::size_t getNumberOfRewardModels() const
Retrieves the number of reward models in the program.
Definition Program.cpp:821
std::size_t getNumberOfPlayers() const
Retrieves the number of players in the program.
Definition Program.cpp:562
void updateInitialStatesExpression(expressions::Expression const &newExpression)
Sets a new initial states expression.
Definition Program.cpp:653
Constant const & getConstant(std::string const &constantName) const
Retrieves the constant with the given name if it exists.
Definition Program.cpp:393
std::map< std::string, uint_fast64_t > const & getActionNameToIndexMapping() const
Retrieves the mapping of action names to their indices.
Definition Program.cpp:629
size_t getNumberOfCommands() const
The total number of commands in the prism file.
Definition Program.cpp:259
Program labelUnlabelledCommands(std::map< uint64_t, std::string > const &nameSuggestions={}) const
Give commands that do not have an action name an action, which can be helpful for debugging and under...
Definition Program.cpp:1178
Program(Program const &other)=default
SystemCompositionConstruct const & getSystemCompositionConstruct() const
If the program specifies a system composition construct, this method retrieves it.
Definition Program.cpp:723
Program substituteConstants() const
Substitutes all constants appearing in the expressions of the program by their defining expressions.
Definition Program.cpp:1044
Program substituteFormulas() const
Substitutes all formulas appearing in the expressions of the program by their defining expressions.
Definition Program.cpp:1048
std::size_t getNumberOfObservationLabels() const
Retrieves the number of observation labels in the program.
Definition Program.cpp:922
std::map< std::string, storm::storage::PlayerIndex > const & getPlayerNameToIndexMapping() const
Definition Program.cpp:570
std::size_t getNumberOfConstants() const
Retrieves the number of all constants defined in the program.
Definition Program.cpp:474
Program(std::shared_ptr< storm::expressions::ExpressionManager > manager, ModelType modelType, std::vector< Constant > const &constants, std::vector< BooleanVariable > const &globalBooleanVariables, std::vector< IntegerVariable > const &globalIntegerVariables, std::vector< Formula > const &formulas, std::vector< Player > const &players, std::vector< Module > const &modules, std::map< std::string, uint_fast64_t > const &actionToIndexMap, std::vector< RewardModel > const &rewardModels, std::vector< Label > const &labels, std::vector< ObservationLabel > const &observationLabels, boost::optional< InitialConstruct > const &initialConstruct, boost::optional< SystemCompositionConstruct > const &compositionConstruct, bool prismCompatibility, std::string const &filename="", uint_fast64_t lineNumber=0, bool finalModel=true)
Creates a program with the given model type, undefined constants, global variables,...
Definition Program.cpp:154
std::set< storm::expressions::Variable > getAllExpressionVariables(bool includeConstants=true) const
Retrieves all expression variables used by this program.
Definition Program.cpp:486
Program(Program &&other)=default
bool globalIntegerVariableExists(std::string const &variableName) const
Retrieves whether a global Integer variable with the given name exists.
Definition Program.cpp:528
std::unordered_map< uint_fast64_t, std::string > buildActionIndexToActionNameMap() const
Definition Program.cpp:2274
bool hasFormula(std::string const &formulaName) const
Definition Program.cpp:846
BooleanVariable const & getGlobalBooleanVariable(std::string const &variableName) const
Retrieves a the global boolean variable with the given name.
Definition Program.cpp:532
void filterLabels(std::set< std::string > const &labelSet)
Removes all labels that are not contained in the given set from the program.
Definition Program.cpp:902
bool hasModule(std::string const &moduleName) const
Retrieves whether the program has a module with the given name.
Definition Program.cpp:615
Program substituteConstantsFormulas(bool substituteConstants=true, bool substituteFormulas=true) const
Substitutes all constants and/or formulas appearing in the expressions of the program by their defini...
Definition Program.cpp:1096
bool globalBooleanVariableExists(std::string const &variableName) const
Retrieves whether a global Boolean variable with the given name exists.
Definition Program.cpp:524
std::unordered_map< uint_fast64_t, uint_fast64_t > buildCommandIndexToActionIndex() const
Definition Program.cpp:2282
std::vector< Constant > const & getConstants() const
Retrieves all constants defined in the program.
Definition Program.cpp:398
std::map< storm::expressions::Variable, storm::expressions::Expression > getFormulasSubstitution() const
Retrieves a mapping of all formula variables to their defining expressions.
Definition Program.cpp:406
friend std::ostream & operator<<(std::ostream &stream, Program const &program)
Definition Program.cpp:2434
bool hasUnboundedVariables() const
Definition Program.cpp:267
storm::expressions::ExpressionManager & getManager() const
Retrieves the manager responsible for the expressions of this program.
Definition Program.cpp:2388
Program replaceVariableInitializationByInitExpression() const
Replace the initialization in variables by an init-expression.
Definition Program.cpp:1210
std::vector< Constant > usedConstants() const
Retrieves the constants that are actually used in the program.
Definition Program.cpp:2194
bool hasLabel(std::string const &labelName) const
Checks whether the program has a label with the given name.
Definition Program.cpp:837
std::vector< storm::storage::PlayerIndex > buildModuleIndexToPlayerIndexMap() const
Retrieves a vector whose i'th entry corresponds to the player controlling module i.
Definition Program.cpp:574
std::vector< IntegerVariable > const & getGlobalIntegerVariables() const
Retrieves the global integer variables of the program.
Definition Program.cpp:482
std::size_t getNumberOfGlobalIntegerVariables() const
Retrieves the number of global integer variables of the program.
Definition Program.cpp:550
std::string getUndefinedConstantsAsString() const
Retrieves the undefined constants in the program as a comma-separated string.
Definition Program.cpp:374
std::size_t getNumberOfFormulas() const
Retrieves the number of formulas in the program.
Definition Program.cpp:603
bool hasConstant(std::string const &constantName) const
Retrieves whether the given constant exists in the program.
Definition Program.cpp:389
storm::expressions::Expression getInitialStatesExpression() const
Retrieves an expression characterizing the initial states.
Definition Program.cpp:658
void addLabel(std::string const &name, storm::expressions::Expression const &statePredicateExpression)
Adds a label with the given name and defining expression to the program.
Definition Program.cpp:884
std::size_t getNumberOfModules() const
Retrieves the number of modules in the program.
Definition Program.cpp:607
bool hasInitialConstruct() const
Retrieves whether the program specifies an initial construct.
Definition Program.cpp:641
Program restrictCommands(storm::storage::FlatSet< uint_fast64_t > const &indexSet) const
Creates a new program that drops all commands whose indices are not in the given set.
Definition Program.cpp:930
Program flattenModules(std::shared_ptr< storm::utility::solver::SmtSolverFactory > const &smtSolverFactory=std::shared_ptr< storm::utility::solver::SmtSolverFactory >(new storm::utility::solver::SmtSolverFactory())) const
Creates an equivalent program that contains exactly one module.
Definition Program.cpp:1980
bool hasUndefinedConstants() const
Retrieves whether there are undefined constants of any type in the program.
Definition Program.cpp:281
bool specifiesSystemComposition() const
Retrieves whether the program specifies a system composition in terms of process algebra operations o...
Definition Program.cpp:719
std::shared_ptr< Composition > getDefaultSystemComposition() const
Retrieves the default system composition for this program.
Definition Program.cpp:731
std::vector< Label > const & getLabels() const
Retrieves all labels that are defined by the probabilitic program.
Definition Program.cpp:842
uint64_t getNumberOfUnlabeledCommands() const
Definition Program.cpp:633
storm::storage::BitVector const & getPossiblySynchronizingCommands() const
Compute the (labelled) commands in the program that may be synchronizing.
Definition Program.cpp:926
uint_fast64_t getModuleIndexByVariable(std::string const &variableName) const
Retrieves the index of the module in which the given variable name was declared.
Definition Program.cpp:784
bool hasRewardModel() const
Retrieves whether the program has reward models.
Definition Program.cpp:808
std::map< std::string, storm::expressions::Expression > getLabelToExpressionMapping() const
Retrieves a mapping from all labels in the program to their defining expressions.
Definition Program.cpp:872
Program simplify()
Entry point for static analysis for simplify.
Definition Program.cpp:1832
Program preprocess(std::map< storm::expressions::Variable, storm::expressions::Expression > const &constantDefinitions) const
Preprocesses the program by defining the given constant definitions, substituting constants and formu...
Definition Program.cpp:1170
std::map< storm::expressions::Variable, storm::expressions::Expression > getSubstitutionForRenamedModule(Module const &renamedModule, std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution) const
Applies the renaming of a renamed module to the given substitution.
Definition Program.cpp:428
std::size_t getNumberOfGlobalBooleanVariables() const
Retrieves the number of global boolean variables of the program.
Definition Program.cpp:546
storm::jani::Model toJani(bool allVariablesGlobal=true, std::string suffix="") const
Converts the PRISM model into an equivalent JANI model.
Definition Program.cpp:2350
std::vector< Formula > const & getFormulas() const
Retrieves the formulas defined in the program.
Definition Program.cpp:554
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16
std::ostream & operator<<(std::ostream &stream, Assignment const &assignment)
uint64_t PlayerIndex
Definition PlayerIndex.h:7
boost::container::flat_set< Key, std::less< Key >, boost::container::new_allocator< Key > > FlatSet
Redefinition of flat_set was needed, because from Boost 1.70 on the default allocator is set to void.
Definition BoostTypes.h:13