Sebastian Junges 7 years ago
parent
commit
04e542059d
  1. 135
      .travis.yml
  2. 5
      README.md
  3. 1
      src/CMakeLists.txt
  4. 40
      src/storm-cli-utilities/CMakeLists.txt
  5. 36
      src/storm-cli-utilities/cli.cpp
  6. 0
      src/storm-cli-utilities/cli.h
  7. 2
      src/storm-dft-cli/CMakeLists.txt
  8. 4
      src/storm-dft-cli/storm-dyftee.cpp
  9. 2
      src/storm-dft/modelchecker/dft/DFTModelChecker.cpp
  10. 2
      src/storm-gspn-cli/CMakeLists.txt
  11. 4
      src/storm-gspn-cli/storm-gspn.cpp
  12. 49
      src/storm-pars-cli/storm-pars.cpp
  13. 13
      src/storm-pars/transformer/SparseParametricModelSimplifier.cpp
  14. 2
      src/storm-pgcl-cli/CMakeLists.txt
  15. 2
      src/storm-pgcl-cli/storm-pgcl.cpp
  16. 2
      src/storm/CMakeLists.txt
  17. 35
      src/storm/api/builder.h
  18. 8
      src/storm/builder/BuilderOptions.cpp
  19. 63
      src/storm/builder/BuilderOptions.h
  20. 2
      src/storm/storm.cpp
  21. 11
      travis/generate_travis.py

135
.travis.yml

@ -6,6 +6,7 @@
branches:
only:
- master
- stable
dist: trusty
language: cpp
@ -21,6 +22,13 @@ services:
- docker
sudo: required
notifications:
email:
on_failure: always
on_success: change
recipients:
secure: "Q9CW/PtyWkZwExDrfFFb9n1STGYsRfI6awv1bZHcGwfrDvhpXoMCuF8CwviIfilm7fFJJEoKizTtdRpY0HrOnY/8KY111xrtcFYosxdndv7xbESodIxQOUoIEFCO0mCNHwWYisoi3dAA7H3Yn661EsxluwHjzX5vY0xSbw0n229hlsFz092HwGLSU33zHl7eXpQk+BOFmBTRGlOq9obtDZ17zbHz1oXFZntHK/JDUIYP0b0uq8NvE2jM6CIVdcuSwmIkOhZJoO2L3Py3rBbPci+L2PSK4Smv2UjCPF8KusnOaFIyDB3LcNM9Jqq5ssJMrK/KaO6BiuYrOZXYWZ7KEg3Y/naC8HjOH1dzty+P7oW46sb9F03pTsufqD4R7wcK+9wROTztO6aJPDG/IPH7EWgrBTxqlOkVRwi2eYuQouZpZUW6EMClKbMHMIxCH2S8aOk/r1w2cNwmPEcunnP0nl413x/ByHr4fTPFykPj8pQxIsllYjpdWBRQfDOauKWGzk6LcrFW0qpWP+/aJ2vYu/IoZQMG5lMHbp6Y1Lg09pYm7Q983v3b7D+JvXhOXMyGq91HyPahA2wwKoG1GA4uoZ2I95/IFYNiKkelDd3WTBoFLNF9YFoEJNdCywm1fO2WY4WkyEFBuQcgDA+YpFMJJMxjTbivYk9jvHk2gji//2w="
#
# Configurations
#
@ -81,33 +89,6 @@ jobs:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=debian-9 COMPILER=gcc-6
install:
- rm -rf build
- travis/install_linux.sh
script:
- travis/build.sh Build1
before_cache:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=debian-9 COMPILER=gcc-6
install:
- rm -rf build
- travis/install_linux.sh
script:
- travis/build.sh Build1
before_cache:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
###
# Stage: Build (2nd run)
@ -159,31 +140,6 @@ jobs:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=debian-9 COMPILER=gcc-6
install:
- travis/install_linux.sh
script:
- travis/build.sh Build2
before_cache:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=debian-9 COMPILER=gcc-6
install:
- travis/install_linux.sh
script:
- travis/build.sh Build2
before_cache:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
###
# Stage: Build (3rd run)
@ -235,31 +191,6 @@ jobs:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=debian-9 COMPILER=gcc-6
install:
- travis/install_linux.sh
script:
- travis/build.sh Build3
before_cache:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=debian-9 COMPILER=gcc-6
install:
- travis/install_linux.sh
script:
- travis/build.sh Build3
before_cache:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
###
# Stage: Build (4th run)
@ -311,31 +242,6 @@ jobs:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9
- stage: Build (4th run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=debian-9 COMPILER=gcc-6
install:
- travis/install_linux.sh
script:
- travis/build.sh Build4
before_cache:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
- stage: Build (4th run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=debian-9 COMPILER=gcc-6
install:
- travis/install_linux.sh
script:
- travis/build.sh Build4
before_cache:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
###
# Stage: Test all
@ -387,29 +293,4 @@ jobs:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9
- stage: Test all
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=debian-9 COMPILER=gcc-6
install:
- travis/install_linux.sh
script:
- travis/build.sh TestAll
before_cache:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
- stage: Test all
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=debian-9 COMPILER=gcc-6
install:
- travis/install_linux.sh
script:
- travis/build.sh TestAll
before_cache:
- docker cp storm:/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;

5
README.md

@ -1,5 +1,6 @@
Storm
==============================
Storm - A Modern Probabilistic Model Checker
============================================
[![Build Status](https://travis-ci.org/moves-rwth/storm.svg?branch=master)](https://travis-ci.org/moves-rwth/storm)
For more instructions, check out the documentation found in [Getting Started](http://www.stormchecker.org/getting-started.html).

1
src/CMakeLists.txt

@ -5,6 +5,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_custom_target(binaries)
add_subdirectory(storm)
add_subdirectory(storm-cli-utilities)
add_subdirectory(storm-pgcl)
add_subdirectory(storm-pgcl-cli)
add_subdirectory(storm-gspn)

40
src/storm-cli-utilities/CMakeLists.txt

@ -0,0 +1,40 @@
file(GLOB_RECURSE ALL_FILES ${PROJECT_SOURCE_DIR}/src/storm-cli-utilities/*.h ${PROJECT_SOURCE_DIR}/src/storm-cli-utilities/*.cpp)
register_source_groups_from_filestructure("${ALL_FILES}" storm-cli-utilities)
file(GLOB_RECURSE STORM_CLI_UTIL_SOURCES ${PROJECT_SOURCE_DIR}/src/storm-cli-utilities/*.cpp)
file(GLOB_RECURSE STORM_CLI_UTIL_HEADERS ${PROJECT_SOURCE_DIR}/src/storm-cli-utilities/*.h)
# Create storm-pars.
add_library(storm-cli-utilities SHARED ${STORM_CLI_UTIL_SOURCES} ${STORM_CLI_UTIL_HEADERS})
# Remove define symbol for shared libstorm.
set_target_properties(storm-cli-utilities PROPERTIES DEFINE_SYMBOL "")
#add_dependencies(storm resources)
list(APPEND STORM_TARGETS storm-cli-utilities)
set(STORM_TARGETS ${STORM_TARGETS} PARENT_SCOPE)
target_link_libraries(storm-cli-utilities PUBLIC storm)
# Install storm headers to include directory.
foreach(HEADER ${STORM_CLI_UTIL_HEADERS})
string(REGEX REPLACE "${PROJECT_SOURCE_DIR}/src/?" "" RELATIVE_HEADER_PATH ${HEADER})
string(REGEX MATCH "(.*)[/\\]" RELATIVE_DIRECTORY ${RELATIVE_HEADER_PATH})
string(REGEX REPLACE "${RELATIVE_DIRECTORY}/?" "" HEADER_FILENAME ${RELATIVE_HEADER_PATH})
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/include/${RELATIVE_DIRECTORY}${HEADER_FILENAME}
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include/${RELATIVE_DIRECTORY}
COMMAND ${CMAKE_COMMAND} -E copy ${HEADER} ${CMAKE_BINARY_DIR}/include/${RELATIVE_DIRECTORY}${HEADER_FILENAME}
DEPENDS ${HEADER}
)
list(APPEND STORM_CLI_UTIL_OUTPUT_HEADERS "${CMAKE_BINARY_DIR}/include/${RELATIVE_DIRECTORY}${HEADER_FILENAME}")
endforeach()
add_custom_target(copy_storm_cli_util_headers DEPENDS ${STORM_CLI_UTIL_OUTPUT_HEADERS} ${STORM_CLI_UTIL_HEADERS})
add_dependencies(storm-cli-utilities copy_storm_pars_headers)
# installation
install(TARGETS storm-cli-utilities RUNTIME DESTINATION bin LIBRARY DESTINATION lib OPTIONAL)

36
src/storm/cli/cli.cpp → src/storm-cli-utilities/cli.cpp

@ -1,37 +1,37 @@
#include "storm/cli/cli.h"
#include "cli.h"
#include "storm/storage/SymbolicModelDescription.h"
#include "storm/models/ModelBase.h"
#include "storm/settings/modules/DebugSettings.h"
#include "storm/settings/modules/IOSettings.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/exceptions/OptionParserException.h"
#include "storm/settings/modules/ResourceSettings.h"
#include "storm/settings/modules/JaniExportSettings.h"
#include "storm/modelchecker/results/SymbolicQualitativeCheckResult.h"
#include "storm/models/sparse/StandardRewardModel.h"
#include "storm/models/symbolic/StandardRewardModel.h"
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/ResourceSettings.h"
#include "storm/settings/modules/JitBuilderSettings.h"
#include "storm/settings/modules/DebugSettings.h"
#include "storm/settings/modules/IOSettings.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/settings/modules/ResourceSettings.h"
#include "storm/settings/modules/JaniExportSettings.h"
#include "storm/utility/resources.h"
#include "storm/utility/file.h"
#include "storm/utility/storm-version.h"
#include "storm/utility/cli.h"
#include "storm/utility/macros.h"
#include "storm/utility/initialize.h"
#include "storm/utility/Stopwatch.h"
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/ResourceSettings.h"
#include <type_traits>
#include "storm/api/storm.h"
#include "storm/utility/macros.h"
// Includes for the linked libraries and versions header.
#ifdef STORM_HAVE_INTELTBB
@ -65,12 +65,12 @@ namespace storm {
storm::utility::setUp();
storm::cli::printHeader("Storm", argc, argv);
storm::settings::initializeAll("Storm", "storm");
storm::utility::Stopwatch totalTimer(true);
if (!storm::cli::parseOptions(argc, argv)) {
return -1;
}
processOptions();
totalTimer.stop();
@ -370,7 +370,15 @@ namespace storm {
template <typename ValueType>
std::shared_ptr<storm::models::ModelBase> buildModelSparse(SymbolicInput const& input, storm::settings::modules::IOSettings const& ioSettings) {
auto counterexampleGeneratorSettings = storm::settings::getModule<storm::settings::modules::CounterexampleGeneratorSettings>();
return storm::api::buildSparseModel<ValueType>(input.model.get(), createFormulasToRespect(input.properties), ioSettings.isBuildChoiceLabelsSet(), counterexampleGeneratorSettings.isMinimalCommandSetGenerationSet());
storm::builder::BuilderOptions options(createFormulasToRespect(input.properties));
options.setBuildChoiceLabels(ioSettings.isBuildChoiceLabelsSet());
options.setBuildChoiceOrigins(counterexampleGeneratorSettings.isMinimalCommandSetGenerationSet());
options.setBuildAllLabels(ioSettings.isBuildFullModelSet());
options.setBuildAllRewardModels(ioSettings.isBuildFullModelSet());
if (ioSettings.isBuildFullModelSet()) {
options.clearTerminalStates();
}
return storm::api::buildSparseModel<ValueType>(input.model.get(), options, ioSettings.isJitSet(), storm::settings::getModule<storm::settings::modules::JitBuilderSettings>().isDoctorSet());
}
template <typename ValueType>

0
src/storm/cli/cli.h → src/storm-cli-utilities/cli.h

2
src/storm-dft-cli/CMakeLists.txt

@ -1,6 +1,6 @@
# Create storm-dft.
add_executable(storm-dft-cli ${PROJECT_SOURCE_DIR}/src/storm-dft-cli/storm-dyftee.cpp)
target_link_libraries(storm-dft-cli storm-dft) # Adding headers for xcode
target_link_libraries(storm-dft-cli storm-dft storm-cli-utilities) # Adding headers for xcode
set_target_properties(storm-dft-cli PROPERTIES OUTPUT_NAME "storm-dft")
add_dependencies(binaries storm-dft-cli)

4
src/storm-dft-cli/storm-dyftee.cpp

@ -1,12 +1,12 @@
#include "storm/logic/Formula.h"
#include "storm/utility/initialize.h"
#include "storm/api/storm.h"
#include "storm/cli/cli.h"
#include "storm-cli-utilities/cli.h"
#include "storm/exceptions/BaseException.h"
#include "storm/logic/Formula.h"
#include "storm/settings/modules/GeneralSettings.h"
#include "storm/settings/modules/IOSettings.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/settings/modules/DebugSettings.h"
#include "storm/settings/modules/GmmxxEquationSolverSettings.h"

2
src/storm-dft/modelchecker/dft/DFTModelChecker.cpp

@ -1,5 +1,6 @@
#include "DFTModelChecker.h"
#include "storm/settings/modules/IOSettings.h"
#include "storm/builder/ParallelCompositionBuilder.h"
#include "storm/utility/bitoperations.h"
#include "storm/utility/DirectEncodingExporter.h"
@ -357,6 +358,7 @@ namespace storm {
explorationTimer.stop();
// Export the model if required
// TODO move this outside of the model checker?
if (storm::settings::getModule<storm::settings::modules::IOSettings>().isExportExplicitSet()) {
std::ofstream stream;
storm::utility::openFile(storm::settings::getModule<storm::settings::modules::IOSettings>().getExportExplicitFilename(), stream);

2
src/storm-gspn-cli/CMakeLists.txt

@ -1,5 +1,5 @@
add_executable(storm-gspn-cli ${PROJECT_SOURCE_DIR}/src/storm-gspn-cli/storm-gspn.cpp)
target_link_libraries(storm-gspn-cli storm-gspn) # Adding headers for xcode
target_link_libraries(storm-gspn-cli storm-gspn storm-cli-utilities) # Adding headers for xcode
set_target_properties(storm-gspn-cli PROPERTIES OUTPUT_NAME "storm-gspn")
add_dependencies(binaries storm-gspn-cli)

4
src/storm-gspn-cli/storm-gspn.cpp

@ -12,7 +12,7 @@
#include "storm/utility/initialize.h"
#include "api/storm.h"
#include "storm/cli/cli.h"
#include "storm-cli-utilities/cli.h"
#include "storm/parser/FormulaParser.h"
@ -27,7 +27,7 @@
#include "storm/exceptions/FileIoException.h"
#include "storm/settings/modules/GeneralSettings.h"
#include "storm/settings/modules/IOSettings.h"
#include "storm/settings/modules/GSPNSettings.h"
#include "storm/settings/modules/GSPNExportSettings.h"
#include "storm/settings/modules/CoreSettings.h"

49
src/storm-pars-cli/storm-pars.cpp

@ -6,7 +6,7 @@
#include "storm/settings/SettingsManager.h"
#include "storm/api/storm.h"
#include "storm/cli/cli.h"
#include "storm-cli-utilities/cli.h"
#include "storm/models/ModelBase.h"
#include "storm/storage/SymbolicModelDescription.h"
#include "storm/utility/file.h"
@ -23,13 +23,13 @@
#include "storm/exceptions/InvalidSettingsException.h"
#include "storm/exceptions/NotSupportedException.h"
#include "storm/cli/cli.cpp"
#include "storm-cli-utilities/cli.cpp"
namespace storm {
namespace pars {
typedef typename storm::cli::SymbolicInput SymbolicInput;
template <typename ValueType>
std::shared_ptr<storm::models::ModelBase> buildModelSparse(SymbolicInput const& input, storm::settings::modules::IOSettings const& ioSettings) {
return storm::api::buildSparseModel<ValueType>(input.model.get(), storm::api::extractFormulasFromProperties(input.properties), ioSettings.isBuildChoiceLabelsSet());
@ -50,7 +50,7 @@ namespace storm {
STORM_LOG_THROW(engine == storm::settings::modules::CoreSettings::Engine::Sparse, storm::exceptions::InvalidSettingsException, "Can only use sparse engine with explicit input.");
result = storm::cli::buildModelExplicit<ValueType>(ioSettings);
}
modelBuildingWatch.stop();
if (result) {
STORM_PRINT_AND_LOG("Time for model construction: " << modelBuildingWatch << "." << std::endl << std::endl);
@ -335,27 +335,7 @@ namespace storm {
processInputWithValueTypeAndDdlib<storm::dd::DdType::Sylvan, storm::RationalFunction>(symbolicInput);
}
int64_t process(const int argc, const char** argv) {
storm::utility::setUp();
storm::cli::printHeader("Storm-pars", argc, argv);
storm::settings::initializeParsSettings("Storm-pars", "storm-pars");
storm::utility::Stopwatch totalTimer(true);
if (!storm::cli::parseOptions(argc, argv)) {
return -1;
}
processOptions();
totalTimer.stop();
if (storm::settings::getModule<storm::settings::modules::ResourceSettings>().isPrintTimeAndMemorySet()) {
storm::cli::printTimeAndMemoryStatistics(totalTimer.getTimeInMilliseconds());
}
storm::utility::cleanUp();
return 0;
}
}
}
@ -366,7 +346,24 @@ namespace storm {
int main(const int argc, const char** argv) {
try {
return storm::pars::process(argc, argv);
storm::utility::setUp();
storm::cli::printHeader("Storm-pars", argc, argv);
storm::settings::initializeParsSettings("Storm-pars", "storm-pars");
storm::utility::Stopwatch totalTimer(true);
if (!storm::cli::parseOptions(argc, argv)) {
return -1;
}
storm::pars::processOptions();
totalTimer.stop();
if (storm::settings::getModule<storm::settings::modules::ResourceSettings>().isPrintTimeAndMemorySet()) {
storm::cli::printTimeAndMemoryStatistics(totalTimer.getTimeInMilliseconds());
}
storm::utility::cleanUp();
return 0;
} catch (storm::exceptions::BaseException const& exception) {
STORM_LOG_ERROR("An exception caused Storm-pars to terminate. The message of the exception is: " << exception.what());
return 1;

13
src/storm-pars/transformer/SparseParametricModelSimplifier.cpp

@ -45,7 +45,7 @@ namespace storm {
}
}
// reaching this point means that the provided formula is not supported. Thus, no simplification is possible.
STORM_LOG_DEBUG("Simplification not possible because the formula is not suppoerted. Formula: " << formula);
STORM_LOG_DEBUG("Simplification not possible because the formula is not supported. Formula: " << formula);
return false;
}
@ -63,8 +63,8 @@ namespace storm {
template<typename SparseModelType>
bool SparseParametricModelSimplifier<SparseModelType>::simplifyForUntilProbabilities(storm::logic::ProbabilityOperatorFormula const& formula) {
// If this method was not overriden by any subclass, simplification is not possible
STORM_LOG_DEBUG("Simplification not possible because the formula is not suppoerted. Formula: " << formula);
// If this method was not overridden by any subclass, simplification is not possible
STORM_LOG_DEBUG("Simplification not possible because the formula is not supported. Formula: " << formula);
return false;
}
@ -77,21 +77,21 @@ namespace storm {
template<typename SparseModelType>
bool SparseParametricModelSimplifier<SparseModelType>::simplifyForBoundedUntilProbabilities(storm::logic::ProbabilityOperatorFormula const& formula) {
// If this method was not overriden by any subclass, simplification is not possible
// If this method was not overridden by any subclass, simplification is not possible
STORM_LOG_DEBUG("Simplification not possible because the formula is not supported. Formula: " << formula);
return false;
}
template<typename SparseModelType>
bool SparseParametricModelSimplifier<SparseModelType>::simplifyForReachabilityRewards(storm::logic::RewardOperatorFormula const& formula) {
// If this method was not overriden by any subclass, simplification is not possible
// If this method was not overridden by any subclass, simplification is not possible
STORM_LOG_DEBUG("Simplification not possible because the formula is not supported. Formula: " << formula);
return false;
}
template<typename SparseModelType>
bool SparseParametricModelSimplifier<SparseModelType>::simplifyForCumulativeRewards(storm::logic::RewardOperatorFormula const& formula) {
// If this method was not overriden by any subclass, simplification is not possible
// If this method was not overridden by any subclass, simplification is not possible
STORM_LOG_DEBUG("Simplification not possible because the formula is not supported. Formula: " << formula);
return false;
}
@ -100,7 +100,6 @@ namespace storm {
std::shared_ptr<SparseModelType> SparseParametricModelSimplifier<SparseModelType>::eliminateConstantDeterministicStates(SparseModelType const& model, storm::storage::BitVector const& consideredStates, boost::optional<std::string> const& rewardModelName) {
storm::storage::SparseMatrix<typename SparseModelType::ValueType> const& sparseMatrix = model.getTransitionMatrix();
// get the action-based reward values
std::vector<typename SparseModelType::ValueType> actionRewards;
if(rewardModelName) {

2
src/storm-pgcl-cli/CMakeLists.txt

@ -1,5 +1,5 @@
add_executable(storm-pgcl-cli ${PROJECT_SOURCE_DIR}/src/storm-pgcl-cli/storm-pgcl.cpp)
target_link_libraries(storm-pgcl-cli storm-pgcl)
target_link_libraries(storm-pgcl-cli storm-pgcl storm-cli-utilities)
set_target_properties(storm-pgcl-cli PROPERTIES OUTPUT_NAME "storm-pgcl")
# installation

2
src/storm-pgcl-cli/storm-pgcl.cpp

@ -2,7 +2,7 @@
#include "logic/Formula.h"
#include "utility/initialize.h"
#include "storm/cli/cli.h"
#include "storm-cli-utilities/cli.h"
#include "storm/exceptions/BaseException.h"
#include "storm/utility/macros.h"
#include <boost/lexical_cast.hpp>

2
src/storm/CMakeLists.txt

@ -49,7 +49,7 @@ set(STORM_TARGETS ${STORM_TARGETS} PARENT_SCOPE)
# Create storm.
add_executable(storm-main ${STORM_MAIN_SOURCES} ${STORM_MAIN_HEADERS})
target_link_libraries(storm-main PUBLIC storm)
target_link_libraries(storm-main PUBLIC storm storm-cli-utilities)
set_target_properties(storm-main PROPERTIES OUTPUT_NAME "storm")
# Install storm headers to include directory.

35
src/storm/api/builder.h

@ -23,10 +23,6 @@
#include "storm/builder/ExplicitModelBuilder.h"
#include "storm/builder/jit/ExplicitJitJaniModelBuilder.h"
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/IOSettings.h"
#include "storm/settings/modules/JitBuilderSettings.h"
#include "storm/utility/macros.h"
#include "storm/exceptions/NotSupportedException.h"
@ -62,29 +58,18 @@ namespace storm {
}
template<typename ValueType>
std::shared_ptr<storm::models::sparse::Model<ValueType>> buildSparseModel(storm::storage::SymbolicModelDescription const& model, std::vector<std::shared_ptr<storm::logic::Formula const>> const& formulas, bool buildChoiceLabels = false, bool buildChoiceOrigins = false, bool buildStateValuations = false) {
storm::builder::BuilderOptions options(formulas);
if (storm::settings::getModule<storm::settings::modules::IOSettings>().isBuildFullModelSet()) {
options.setBuildAllLabels();
options.setBuildAllRewardModels();
options.clearTerminalStates();
}
options.setBuildChoiceLabels(buildChoiceLabels);
options.setBuildChoiceOrigins(buildChoiceOrigins);
options.setBuildStateValuations(buildStateValuations);
if (storm::settings::getModule<storm::settings::modules::IOSettings>().isJitSet()) {
std::shared_ptr<storm::models::sparse::Model<ValueType>> buildSparseModel(storm::storage::SymbolicModelDescription const& model, storm::builder::BuilderOptions const& options, bool jit = false, bool doctor = false) {
if (jit) {
STORM_LOG_THROW(model.isJaniModel(), storm::exceptions::NotSupportedException, "Cannot use JIT-based model builder for non-JANI model.");
storm::builder::jit::ExplicitJitJaniModelBuilder<ValueType> builder(model.asJaniModel(), options);
if (storm::settings::getModule<storm::settings::modules::JitBuilderSettings>().isDoctorSet()) {
if (doctor) {
bool result = builder.doctor();
STORM_LOG_THROW(result, storm::exceptions::NotSupportedException, "The JIT-based model builder cannot be used on your system.");
STORM_LOG_INFO("The JIT-based model builder seems to be working.");
}
return builder.build();
} else {
std::shared_ptr<storm::generator::NextStateGenerator<ValueType, uint32_t>> generator;
@ -99,6 +84,14 @@ namespace storm {
return builder.build();
}
}
template<typename ValueType>
std::shared_ptr<storm::models::sparse::Model<ValueType>> buildSparseModel(storm::storage::SymbolicModelDescription const& model, std::vector<std::shared_ptr<storm::logic::Formula const>> const& formulas, bool jit = false, bool doctor = false) {
storm::builder::BuilderOptions options(formulas);
return buildSparseModel<ValueType>(model, options, jit, doctor);
}
template<typename ValueType, typename RewardModelType = storm::models::sparse::StandardRewardModel<ValueType>>
std::shared_ptr<storm::models::sparse::Model<ValueType, RewardModelType>> buildSparseModel(storm::models::ModelType modelType, storm::storage::sparse::ModelComponents<ValueType, RewardModelType>&& components) {

8
src/storm/builder/BuilderOptions.cpp

@ -157,8 +157,8 @@ namespace storm {
return buildAllLabels;
}
BuilderOptions& BuilderOptions::setBuildAllRewardModels() {
buildAllRewardModels = true;
BuilderOptions& BuilderOptions::setBuildAllRewardModels(bool newValue) {
buildAllRewardModels = newValue;
return *this;
}
@ -185,8 +185,8 @@ namespace storm {
return *this;
}
BuilderOptions& BuilderOptions::setBuildAllLabels() {
buildAllLabels = true;
BuilderOptions& BuilderOptions::setBuildAllLabels(bool newValue) {
buildAllLabels = newValue;
return *this;
}

63
src/storm/builder/BuilderOptions.h

@ -81,9 +81,21 @@ namespace storm {
* model.
*/
void setTerminalStatesFromFormula(storm::logic::Formula const& formula);
/*!
* Which reward models are built
* @return
*/
std::vector<std::string> const& getRewardModelNames() const;
/*!
* Which labels are built
* @return
*/
std::set<std::string> const& getLabelNames() const;
/*!
* Which expression labels are built
* @return
*/
std::vector<storm::expressions::Expression> const& getExpressionLabels() const;
std::vector<std::pair<LabelOrExpression, bool>> const& getTerminalStates() const;
bool hasTerminalStates() const;
@ -96,18 +108,53 @@ namespace storm {
bool isExplorationChecksSet() const;
bool isExplorationShowProgressSet() const;
uint64_t getExplorationShowProgressDelay() const;
BuilderOptions& setBuildAllRewardModels();
/**
* Should all reward models be built? If not set, only required reward models are build.
* @param newValue The new value (default true)
* @return this
*/
BuilderOptions& setBuildAllRewardModels(bool newValue = true);
/**
* Add an additional reward model to build
* @param newValue The name of the extra reward model
* @return this
*/
BuilderOptions& addRewardModel(std::string const& rewardModelName);
BuilderOptions& setBuildAllLabels();
/**
* Should all reward models be built? If not set, only required reward models are build.
* @param newValue The new value (default true)
* @return this
*/
BuilderOptions& setBuildAllLabels(bool newValue = true);
BuilderOptions& addLabel(storm::expressions::Expression const& expression);
BuilderOptions& addLabel(std::string const& labelName);
BuilderOptions& addTerminalExpression(storm::expressions::Expression const& expression, bool value);
BuilderOptions& addTerminalLabel(std::string const& label, bool value);
BuilderOptions& setBuildChoiceLabels(bool newValue);
BuilderOptions& setBuildStateValuations(bool newValue);
BuilderOptions& setBuildChoiceOrigins(bool newValue);
BuilderOptions& setExplorationChecks(bool newValue);
/**
* Should the choice labels be built?
* @param newValue The new value (default true)
* @return this
*/
BuilderOptions& setBuildChoiceLabels(bool newValue = true);
/**
* Should the state valuation mapping be built?
* @param newValue The new value (default true)
* @return this
*/
BuilderOptions& setBuildStateValuations(bool newValue = true);
/**
* Should the origins the different choices be built?
* @param newValue The new value (default true)
* @return this
*/
BuilderOptions& setBuildChoiceOrigins(bool newValue = true);
/**
* Should extra checks be performed during exploration
* @param newValue The new value (default true)
* @return this
*/
BuilderOptions& setExplorationChecks(bool newValue = true);
private:
/// A flag that indicates whether all reward models are to be built. In this case, the reward model names are

2
src/storm/storm.cpp

@ -1,7 +1,7 @@
#include "storm/utility/macros.h"
#include "storm/exceptions/BaseException.h"
#include "storm/cli/cli.h"
#include "storm-cli-utilities/cli.h"
/*!
* Main entry point of the executable storm.

11
travis/generate_travis.py

@ -3,7 +3,7 @@
configs_linux = [
# OS, compiler
("ubuntu-16.10", "gcc", "-6"),
("debian-9", "gcc", "-6"),
#("debian-9", "gcc", "-6"),
]
# Configurations for Mac
@ -39,6 +39,7 @@ if __name__ == "__main__":
s += "branches:\n"
s += " only:\n"
s += " - master\n"
s += " - stable\n"
s += "dist: trusty\n"
s += "language: cpp\n"
s += "\n"
@ -54,6 +55,14 @@ if __name__ == "__main__":
s += "- docker\n"
s += "sudo: required\n"
s += "\n"
s += "notifications:\n"
s += " email:\n"
s += " on_failure: always\n"
s += " on_success: change\n"
s += " recipients:\n"
s += ' secure: "Q9CW/PtyWkZwExDrfFFb9n1STGYsRfI6awv1bZHcGwfrDvhpXoMCuF8CwviIfilm7fFJJEoKizTtdRpY0HrOnY/8KY111xrtcFYosxdndv7xbESodIxQOUoIEFCO0mCNHwWYisoi3dAA7H3Yn661EsxluwHjzX5vY0xSbw0n229hlsFz092HwGLSU33zHl7eXpQk+BOFmBTRGlOq9obtDZ17zbHz1oXFZntHK/JDUIYP0b0uq8NvE2jM6CIVdcuSwmIkOhZJoO2L3Py3rBbPci+L2PSK4Smv2UjCPF8KusnOaFIyDB3LcNM9Jqq5ssJMrK/KaO6BiuYrOZXYWZ7KEg3Y/naC8HjOH1dzty+P7oW46sb9F03pTsufqD4R7wcK+9wROTztO6aJPDG/IPH7EWgrBTxqlOkVRwi2eYuQouZpZUW6EMClKbMHMIxCH2S8aOk/r1w2cNwmPEcunnP0nl413x/ByHr4fTPFykPj8pQxIsllYjpdWBRQfDOauKWGzk6LcrFW0qpWP+/aJ2vYu/IoZQMG5lMHbp6Y1Lg09pYm7Q983v3b7D+JvXhOXMyGq91HyPahA2wwKoG1GA4uoZ2I95/IFYNiKkelDd3WTBoFLNF9YFoEJNdCywm1fO2WY4WkyEFBuQcgDA+YpFMJJMxjTbivYk9jvHk2gji//2w="\n'
s += "\n"
s += "#\n"
s += "# Configurations\n"
s += "#\n"

Loading…
Cancel
Save