Browse Source
added abstraction settings and menu game abstractor
added abstraction settings and menu game abstractor
Former-commit-id: 4cac25ac94
tempestpy_adaptions
dehnert
8 years ago
8 changed files with 115 additions and 5 deletions
-
1src/abstraction/MenuGameAbstractor.cpp
-
27src/abstraction/prism/PrismMenuGameAbstractor.cpp
-
26src/abstraction/prism/PrismMenuGameAbstractor.h
-
5src/modelchecker/abstraction/GameBasedMdpModelChecker.cpp
-
2src/settings/SettingsManager.cpp
-
23src/settings/modules/AbstractionSettings.cpp
-
34src/settings/modules/AbstractionSettings.h
-
2src/utility/storm.h
@ -1 +0,0 @@ |
|||
#include "src/abstraction/MenuGameAbstractor.h"
|
@ -0,0 +1,27 @@ |
|||
#include "src/abstraction/prism/PrismMenuGameAbstractor.h"
|
|||
|
|||
#include "src/settings/SettingsManager.h"
|
|||
#include "src/settings/modules/AbstractionSettings.h"
|
|||
|
|||
namespace storm { |
|||
namespace abstraction { |
|||
namespace prism { |
|||
|
|||
template <storm::dd::DdType DdType, typename ValueType> |
|||
PrismMenuGameAbstractor<DdType, ValueType>::PrismMenuGameAbstractor(storm::expressions::ExpressionManager& expressionManager, storm::prism::Program const& program, std::vector<storm::expressions::Expression> const& initialPredicates, std::unique_ptr<storm::utility::solver::SmtSolverFactory>&& smtSolverFactory) : abstractProgram(expressionManager, program, initialPredicates, std::move(smtSolverFactory), storm::settings::getModule<storm::settings::modules::AbstractionSettings>().isAddAllGuardsSet()) { |
|||
// Intentionally left empty.
|
|||
} |
|||
|
|||
template <storm::dd::DdType DdType, typename ValueType> |
|||
storm::abstraction::MenuGame<DdType, ValueType> PrismMenuGameAbstractor<DdType, ValueType>::abstract() { |
|||
return abstractProgram.getAbstractGame(); |
|||
} |
|||
|
|||
template <storm::dd::DdType DdType, typename ValueType> |
|||
void PrismMenuGameAbstractor<DdType, ValueType>::refine(std::vector<storm::expressions::Expression> const& predicates) { |
|||
abstractProgram.refine(predicates); |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
#pragma once |
|||
|
|||
#include "src/abstraction/MenuGameAbstractor.h" |
|||
|
|||
#include "src/abstraction/prism/AbstractProgram.h" |
|||
|
|||
namespace storm { |
|||
namespace abstraction { |
|||
namespace prism { |
|||
|
|||
template <storm::dd::DdType DdType, typename ValueType> |
|||
class PrismMenuGameAbstractor : public MenuGameAbstractor<DdType, ValueType> { |
|||
public: |
|||
PrismMenuGameAbstractor(storm::expressions::ExpressionManager& expressionManager, storm::prism::Program const& program, std::vector<storm::expressions::Expression> const& initialPredicates, std::unique_ptr<storm::utility::solver::SmtSolverFactory>&& smtSolverFactory = std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>()); |
|||
|
|||
virtual storm::abstraction::MenuGame<DdType, ValueType> abstract() override; |
|||
virtual void refine(std::vector<storm::expressions::Expression> const& predicates) override; |
|||
|
|||
private: |
|||
/// The abstract program that performs the actual abstraction. |
|||
AbstractProgram<DdType, ValueType> abstractProgram; |
|||
}; |
|||
|
|||
} |
|||
} |
|||
} |
@ -0,0 +1,23 @@ |
|||
#include "src/settings/modules/AbstractionSettings.h"
|
|||
|
|||
#include "src/settings/Option.h"
|
|||
#include "src/settings/OptionBuilder.h"
|
|||
|
|||
namespace storm { |
|||
namespace settings { |
|||
namespace modules { |
|||
|
|||
const std::string AbstractionSettings::moduleName = "abstraction"; |
|||
const std::string AbstractionSettings::addAllGuardsOptionName = "allguards"; |
|||
|
|||
AbstractionSettings::AbstractionSettings() : ModuleSettings(moduleName) { |
|||
this->addOption(storm::settings::OptionBuilder(moduleName, addAllGuardsOptionName, true, "Sets whether all guards are added as initial predicates.").build()); |
|||
} |
|||
|
|||
bool AbstractionSettings::isAddAllGuardsSet() const { |
|||
return this->getOption(addAllGuardsOptionName).getHasOptionBeenSet(); |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
@ -0,0 +1,34 @@ |
|||
#pragma once |
|||
|
|||
#include "src/settings/modules/ModuleSettings.h" |
|||
|
|||
namespace storm { |
|||
namespace settings { |
|||
namespace modules { |
|||
|
|||
/*! |
|||
* This class represents the settings for the abstraction procedures. |
|||
*/ |
|||
class AbstractionSettings : public ModuleSettings { |
|||
public: |
|||
/*! |
|||
* Creates a new set of abstraction settings. |
|||
*/ |
|||
AbstractionSettings(); |
|||
|
|||
/*! |
|||
* Retrieves whether the option to add all guards was set. |
|||
* |
|||
* @return True iff the option was set. |
|||
*/ |
|||
bool isAddAllGuardsSet() const; |
|||
|
|||
const static std::string moduleName; |
|||
|
|||
private: |
|||
const static std::string addAllGuardsOptionName; |
|||
}; |
|||
|
|||
} |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue