Browse Source
Merge branch 'jani_support' into export_explicit
Merge branch 'jani_support' into export_explicit
Former-commit-id:tempestpy_adaptions4a5dc499e8
[formerly7dca599712
] Former-commit-id:65c17bb14e
sjunges
8 years ago
49 changed files with 1433 additions and 328 deletions
-
2resources/3rdparty/CMakeLists.txt
-
206resources/cmake/find_modules/FindHwloc.cmake
-
8src/builder/DdJaniModelBuilder.cpp
-
59src/cli/cli.cpp
-
144src/cli/entrypoints.h
-
2src/generator/JaniNextStateGenerator.cpp
-
36src/generator/VariableInformation.cpp
-
41src/modelchecker/results/ExplicitQualitativeCheckResult.cpp
-
6src/modelchecker/results/ExplicitQualitativeCheckResult.h
-
59src/modelchecker/results/ExplicitQuantitativeCheckResult.cpp
-
6src/modelchecker/results/ExplicitQuantitativeCheckResult.h
-
32src/modelchecker/results/FilterType.cpp
-
14src/modelchecker/results/FilterType.h
-
14src/modelchecker/results/HybridQuantitativeCheckResult.cpp
-
9src/modelchecker/results/HybridQuantitativeCheckResult.h
-
4src/modelchecker/results/QualitativeCheckResult.h
-
12src/modelchecker/results/QuantitativeCheckResult.h
-
17src/modelchecker/results/SymbolicQualitativeCheckResult.cpp
-
6src/modelchecker/results/SymbolicQualitativeCheckResult.h
-
12src/modelchecker/results/SymbolicQuantitativeCheckResult.cpp
-
7src/modelchecker/results/SymbolicQuantitativeCheckResult.h
-
23src/parser/CSVParser.cpp
-
12src/parser/CSVParser.h
-
288src/parser/JaniParser.cpp
-
25src/parser/JaniParser.h
-
32src/parser/KeyValueParser.cpp
-
11src/parser/KeyValueParser.h
-
16src/settings/modules/IOSettings.cpp
-
6src/settings/modules/IOSettings.h
-
5src/storage/jani/BooleanVariable.cpp
-
2src/storage/jani/BooleanVariable.h
-
9src/storage/jani/BoundedIntegerVariable.cpp
-
4src/storage/jani/BoundedIntegerVariable.h
-
348src/storage/jani/JSONExporter.cpp
-
39src/storage/jani/JSONExporter.h
-
28src/storage/jani/Property.cpp
-
66src/storage/jani/Property.h
-
2src/storage/jani/RealVariable.cpp
-
2src/storage/jani/RealVariable.h
-
2src/storage/jani/UnboundedIntegerVariable.cpp
-
2src/storage/jani/Variable.cpp
-
2src/storage/jani/Variable.h
-
2src/storage/ppg/defines.h
-
4src/storage/prism/Module.cpp
-
6src/storage/prism/ToJaniConverter.cpp
-
95src/utility/constants.cpp
-
16src/utility/constants.h
-
15src/utility/storm.cpp
-
3src/utility/storm.h
@ -1,179 +1,55 @@ |
|||
# FindHwloc |
|||
# ---------- |
|||
# Try to find hwloc libraries and headers. |
|||
# |
|||
# Try to find Portable Hardware Locality (hwloc) libraries. |
|||
# http://www.open-mpi.org/software/hwloc |
|||
# Usage of this module: |
|||
# |
|||
# You may declare HWLOC_ROOT environment variable to tell where |
|||
# your hwloc library is installed. |
|||
# find_package(hwloc) |
|||
# |
|||
# Once done this will define:: |
|||
# Variables defined by this module: |
|||
# |
|||
# Hwloc_FOUND - True if hwloc was found |
|||
# Hwloc_INCLUDE_DIRS - include directories for hwloc |
|||
# Hwloc_LIBRARIES - link against these libraries to use hwloc |
|||
# Hwloc_VERSION - version |
|||
# Hwloc_CFLAGS - include directories as compiler flags |
|||
# Hwloc_LDLFAGS - link paths and libs as compiler flags |
|||
# |
|||
|
|||
#============================================================================= |
|||
# Copyright 2014 Mikael Lepistö |
|||
# |
|||
# Distributed under the OSI-approved BSD License (the "License"); |
|||
# |
|||
# This software is distributed WITHOUT ANY WARRANTY; without even the |
|||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|||
# See the License for more information. |
|||
#============================================================================= |
|||
|
|||
if(WIN32) |
|||
find_path(Hwloc_INCLUDE_DIR |
|||
NAMES |
|||
hwloc.h |
|||
PATHS |
|||
ENV "PROGRAMFILES(X86)" |
|||
ENV HWLOC_ROOT |
|||
PATH_SUFFIXES |
|||
include |
|||
) |
|||
|
|||
find_library(Hwloc_LIBRARY |
|||
NAMES |
|||
libhwloc.lib |
|||
PATHS |
|||
ENV "PROGRAMFILES(X86)" |
|||
ENV HWLOC_ROOT |
|||
PATH_SUFFIXES |
|||
lib |
|||
) |
|||
|
|||
# |
|||
# Check if the found library can be used to linking |
|||
# |
|||
SET (_TEST_SOURCE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/linktest.c") |
|||
FILE (WRITE "${_TEST_SOURCE}" |
|||
" |
|||
#include <hwloc.h> |
|||
int main() |
|||
{ |
|||
hwloc_topology_t topology; |
|||
int nbcores; |
|||
hwloc_topology_init(&topology); |
|||
hwloc_topology_load(topology); |
|||
nbcores = hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_CORE); |
|||
hwloc_topology_destroy(topology); |
|||
return 0; |
|||
} |
|||
" |
|||
) |
|||
|
|||
TRY_COMPILE(_LINK_SUCCESS ${CMAKE_BINARY_DIR} "${_TEST_SOURCE}" |
|||
CMAKE_FLAGS |
|||
"-DINCLUDE_DIRECTORIES:STRING=${Hwloc_INCLUDE_DIR}" |
|||
CMAKE_FLAGS |
|||
"-DLINK_LIBRARIES:STRING=${Hwloc_LIBRARY}" |
|||
) |
|||
|
|||
IF(NOT _LINK_SUCCESS) |
|||
if(CMAKE_SIZEOF_VOID_P EQUAL 8) |
|||
message(STATUS "You are building 64bit target.") |
|||
ELSE() |
|||
message(STATUS "You are building 32bit code. If you like to build x64 use e.g. -G 'Visual Studio 12 Win64' generator." ) |
|||
ENDIF() |
|||
message(FATAL_ERROR "Library found, but linking test program failed.") |
|||
ENDIF() |
|||
|
|||
# |
|||
# Resolve version if some compiled binary found... |
|||
# |
|||
find_program(HWLOC_INFO_EXECUTABLE |
|||
NAMES |
|||
hwloc-info |
|||
PATHS |
|||
ENV HWLOC_ROOT |
|||
PATH_SUFFIXES |
|||
bin |
|||
) |
|||
|
|||
if(HWLOC_INFO_EXECUTABLE) |
|||
execute_process( |
|||
COMMAND ${HWLOC_INFO_EXECUTABLE} "--version" |
|||
OUTPUT_VARIABLE HWLOC_VERSION_LINE |
|||
OUTPUT_STRIP_TRAILING_WHITESPACE |
|||
) |
|||
string(REGEX MATCH "([0-9]+.[0-9]+)$" |
|||
Hwloc_VERSION "${HWLOC_VERSION_LINE}") |
|||
unset(HWLOC_VERSION_LINE) |
|||
endif() |
|||
|
|||
# |
|||
# All good |
|||
# |
|||
|
|||
set(Hwloc_LIBRARIES ${Hwloc_LIBRARY}) |
|||
set(Hwloc_INCLUDE_DIRS ${Hwloc_INCLUDE_DIR}) |
|||
|
|||
include(FindPackageHandleStandardArgs) |
|||
find_package_handle_standard_args( |
|||
Hwloc |
|||
FOUND_VAR Hwloc_FOUND |
|||
REQUIRED_VARS Hwloc_LIBRARY Hwloc_INCLUDE_DIR |
|||
VERSION_VAR Hwloc_VERSION) |
|||
|
|||
mark_as_advanced( |
|||
Hwloc_INCLUDE_DIR |
|||
Hwloc_LIBRARY) |
|||
|
|||
foreach(arg ${Hwloc_INCLUDE_DIRS}) |
|||
set(Hwloc_CFLAGS "${Hwloc_CFLAGS} /I${arg}") |
|||
endforeach() |
|||
# HWLOC_FOUND System has hwloc libraries and headers |
|||
# HWLOC_LIBRARIES The hwloc library |
|||
# HWLOC_INCLUDE_DIRS The location of HWLOC headers |
|||
|
|||
set(Hwloc_LDFLAGS "${Hwloc_LIBRARY}") |
|||
find_path( |
|||
HWLOC_PREFIX |
|||
NAMES include/hwloc.h |
|||
) |
|||
|
|||
else() |
|||
if (NOT HWLOC_PREFIX AND NOT $ENV{HWLOC_BASE} STREQUAL "") |
|||
set(HWLOC_PREFIX $ENV{HWLOC_BASE}) |
|||
endif() |
|||
|
|||
# Find with pkgconfig |
|||
find_package(PkgConfig) |
|||
message(STATUS "Searching for hwloc library in path " ${HWLOC_PREFIX}) |
|||
|
|||
if(HWLOC_ROOT) |
|||
set(ENV{PKG_CONFIG_PATH} "${HWLOC_ROOT}/lib/pkgconfig") |
|||
else() |
|||
foreach(PREFIX ${CMAKE_PREFIX_PATH}) |
|||
set(PKG_CONFIG_PATH "${PKG_CONFIG_PATH}:${PREFIX}/lib/pkgconfig") |
|||
endforeach() |
|||
set(ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}") |
|||
endif() |
|||
find_library( |
|||
HWLOC_LIBRARIES |
|||
NAMES hwloc |
|||
HINTS ${HWLOC_PREFIX}/lib |
|||
) |
|||
|
|||
if(hwloc_FIND_REQUIRED) |
|||
set(_hwloc_OPTS "REQUIRED") |
|||
elseif(hwloc_FIND_QUIETLY) |
|||
set(_hwloc_OPTS "QUIET") |
|||
else() |
|||
set(_hwloc_output 1) |
|||
endif() |
|||
find_path( |
|||
HWLOC_INCLUDE_DIRS |
|||
NAMES hwloc.h |
|||
HINTS ${HWLOC_PREFIX}/include |
|||
) |
|||
|
|||
if(hwloc_FIND_VERSION) |
|||
if(hwloc_FIND_VERSION_EXACT) |
|||
pkg_check_modules(Hwloc ${_hwloc_OPTS} hwloc=${hwloc_FIND_VERSION}) |
|||
else() |
|||
pkg_check_modules(Hwloc ${_hwloc_OPTS} hwloc>=${hwloc_FIND_VERSION}) |
|||
endif() |
|||
else() |
|||
pkg_check_modules(Hwloc ${_hwloc_OPTS} hwloc) |
|||
endif() |
|||
include(FindPackageHandleStandardArgs) |
|||
|
|||
if(Hwloc_FOUND) |
|||
include(FindPackageHandleStandardArgs) |
|||
find_package_handle_standard_args(Hwloc DEFAULT_MSG Hwloc_LIBRARIES) |
|||
find_package_handle_standard_args( |
|||
HWLOC DEFAULT_MSG |
|||
HWLOC_LIBRARIES |
|||
HWLOC_INCLUDE_DIRS |
|||
) |
|||
|
|||
if(NOT ${Hwloc_VERSION} VERSION_LESS 1.7.0) |
|||
set(Hwloc_GL_FOUND 1) |
|||
endif() |
|||
mark_as_advanced( |
|||
HWLOC_LIBRARIES |
|||
HWLOC_INCLUDE_DIRS |
|||
) |
|||
|
|||
if(_hwloc_output) |
|||
message(STATUS |
|||
"Found hwloc ${Hwloc_VERSION} in ${Hwloc_INCLUDE_DIRS}:${Hwloc_LIBRARIES}") |
|||
endif() |
|||
if (HWLOC_FOUND) |
|||
if (NOT $ENV{HWLOC_LIB} STREQUAL "") |
|||
# set(HWLOC_LIBRARIES "$ENV{HWLOC_LIB}") |
|||
endif() |
|||
endif() |
|||
message(STATUS "hwloc includes: " ${HWLOC_INCLUDE_DIRS}) |
|||
message(STATUS "hwloc libraries: " ${HWLOC_LIBRARIES}) |
|||
endif() |
@ -0,0 +1,32 @@ |
|||
#include "FilterType.h"
|
|||
|
|||
|
|||
namespace storm { |
|||
namespace modelchecker { |
|||
|
|||
std::string toString(FilterType ft) { |
|||
switch(ft) { |
|||
case FilterType::ARGMAX: |
|||
return "the argmax"; |
|||
case FilterType::ARGMIN: |
|||
return "the argmin"; |
|||
case FilterType::AVG: |
|||
return "the average"; |
|||
case FilterType::COUNT: |
|||
return "the number of"; |
|||
case FilterType::EXISTS: |
|||
return "whether there exists a state in"; |
|||
case FilterType::FORALL: |
|||
return "whether for all states in"; |
|||
case FilterType::MAX: |
|||
return "the maximum"; |
|||
case FilterType::MIN: |
|||
return "the minumum"; |
|||
case FilterType::SUM: |
|||
return "the sum"; |
|||
case FilterType::VALUES: |
|||
return "the values"; |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,14 @@ |
|||
#pragma once |
|||
#include <string> |
|||
|
|||
namespace storm { |
|||
namespace modelchecker { |
|||
|
|||
enum class StateFilter { ARGMIN, ARGMAX }; |
|||
|
|||
enum class FilterType { MIN, MAX, SUM, AVG, COUNT, FORALL, EXISTS, ARGMIN, ARGMAX, VALUES }; |
|||
|
|||
std::string toString(FilterType); |
|||
bool isStateFilter(FilterType); |
|||
} |
|||
} |
@ -0,0 +1,23 @@ |
|||
#include "src/parser/CSVParser.h"
|
|||
#include <boost/any.hpp>
|
|||
|
|||
#include <boost/algorithm/string.hpp>
|
|||
#include "src/utility/macros.h"
|
|||
#include "src/exceptions/InvalidArgumentException.h"
|
|||
|
|||
|
|||
namespace storm { |
|||
namespace parser { |
|||
|
|||
std::vector<std::string> parseCommaSeperatedValues(std::string const& input) { |
|||
std::vector<std::string> values; |
|||
std::vector<std::string> definitions; |
|||
boost::split(definitions, input, boost::is_any_of(",")); |
|||
for (auto& definition : definitions) { |
|||
boost::trim(definition); |
|||
values.push_back(definition); |
|||
} |
|||
return values; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
#include <vector> |
|||
#include <string> |
|||
|
|||
namespace storm { |
|||
namespace parser { |
|||
/** |
|||
* Given a string seperated by commas, returns the values. |
|||
*/ |
|||
std::vector<std::string> parseCommaSeperatedValues(std::string const& input); |
|||
|
|||
} |
|||
} |
@ -0,0 +1,32 @@ |
|||
#include "KeyValueParser.h"
|
|||
#include <boost/algorithm/string.hpp>
|
|||
#include <vector>
|
|||
|
|||
#include "src/utility/macros.h"
|
|||
#include "src/exceptions/InvalidArgumentException.h"
|
|||
|
|||
namespace storm { |
|||
namespace parser { |
|||
|
|||
std::unordered_map<std::string, std::string> parseKeyValueString(std::string const& keyValueString) { |
|||
std::unordered_map<std::string, std::string> keyValueMap; |
|||
std::vector<std::string> definitions; |
|||
boost::split(definitions, keyValueString, boost::is_any_of(",")); |
|||
for (auto& definition : definitions) { |
|||
boost::trim(definition); |
|||
|
|||
// Check whether the token could be a legal constant definition.
|
|||
std::size_t positionOfAssignmentOperator = definition.find('='); |
|||
STORM_LOG_THROW(positionOfAssignmentOperator != std::string::npos, storm::exceptions::InvalidArgumentException, "Illegal key value string: syntax error."); |
|||
|
|||
// Now extract the variable name and the value from the string.
|
|||
std::string key = definition.substr(0, positionOfAssignmentOperator); |
|||
boost::trim(key); |
|||
std::string value = definition.substr(positionOfAssignmentOperator + 1); |
|||
boost::trim(value); |
|||
keyValueMap.emplace(key, value); |
|||
} |
|||
return keyValueMap; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,11 @@ |
|||
#pragma once |
|||
|
|||
#include <string> |
|||
#include <unordered_map> |
|||
|
|||
|
|||
namespace storm { |
|||
namespace parser { |
|||
std::unordered_map<std::string, std::string> parseKeyValueString(std::string const& keyValueString); |
|||
} |
|||
} |
@ -1,6 +1,8 @@ |
|||
#pragma once |
|||
#include <cassert> |
|||
#include <vector> |
|||
#include <cstdint> |
|||
|
|||
namespace storm { |
|||
namespace ppg { |
|||
class ProgramGraph; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue