Browse Source

Merge branch 'master' into dft_iso

main
Matthias Volk 6 years ago
parent
commit
c361d59d65
  1. 258
      .travis.yml
  2. 2
      CHANGELOG.md
  3. 2
      resources/3rdparty/gmm-5.2/include/gmm/gmm_blas.h
  4. 5
      src/storm-cli-utilities/cli.cpp
  5. 2
      src/storm-dft/storage/dft/DFTIsomorphism.h
  6. 11
      src/storm-parsers/parser/ExpressionCreator.cpp
  7. 1
      src/storm-parsers/parser/ExpressionCreator.h
  8. 10
      src/storm-parsers/parser/ExpressionParser.cpp
  9. 1
      src/storm-parsers/parser/ExpressionParser.h
  10. 4
      src/storm-parsers/parser/FormulaParserGrammar.cpp
  11. 32
      src/storm/adapters/IntelTbbAdapter.h
  12. 6
      src/storm/adapters/MathsatExpressionAdapter.h
  13. 23
      src/storm/adapters/RationalFunctionAdapter.h
  14. 3
      src/storm/analysis/GraphConditions.h
  15. 10
      src/storm/modelchecker/multiobjective/constraintbased/SparseCbAchievabilityQuery.cpp
  16. 1
      src/storm/modelchecker/prctl/helper/rewardbounded/CostLimitClosure.cpp
  17. 1
      src/storm/settings/modules/CoreSettings.cpp
  18. 1
      src/storm/solver/GmmxxMultiplier.cpp
  19. 1
      src/storm/solver/NativeMultiplier.cpp
  20. 2
      src/storm/storage/Scheduler.cpp
  21. 7
      src/storm/storage/SparseMatrix.cpp
  22. 1
      src/storm/storage/SparseMatrix.h
  23. 53
      src/storm/storage/expressions/Expression.cpp
  24. 3
      src/storm/storage/expressions/Expression.h
  25. 50
      src/storm/storage/expressions/UnaryNumericalFunctionExpression.cpp
  26. 28
      src/storm/utility/ExpressionHelper.cpp
  27. 28
      src/storm/utility/ExpressionHelper.h
  28. 3
      src/storm/utility/VectorHelper.cpp
  29. 12
      src/storm/utility/constants.cpp
  30. 3
      src/storm/utility/constants.h
  31. 6
      src/storm/utility/vector.h
  32. 8
      travis/build_carl_helper.sh
  33. 10
      travis/generate_travis.py

258
.travis.yml

@ -40,11 +40,11 @@ jobs:
# Stage: Build Carl
###
# ubuntu-18.04 - DefaultDebugTravis
# ubuntu-19.04 - DefaultDebugTravis
- stage: Build Carl
os: linux
compiler: gcc
env: CONFIG=DefaultDebugTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultDebugTravis LINUX=ubuntu-19.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -53,11 +53,11 @@ jobs:
- travis/build_carl.sh
after_success:
- travis/deploy_carl.sh
# ubuntu-18.04 - DefaultReleaseTravis
# ubuntu-19.04 - DefaultReleaseTravis
- stage: Build Carl
os: linux
compiler: gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-19.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -71,6 +71,38 @@ jobs:
# Stage: Build (1st run)
###
# ubuntu-18.04 - DefaultDebug
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.04 COMPILER=gcc
install:
- rm -rf build
- travis/install_linux.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build1
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultRelease
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.04 COMPILER=gcc
install:
- rm -rf build
- travis/install_linux.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build1
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9 - DefaultDebug
- stage: Build (1st run)
os: linux
@ -103,11 +135,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultDebugTravis
# ubuntu-18.10 - DefaultDebug
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebugTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.10 COMPILER=gcc
install:
- rm -rf build
- travis/install_linux.sh
@ -119,11 +151,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultReleaseTravis
# ubuntu-18.10 - DefaultRelease
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.10 COMPILER=gcc
install:
- rm -rf build
- travis/install_linux.sh
@ -135,11 +167,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultDebug
# ubuntu-19.04 - DefaultDebugTravis
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultDebugTravis LINUX=ubuntu-19.04 COMPILER=gcc
install:
- rm -rf build
- travis/install_linux.sh
@ -151,11 +183,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultRelease
# ubuntu-19.04 - DefaultReleaseTravis
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-19.04 COMPILER=gcc
install:
- rm -rf build
- travis/install_linux.sh
@ -172,6 +204,36 @@ jobs:
# Stage: Build (2nd run)
###
# ubuntu-18.04 - DefaultDebug
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build2
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultRelease
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build2
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9 - DefaultDebug
- stage: Build (2nd run)
os: linux
@ -202,11 +264,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultDebugTravis
# ubuntu-18.10 - DefaultDebug
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebugTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.10 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -217,11 +279,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultReleaseTravis
# ubuntu-18.10 - DefaultRelease
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.10 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -232,11 +294,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultDebug
# ubuntu-19.04 - DefaultDebugTravis
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultDebugTravis LINUX=ubuntu-19.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -247,11 +309,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultRelease
# ubuntu-19.04 - DefaultReleaseTravis
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-19.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -267,6 +329,36 @@ jobs:
# Stage: Build (3rd run)
###
# ubuntu-18.04 - DefaultDebug
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build3
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultRelease
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build3
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9 - DefaultDebug
- stage: Build (3rd run)
os: linux
@ -297,11 +389,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultDebugTravis
# ubuntu-18.10 - DefaultDebug
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebugTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.10 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -312,11 +404,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultReleaseTravis
# ubuntu-18.10 - DefaultRelease
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.10 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -327,11 +419,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultDebug
# ubuntu-19.04 - DefaultDebugTravis
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultDebugTravis LINUX=ubuntu-19.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -342,11 +434,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultRelease
# ubuntu-19.04 - DefaultReleaseTravis
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-19.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -362,6 +454,36 @@ jobs:
# Stage: Build (4th run)
###
# ubuntu-18.04 - DefaultDebug
- stage: Build (4th run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh BuildLast
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultRelease
- stage: Build (4th run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh BuildLast
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9 - DefaultDebug
- stage: Build (4th run)
os: linux
@ -392,11 +514,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultDebugTravis
# ubuntu-18.10 - DefaultDebug
- stage: Build (4th run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebugTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.10 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -407,11 +529,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultReleaseTravis
# ubuntu-18.10 - DefaultRelease
- stage: Build (4th run)
os: linux
compiler: gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.10 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -422,11 +544,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultDebug
# ubuntu-19.04 - DefaultDebugTravis
- stage: Build (4th run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultDebugTravis LINUX=ubuntu-19.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -437,11 +559,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultRelease
# ubuntu-19.04 - DefaultReleaseTravis
- stage: Build (4th run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-19.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -457,6 +579,36 @@ jobs:
# Stage: Test all
###
# ubuntu-18.04 - DefaultDebug
- stage: Test all
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh TestAll
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultRelease
- stage: Test all
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh TestAll
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9 - DefaultDebug
- stage: Test all
os: linux
@ -487,11 +639,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultDebugTravis
# ubuntu-18.10 - DefaultDebug
- stage: Test all
os: linux
compiler: gcc
env: CONFIG=DefaultDebugTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.10 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -502,13 +654,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
after_success:
- travis/deploy_storm.sh
# ubuntu-18.04 - DefaultReleaseTravis
# ubuntu-18.10 - DefaultRelease
- stage: Test all
os: linux
compiler: gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.10 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -519,13 +669,11 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
after_success:
- travis/deploy_storm.sh
# ubuntu-18.04 - DefaultDebug
# ubuntu-19.04 - DefaultDebugTravis
- stage: Test all
os: linux
compiler: gcc
env: CONFIG=DefaultDebug LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultDebugTravis LINUX=ubuntu-19.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -536,11 +684,13 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultRelease
after_success:
- travis/deploy_storm.sh
# ubuntu-19.04 - DefaultReleaseTravis
- stage: Test all
os: linux
compiler: gcc
env: CONFIG=DefaultRelease LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-19.04 COMPILER=gcc
install:
- travis/install_linux.sh
before_script:
@ -551,20 +701,22 @@ jobs:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
after_success:
- travis/deploy_storm.sh
allow_failures:
- stage: Build (1st run)
os: linux
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-19.04 COMPILER=gcc
- stage: Build (2nd run)
os: linux
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-19.04 COMPILER=gcc
- stage: Build (3rd run)
os: linux
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-19.04 COMPILER=gcc
- stage: Build (4th run)
os: linux
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-19.04 COMPILER=gcc
- stage: Test all
os: linux
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc
env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-19.04 COMPILER=gcc

2
CHANGELOG.md

@ -12,6 +12,8 @@ Version 1.3.x
- Allow to quickly check a benchmark from the [Quantitative Verification Benchmark Set](http://qcomp.org/benchmarks/) using the --qvbs option.
- Added script resources/examples/download_qvbs.sh to download the QVBS.
- If an option is unknown, Storm now prints a hint to similar option names.
- Support for the new `round` operator in the PRISM language
- Support for parsing of exact time bounds for properties, e.g., `P=? [F=27 "goal"]`
- JANI: Allow bounded types for constants
- JANI: Support for non-trivial reward accumulations.
- JANI: Fixed support for reward expressions over non-transient variables.

2
resources/3rdparty/gmm-5.2/include/gmm/gmm_blas.h

@ -44,7 +44,7 @@
#ifdef STORM_HAVE_INTELTBB
#include <new> // This fixes a potential dependency ordering problem between GMM and TBB
#include "tbb/tbb.h"
#include "storm/adapters/IntelTbbAdapter.h"
#include <iterator>
#endif

5
src/storm-cli-utilities/cli.cpp

@ -17,9 +17,8 @@
// Includes for the linked libraries and versions header.
#ifdef STORM_HAVE_INTELTBB
# include "tbb/tbb_stddef.h"
#endif
#include "storm/adapters/IntelTbbAdapter.h"
#ifdef STORM_HAVE_GLPK
# include "glpk.h"
#endif

2
src/storm-dft/storage/dft/DFTIsomorphism.h

@ -309,7 +309,7 @@ namespace storage {
case storm::storage::DFTElementType::BE_CONST:
{
auto beConst = std::static_pointer_cast<BEConst<ValueType> const>(be);
depColour[dep->id()] = std::pair<ValueType, ValueType>(dep->probability(), beConst->failed());
depColour[dep->id()] = std::pair<ValueType, ValueType>(dep->probability(), beConst->failed() ? storm::utility::one<ValueType>() : storm::utility::zero<ValueType>());
break;
}
default:

11
src/storm-parsers/parser/ExpressionCreator.cpp

@ -220,6 +220,17 @@ namespace storm {
return manager.boolean(false);
}
storm::expressions::Expression ExpressionCreator::createRoundExpression(storm::expressions::Expression const& e1, bool& pass) const {
if (this->createExpressions) {
try {
return storm::expressions::round(e1);
} catch (storm::exceptions::InvalidTypeException const& e) {
pass = false;
}
}
return manager.boolean(false);
}
storm::expressions::Expression ExpressionCreator::getIdentifierExpression(std::string const& identifier, bool& pass) const {
if (this->createExpressions) {
STORM_LOG_THROW(this->identifiers != nullptr, storm::exceptions::WrongFormatException, "Unable to substitute identifier expressions without given mapping.");

1
src/storm-parsers/parser/ExpressionCreator.h

@ -70,6 +70,7 @@ namespace storm {
storm::expressions::Expression createBooleanLiteralExpression(bool value, bool& pass) const;
storm::expressions::Expression createMinimumMaximumExpression(storm::expressions::Expression const& e1, storm::expressions::OperatorType const& operatorType, storm::expressions::Expression const& e2, bool& pass) const;
storm::expressions::Expression createFloorCeilExpression(storm::expressions::OperatorType const& operatorType, storm::expressions::Expression const& e1, bool& pass) const;
storm::expressions::Expression createRoundExpression(storm::expressions::Expression const& e1, bool& pass) const;
storm::expressions::Expression getIdentifierExpression(std::string const& identifier, bool& pass) const;

10
src/storm-parsers/parser/ExpressionParser.cpp

@ -50,6 +50,13 @@ namespace storm {
}
floorCeilExpression.name("floor/ceil expression");
if (allowBacktracking) {
roundExpression = ((qi::lit("round") >> qi::lit("(")) >> expression >> qi::lit(")"))[qi::_val = phoenix::bind(&ExpressionCreator::createRoundExpression, phoenix::ref(*expressionCreator), qi::_1, qi::_pass)];
} else {
roundExpression = ((qi::lit("round") >> qi::lit("(")) > expression > qi::lit(")"))[qi::_val = phoenix::bind(&ExpressionCreator::createRoundExpression, phoenix::ref(*expressionCreator), qi::_1, qi::_pass)];
}
roundExpression.name("round expression");
if (allowBacktracking) {
minMaxExpression = ((minMaxOperator_[qi::_a = qi::_1] >> qi::lit("(")) >> expression[qi::_val = qi::_1] >> +(qi::lit(",") >> expression)[qi::_val = phoenix::bind(&ExpressionCreator::createMinimumMaximumExpression, phoenix::ref(*expressionCreator), qi::_val, qi::_a, qi::_1, qi::_pass)]) >> qi::lit(")");
} else {
@ -75,7 +82,7 @@ namespace storm {
| qi::int_[qi::_val = phoenix::bind(&ExpressionCreator::createIntegerLiteralExpression, phoenix::ref(*expressionCreator), qi::_1, qi::_pass)];
literalExpression.name("literal expression");
atomicExpression = floorCeilExpression | prefixPowerModuloExpression | minMaxExpression | (qi::lit("(") >> expression >> qi::lit(")")) | identifierExpression | literalExpression;
atomicExpression = floorCeilExpression | roundExpression | prefixPowerModuloExpression | minMaxExpression | (qi::lit("(") >> expression >> qi::lit(")")) | identifierExpression | literalExpression;
atomicExpression.name("atomic expression");
unaryExpression = (-unaryOperator_ >> atomicExpression)[qi::_val = phoenix::bind(&ExpressionCreator::createUnaryExpression, phoenix::ref(*expressionCreator), qi::_1, qi::_2, qi::_pass)];
@ -173,6 +180,7 @@ namespace storm {
qi::on_error<qi::fail>(identifierExpression, handler(qi::_1, qi::_2, qi::_3, qi::_4));
qi::on_error<qi::fail>(minMaxExpression, handler(qi::_1, qi::_2, qi::_3, qi::_4));
qi::on_error<qi::fail>(floorCeilExpression, handler(qi::_1, qi::_2, qi::_3, qi::_4));
qi::on_error<qi::fail>(roundExpression, handler(qi::_1, qi::_2, qi::_3, qi::_4));
}
}

1
src/storm-parsers/parser/ExpressionParser.h

@ -232,6 +232,7 @@ namespace storm {
qi::rule<Iterator, storm::expressions::Expression(), Skipper> identifierExpression;
qi::rule<Iterator, storm::expressions::Expression(), qi::locals<storm::expressions::OperatorType>, Skipper> minMaxExpression;
qi::rule<Iterator, storm::expressions::Expression(), qi::locals<storm::expressions::OperatorType>, Skipper> floorCeilExpression;
qi::rule<Iterator, storm::expressions::Expression(), Skipper> roundExpression;
qi::rule<Iterator, std::string(), Skipper> identifier;
// Parser that is used to recognize doubles only (as opposed to Spirit's double_ parser).

4
src/storm-parsers/parser/FormulaParserGrammar.cpp

@ -85,7 +85,9 @@ namespace storm {
timeBound = ((timeBoundReference >> qi::lit("[")) > expressionParser > qi::lit(",") > expressionParser > qi::lit("]"))
[qi::_val = phoenix::bind(&FormulaParserGrammar::createTimeBoundFromInterval, phoenix::ref(*this), qi::_2, qi::_3, qi::_1)]
| ( timeBoundReference >> (qi::lit("<=")[qi::_a = true, qi::_b = false] | qi::lit("<")[qi::_a = true, qi::_b = true] | qi::lit(">=")[qi::_a = false, qi::_b = false] | qi::lit(">")[qi::_a = false, qi::_b = true]) >> expressionParser)
[qi::_val = phoenix::bind(&FormulaParserGrammar::createTimeBoundFromSingleBound, phoenix::ref(*this), qi::_2, qi::_a, qi::_b, qi::_1)];
[qi::_val = phoenix::bind(&FormulaParserGrammar::createTimeBoundFromSingleBound, phoenix::ref(*this), qi::_2, qi::_a, qi::_b, qi::_1)]
| ( timeBoundReference >> qi::lit("=") >> expressionParser)
[qi::_val = phoenix::bind(&FormulaParserGrammar::createTimeBoundFromInterval, phoenix::ref(*this), qi::_2, qi::_2, qi::_1)];
timeBound.name("time bound");
timeBounds = (timeBound % qi::lit(",")) | (((-qi::lit("^") >> qi::lit("{")) >> (timeBound % qi::lit(","))) >> qi::lit("}"));

32
src/storm/adapters/IntelTbbAdapter.h

@ -0,0 +1,32 @@
#pragma once
// To detect whether the usage of TBB is possible, this include is neccessary
#include "storm-config.h"
/* On macOS, TBB includes the header
* /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/mach/boolean.h
* which #defines macros TRUE and FALSE. Since these also occur as identifiers, we #undef them after including TBB.
* We still issue a warning in case these macros have been defined before.
*/
#ifdef TRUE
#warning "Undefining previously defined macro 'TRUE'."
#endif
#ifdef FALSE
#warning "Undefining previously defined macro 'FALSE'."
#endif
#ifdef STORM_HAVE_INTELTBB
#include "tbb/tbb.h"
#include "tbb/tbb_stddef.h"
#endif
#ifdef TRUE
#undef TRUE
#endif
#ifdef FALSE
#undef FALSE
#endif

6
src/storm/adapters/MathsatExpressionAdapter.h

@ -257,13 +257,11 @@ namespace storm {
switch (expression.getOperatorType()) {
case storm::expressions::UnaryNumericalFunctionExpression::OperatorType::Minus:
return msat_make_times(env, msat_make_number(env, "-1"), childResult);
break;
case storm::expressions::UnaryNumericalFunctionExpression::OperatorType::Floor:
return msat_make_floor(env, childResult);
break;
case storm::expressions::UnaryNumericalFunctionExpression::OperatorType::Ceil:
return msat_make_plus(env, msat_make_floor(env, childResult), msat_make_number(env, "1"));
break;
// Mathsat does not support ceil... but ceil(x) = -floor(-x) wheeii \o/
return msat_make_times(env, msat_make_number(env, "-1"), msat_make_floor(env, msat_make_times(env, msat_make_number(env, "-1"), childResult)));
default:
STORM_LOG_THROW(false, storm::exceptions::ExpressionEvaluationException, "Cannot evaluate expression: unknown numerical unary operator: '" << static_cast<uint_fast64_t>(expression.getOperatorType()) << "' in expression " << expression << ".");
}

23
src/storm/adapters/RationalFunctionAdapter.h

@ -9,27 +9,6 @@
#include <carl/core/Relation.h>
#include <carl/util/stringparser.h>
// Some header files on macOS (included via INTEL TBB) might #define TRUE and FALSE, which in carl/formula/Formula.h are used as FormulaTypes.
// Hence, we temporarily #undef these:
#ifdef TRUE
#define STORM_TEMP_TRUE TRUE
#undef TRUE
#endif
#ifdef FALSE
#define STORM_TEMP_FALSE FALSE
#undef FALSE
#endif
#include <carl/formula/Formula.h>
// Restore TRUE / FALSE macros.
#ifdef STORM_TEMP_TRUE
#define TRUE STORM_TEMP_TRUE
#undef STORM_TEMP_TRUE
#endif
#ifdef STORM_TEMP_FALSE
#define FALSE STORM_TEMP_FALSE
#undef STORM_TEMP_FALSE
#endif
namespace carl {
// Define hash values for all polynomials and rational function.
template<typename C, typename O, typename P>
@ -78,7 +57,5 @@ namespace storm {
typedef carl::RationalFunction<Polynomial, true> RationalFunction;
typedef carl::Interval<double> Interval;
typedef carl::Formula<RawPolynomial> RationalFunctionConstraint;
}

3
src/storm/analysis/GraphConditions.h

@ -4,6 +4,7 @@
#include <unordered_set>
#include "storm/adapters/RationalFunctionAdapter.h"
#include "storm/models/sparse/Dtmc.h"
#include <carl/formula/Formula.h>
namespace storm {
namespace analysis {
@ -16,7 +17,7 @@ namespace storm {
template<typename ValueType>
struct ConstraintType<ValueType, typename std::enable_if<std::is_same<storm::RationalFunction, ValueType>::value>::type> {
typedef storm::RationalFunctionConstraint val;
typedef carl::Formula<typename storm::RationalFunction::PolyType::PolyType> val;
};
/**

10
src/storm/modelchecker/multiobjective/constraintbased/SparseCbAchievabilityQuery.cpp

@ -9,7 +9,6 @@
#include "storm/utility/vector.h"
#include "storm/utility/solver.h"
#include "storm/utility/Stopwatch.h"
#include "storm/utility/ExpressionHelper.h"
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/GeneralSettings.h"
#include "storm/settings/modules/CoreSettings.h"
@ -82,7 +81,7 @@ namespace storm {
uint_fast64_t numStates = this->preprocessedModel->getNumberOfStates();
uint_fast64_t numChoices = this->preprocessedModel->getNumberOfChoices();
uint_fast64_t numBottomStates = this->reward0EStates.getNumberOfSetBits();
STORM_LOG_THROW(numBottomStates > 0, storm::exceptions::UnexpectedException, "No bottom states in the preprocessed model.");
storm::expressions::Expression zero = this->expressionManager->rational(storm::utility::zero<ValueType>());
storm::expressions::Expression one = this->expressionManager->rational(storm::utility::one<ValueType>());
@ -106,7 +105,7 @@ namespace storm {
solver->add(var.getExpression() >= zero);
bottomStateVarsAsExpression.push_back(var.getExpression());
}
auto bottomStateSum = storm::utility::ExpressionHelper(this->expressionManager).sum(std::move(bottomStateVarsAsExpression));
auto bottomStateSum = storm::expressions::sum(bottomStateVarsAsExpression).simplify();
solver->add(bottomStateSum == one);
// assert that the "incoming" value of each state equals the "outgoing" value
@ -149,7 +148,10 @@ namespace storm {
objectiveValues.push_back(this->expressionManager->rational(rewards[choice]) * expectedChoiceVariables[choice].getExpression());
}
}
auto objValue = storm::utility::ExpressionHelper(this->expressionManager).sum(std::move(objectiveValues));
if (objectiveValues.empty()) {
objectiveValues.push_back(this->expressionManager->rational(storm::utility::zero<storm::RationalNumber>()));
}
auto objValue = storm::expressions::sum(objectiveValues).simplify();
// We need to actually evaluate the threshold as rational number. Otherwise a threshold like '<=16/9' might be considered as 1 due to integer division
storm::expressions::Expression threshold = this->expressionManager->rational(obj.formula->getThreshold().evaluateAsRational());

1
src/storm/modelchecker/prctl/helper/rewardbounded/CostLimitClosure.cpp

@ -1,4 +1,3 @@
#include <storm/utility/ExpressionHelper.h>
#include "storm/modelchecker/prctl/helper/rewardbounded/CostLimitClosure.h"
#include "storm/utility/macros.h"
#include "storm/exceptions/IllegalArgumentException.h"

1
src/storm/settings/modules/CoreSettings.cpp

@ -9,6 +9,7 @@
#include "storm/solver/SolverSelectionOptions.h"
#include "storm/storage/dd/DdType.h"
#include "storm/adapters/IntelTbbAdapter.h"
#include "storm/utility/macros.h"
#include "storm/exceptions/IllegalArgumentValueException.h"

1
src/storm/solver/GmmxxMultiplier.cpp

@ -2,6 +2,7 @@
#include "storm/adapters/RationalNumberAdapter.h"
#include "storm/adapters/RationalFunctionAdapter.h"
#include "storm/adapters/IntelTbbAdapter.h"
#include "storm/storage/SparseMatrix.h"
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/CoreSettings.h"

1
src/storm/solver/NativeMultiplier.cpp

@ -10,6 +10,7 @@
#include "storm/adapters/RationalNumberAdapter.h"
#include "storm/adapters/RationalFunctionAdapter.h"
#include "storm/adapters/IntelTbbAdapter.h"
#include "storm/utility/macros.h"

2
src/storm/storage/Scheduler.cpp

@ -17,7 +17,7 @@ namespace storm {
template <typename ValueType>
Scheduler<ValueType>::Scheduler(uint_fast64_t numberOfModelStates, boost::optional<storm::storage::MemoryStructure>&& memoryStructure) : memoryStructure(std::move(memoryStructure)) {
uint_fast64_t numOfMemoryStates = memoryStructure ? memoryStructure->getNumberOfStates() : 1;
uint_fast64_t numOfMemoryStates = this->memoryStructure ? this->memoryStructure->getNumberOfStates() : 1;
schedulerChoices = std::vector<std::vector<SchedulerChoice<ValueType>>>(numOfMemoryStates, std::vector<SchedulerChoice<ValueType>>(numberOfModelStates));
numOfUndefinedChoices = numOfMemoryStates * numberOfModelStates;
numOfDeterministicChoices = 0;

7
src/storm/storage/SparseMatrix.cpp

@ -1,12 +1,5 @@
#include <boost/functional/hash.hpp>
// To detect whether the usage of TBB is possible, this include is neccessary
#include "storm-config.h"
#ifdef STORM_HAVE_INTELTBB
#include "tbb/tbb.h"
#endif
#include "storm/storage/sparse/StateType.h"
#include "storm/storage/SparseMatrix.h"
#include "storm/adapters/RationalFunctionAdapter.h"

1
src/storm/storage/SparseMatrix.h

@ -16,6 +16,7 @@
#include "storm/utility/macros.h"
#include "storm/utility/constants.h"
#include "storm/adapters/RationalFunctionAdapter.h"
#include "storm/adapters/IntelTbbAdapter.h"
// Forward declaration for adapter classes.
namespace storm {

53
src/storm/storage/expressions/Expression.cpp

@ -414,6 +414,11 @@ namespace storm {
STORM_LOG_THROW(first.hasNumericalType(), storm::exceptions::InvalidTypeException, "Operator 'ceil' requires numerical operand.");
return Expression(std::shared_ptr<BaseExpression>(new UnaryNumericalFunctionExpression(first.getBaseExpression().getManager(), first.getType().floorCeil(), first.getBaseExpressionPointer(), UnaryNumericalFunctionExpression::OperatorType::Ceil)));
}
Expression round(Expression const& first) {
STORM_LOG_THROW(first.hasNumericalType(), storm::exceptions::InvalidTypeException, "Operator 'round' requires numerical operand.");
return floor(first + first.getManager().rational(0.5));
}
Expression abs(Expression const& first) {
STORM_LOG_THROW(first.hasNumericalType(), storm::exceptions::InvalidTypeException, "Abs is only defined for numerical operands");
@ -431,19 +436,19 @@ namespace storm {
}
Expression disjunction(std::vector<storm::expressions::Expression> const& expressions) {
return apply(expressions, [] (Expression const& e1, Expression const& e2) { return e1 || e2; });
return applyAssociative(expressions, [] (Expression const& e1, Expression const& e2) { return e1 || e2; });
}
Expression conjunction(std::vector<storm::expressions::Expression> const& expressions) {
return apply(expressions, [] (Expression const& e1, Expression const& e2) { return e1 && e2; });
return applyAssociative(expressions, [] (Expression const& e1, Expression const& e2) { return e1 && e2; });
}
Expression sum(std::vector<storm::expressions::Expression> const& expressions) {
return apply(expressions, [] (Expression const& e1, Expression const& e2) { return e1 + e2; });
return applyAssociative(expressions, [] (Expression const& e1, Expression const& e2) { return e1 + e2; });
}
Expression apply(std::vector<storm::expressions::Expression> const& expressions, std::function<Expression (Expression const&, Expression const&)> const& function) {
STORM_LOG_THROW(!expressions.empty(), storm::exceptions::InvalidArgumentException, "Cannot build disjunction of empty expression list.");
STORM_LOG_THROW(!expressions.empty(), storm::exceptions::InvalidArgumentException, "Cannot build function application of empty expression list.");
auto it = expressions.begin();
auto ite = expressions.end();
Expression result = *it;
@ -455,5 +460,45 @@ namespace storm {
return result;
}
Expression applyAssociative(std::vector<storm::expressions::Expression> const& expressions, std::function<Expression (Expression const&, Expression const&)> const& function) {
STORM_LOG_THROW(!expressions.empty(), storm::exceptions::InvalidArgumentException, "Cannot build function application of empty expression list.");
// Balance the syntax tree if there are enough operands
if (expressions.size() >= 4) {
// we treat operands and literals seperately so that a subsequent call to simplify() is more successful (see, e.g., (a + 1) + (b + 1))
std::vector<std::vector<storm::expressions::Expression>> operandTypes(2);
auto& nonliterals = operandTypes[0];
auto& literals = operandTypes[1];
for (auto const& expression : expressions) {
if (expression.isLiteral()) {
literals.push_back(expression);
} else {
nonliterals.push_back(expression);
}
}
for (auto& operands : operandTypes) {
auto opIt = operands.begin();
while (operands.size() > 1) {
if (opIt == operands.end() || opIt == operands.end() - 1) {
opIt = operands.begin();
}
*opIt = function(*opIt, operands.back());
operands.pop_back();
++opIt;
}
}
if (nonliterals.empty()) {
return literals.front();
} else if (literals.empty()) {
return nonliterals.front();
} else {
return function(literals.front(), nonliterals.front());
}
} else {
return apply(expressions, function);
}
}
}
}

3
src/storm/storage/expressions/Expression.h

@ -56,6 +56,7 @@ namespace storm {
friend Expression sign(Expression const& first);
friend Expression floor(Expression const& first);
friend Expression ceil(Expression const& first);
friend Expression round(Expression const& first);
friend Expression minimum(Expression const& first, Expression const& second);
friend Expression maximum(Expression const& first, Expression const& second);
@ -434,12 +435,14 @@ namespace storm {
Expression sign(Expression const& first);
Expression floor(Expression const& first);
Expression ceil(Expression const& first);
Expression round(Expression const& first);
Expression minimum(Expression const& first, Expression const& second);
Expression maximum(Expression const& first, Expression const& second);
Expression disjunction(std::vector<storm::expressions::Expression> const& expressions);
Expression conjunction(std::vector<storm::expressions::Expression> const& expressions);
Expression sum(std::vector<storm::expressions::Expression> const& expressions);
Expression apply(std::vector<storm::expressions::Expression> const& expressions, std::function<Expression (Expression const&, Expression const&)> const& function);
Expression applyAssociative(std::vector<storm::expressions::Expression> const& expressions, std::function<Expression (Expression const&, Expression const&)> const& function);
}
}

50
src/storm/storage/expressions/UnaryNumericalFunctionExpression.cpp

@ -40,6 +40,7 @@ namespace storm {
int_fast64_t result = this->getOperand()->evaluateAsInt(valuation);
return -result;
} else {
// TODO: this should evaluate the operand as a rational.
double result = this->getOperand()->evaluateAsDouble(valuation);
switch (this->getOperatorType()) {
case OperatorType::Floor: return static_cast<int_fast64_t>(std::floor(result)); break;
@ -67,39 +68,36 @@ namespace storm {
std::shared_ptr<BaseExpression const> operandSimplified = this->getOperand()->simplify();
if (operandSimplified->isLiteral()) {
boost::variant<int_fast64_t, storm::RationalNumber> operandEvaluation;
if (operandSimplified->hasIntegerType()) {
operandEvaluation = operandSimplified->evaluateAsInt();
} else {
operandEvaluation = operandSimplified->evaluateAsRational();
}
bool rationalToInteger = this->getOperatorType() == OperatorType::Floor || this->getOperatorType() == OperatorType::Ceil;
if (operandSimplified->hasIntegerType()) {
int_fast64_t value = 0;
int_fast64_t value = operandSimplified->evaluateAsInt();
switch (this->getOperatorType()) {
case OperatorType::Minus: value = -boost::get<int_fast64_t>(operandEvaluation); break;
case OperatorType::Floor: value = std::floor(boost::get<int_fast64_t>(operandEvaluation)); break;
case OperatorType::Ceil: value = std::ceil(boost::get<int_fast64_t>(operandEvaluation)); break;
}
return std::shared_ptr<BaseExpression>(new IntegerLiteralExpression(this->getManager(), value));
} else if (rationalToInteger) {
int_fast64_t value = 0;
switch (this->getOperatorType()) {
case OperatorType::Floor: value = storm::utility::convertNumber<int_fast64_t>(storm::RationalNumber(carl::floor(boost::get<storm::RationalNumber>(operandEvaluation)))); break;
case OperatorType::Ceil: value = storm::utility::convertNumber<int_fast64_t>(storm::RationalNumber(carl::ceil(boost::get<storm::RationalNumber>(operandEvaluation)))); break;
default:
STORM_LOG_ASSERT(false, "Unexpected rational to integer conversion.");
case OperatorType::Minus: value = -value; break;
// Nothing to be done for the other cases:
// case OperatorType::Floor:
// case OperatorType::Ceil:
}
return std::shared_ptr<BaseExpression>(new IntegerLiteralExpression(this->getManager(), value));
} else {
storm::RationalNumber value = storm::utility::zero<storm::RationalNumber>();
storm::RationalNumber value = operandSimplified->evaluateAsRational();
bool convertToInteger = false;
switch (this->getOperatorType()) {
case OperatorType::Minus: value = -boost::get<storm::RationalNumber>(operandEvaluation); break;
case OperatorType::Floor: value = carl::floor(boost::get<storm::RationalNumber>(operandEvaluation)); break;
case OperatorType::Ceil: value = carl::ceil(boost::get<storm::RationalNumber>(operandEvaluation)); break;
case OperatorType::Minus:
value = -value;
break;
case OperatorType::Floor:
value = storm::utility::floor(value);
convertToInteger = true;
break;
case OperatorType::Ceil:
value = storm::utility::ceil(value);
convertToInteger = true;
break;
}
if (convertToInteger) {
return std::shared_ptr<BaseExpression>(new IntegerLiteralExpression(this->getManager(), storm::utility::convertNumber<int64_t>(value)));
} else {
return std::shared_ptr<BaseExpression>(new RationalLiteralExpression(this->getManager(), value));
}
return std::shared_ptr<BaseExpression>(new RationalLiteralExpression(this->getManager(), value));
}
}

28
src/storm/utility/ExpressionHelper.cpp

@ -1,28 +0,0 @@
#include "storm/utility/ExpressionHelper.h"
#include "storm/utility/constants.h"
namespace storm {
namespace utility {
ExpressionHelper::ExpressionHelper(std::shared_ptr<storm::expressions::ExpressionManager> const& expressionManager) : manager(expressionManager) {
// Intentionally left empty
}
storm::expressions::Expression ExpressionHelper::sum(std::vector<storm::expressions::Expression>&& summands) const {
if (summands.empty()) {
return manager->rational(storm::utility::zero<storm::RationalNumber>());
}
storm::expressions::Expression res = summands.front();
bool first = true;
for (auto& s : summands) {
if (first) {
first = false;
} else {
res = res + s;
}
}
return res.simplify().reduceNesting();
}
}
}

28
src/storm/utility/ExpressionHelper.h

@ -1,28 +0,0 @@
#pragma once
#include <vector>
#include <memory>
#include "storm/storage/expressions/Expression.h"
#include "storm/storage/expressions/ExpressionManager.h"
namespace storm {
namespace utility {
class ExpressionHelper {
public:
ExpressionHelper(std::shared_ptr<storm::expressions::ExpressionManager> const& expressionManager);
/*!
* Creates an expression that is the sum over all the given summands.
*/
storm::expressions::Expression sum(std::vector<storm::expressions::Expression>&& summands) const;
private:
std::shared_ptr<storm::expressions::ExpressionManager> manager;
};
}
}

3
src/storm/utility/VectorHelper.cpp

@ -5,8 +5,7 @@
#include "storm/adapters/RationalNumberAdapter.h"
#include "storm/adapters/RationalFunctionAdapter.h"
#include "storm-config.h"
#include "storm/adapters/IntelTbbAdapter.h"
#include "storm/utility/vector.h"

12
src/storm/utility/constants.cpp

@ -52,7 +52,7 @@ namespace storm {
template<>
bool isNan(double const& value) {
return isnan(value);
return std::isnan(value);
}
bool isAlmostZero(double const& a) {
@ -256,6 +256,12 @@ namespace storm {
return std::ceil(number);
}
template<typename ValueType>
ValueType round(ValueType const& number) {
// Rounding towards infinity
return floor<ValueType >(number + storm::utility::convertNumber<ValueType>(0.5));
}
template<typename ValueType>
ValueType log(ValueType const& number) {
return std::log(number);
@ -886,6 +892,7 @@ namespace storm {
template double abs(double const& number);
template double floor(double const& number);
template double ceil(double const& number);
template double round(double const& number);
template double log(double const& number);
template double log10(double const& number);
template typename NumberTraits<double>::IntegerType trunc(double const& number);
@ -918,6 +925,7 @@ namespace storm {
template float abs(float const& number);
template float floor(float const& number);
template float ceil(float const& number);
template float round(float const& number);
template float log(float const& number);
template std::string to_string(float const& value);
@ -974,6 +982,7 @@ namespace storm {
template storm::ClnRationalNumber maximum(std::vector<storm::ClnRationalNumber> const&);
template storm::ClnRationalNumber max(storm::ClnRationalNumber const& first, storm::ClnRationalNumber const& second);
template storm::ClnRationalNumber min(storm::ClnRationalNumber const& first, storm::ClnRationalNumber const& second);
template storm::ClnRationalNumber round(storm::ClnRationalNumber const& number);
template std::string to_string(storm::ClnRationalNumber const& value);
#endif
@ -998,6 +1007,7 @@ namespace storm {
template storm::GmpRationalNumber maximum(std::vector<storm::GmpRationalNumber> const&);
template storm::GmpRationalNumber max(storm::GmpRationalNumber const& first, storm::GmpRationalNumber const& second);
template storm::GmpRationalNumber min(storm::GmpRationalNumber const& first, storm::GmpRationalNumber const& second);
template storm::GmpRationalNumber round(storm::GmpRationalNumber const& number);
template std::string to_string(storm::GmpRationalNumber const& value);
#endif

3
src/storm/utility/constants.h

@ -155,6 +155,9 @@ namespace storm {
template<typename ValueType>
ValueType ceil(ValueType const& number);
template<typename ValueType>
ValueType round(ValueType const& number);
template<typename ValueType>
ValueType log(ValueType const& number);

6
src/storm/utility/vector.h

@ -1,16 +1,12 @@
#ifndef STORM_UTILITY_VECTOR_H_
#define STORM_UTILITY_VECTOR_H_
#include "storm-config.h"
#ifdef STORM_HAVE_INTELTBB
#include "tbb/tbb.h"
#endif
#include <iostream>
#include <algorithm>
#include <functional>
#include <numeric>
#include <storm/adapters/RationalFunctionAdapter.h>
#include <storm/adapters/IntelTbbAdapter.h>
#include <boost/optional.hpp>

8
travis/build_carl_helper.sh

@ -13,17 +13,19 @@ travis_fold() {
run() {
travis_fold start install_dependencies
apt-get update
apt-get install -qq -y openjdk-8-jdk maven uuid-dev pkg-config
#apt-get install -qq -y openjdk-8-jdk maven uuid-dev pkg-config
apt-get install -qq -y uuid-dev pkg-config
travis_fold end install_dependencies
travis_fold start install_carl
git clone https://github.com/smtrat/carl.git
cd carl
git checkout 18.08
git checkout master14
mkdir build
cd build
cmake .. "${CMAKE_ARGS[@]}"
make lib_carl addons -j$N_JOBS
#make lib_carl addons -j$N_JOBS
make lib_carl -j$N_JOBS
travis_fold end install_carl
}

10
travis/generate_travis.py

@ -3,12 +3,14 @@
# Configuration for Linux
configs_linux = [
# OS, compiler, build type
("debian-9", "gcc", "DefaultDebug"),
("debian-9", "gcc", "DefaultRelease"),
("ubuntu-18.04", "gcc", "DefaultDebugTravis"),
("ubuntu-18.04", "gcc", "DefaultReleaseTravis"),
("ubuntu-18.04", "gcc", "DefaultDebug"),
("ubuntu-18.04", "gcc", "DefaultRelease"),
("debian-9", "gcc", "DefaultDebug"),
("debian-9", "gcc", "DefaultRelease"),
("ubuntu-18.10", "gcc", "DefaultDebug"),
("ubuntu-18.10", "gcc", "DefaultRelease"),
("ubuntu-19.04", "gcc", "DefaultDebugTravis"),
("ubuntu-19.04", "gcc", "DefaultReleaseTravis"),
]
# Configurations for Mac

Loading…
Cancel
Save