|
@ -18,24 +18,24 @@ namespace storm { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template<typename ValueType> |
|
|
template<typename ValueType> |
|
|
std::map<storm::analysis::Lattice*, std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>>> |
|
|
|
|
|
|
|
|
std::map<storm::analysis::Lattice*, std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>, bool>>> |
|
|
AssumptionMaker<ValueType>::makeAssumptions(storm::analysis::Lattice *lattice, uint_fast64_t critical1, |
|
|
AssumptionMaker<ValueType>::makeAssumptions(storm::analysis::Lattice *lattice, uint_fast64_t critical1, |
|
|
uint_fast64_t critical2) { |
|
|
uint_fast64_t critical2) { |
|
|
std::map<storm::analysis::Lattice*, std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>>> result; |
|
|
|
|
|
|
|
|
std::map<storm::analysis::Lattice*, std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>, bool>>> result; |
|
|
|
|
|
|
|
|
std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>> emptySet; |
|
|
|
|
|
|
|
|
std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>, bool>> emptySet; |
|
|
if (critical1 == numberOfStates || critical2 == numberOfStates) { |
|
|
if (critical1 == numberOfStates || critical2 == numberOfStates) { |
|
|
result.insert(std::pair<storm::analysis::Lattice*, std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>>>(lattice, emptySet)); |
|
|
|
|
|
|
|
|
result.insert(std::pair<storm::analysis::Lattice*, std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>, bool>>>(lattice, emptySet)); |
|
|
} else { |
|
|
} else { |
|
|
storm::expressions::Variable var1 = expressionManager->getVariable(std::to_string(critical1)); |
|
|
storm::expressions::Variable var1 = expressionManager->getVariable(std::to_string(critical1)); |
|
|
storm::expressions::Variable var2 = expressionManager->getVariable(std::to_string(critical2)); |
|
|
storm::expressions::Variable var2 = expressionManager->getVariable(std::to_string(critical2)); |
|
|
|
|
|
|
|
|
auto latticeCopy = new Lattice(lattice); |
|
|
auto latticeCopy = new Lattice(lattice); |
|
|
std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>> assumptions; |
|
|
|
|
|
|
|
|
std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>, bool>> assumptions; |
|
|
auto myMap = createAssumptions(var1, var2, latticeCopy, assumptions); |
|
|
auto myMap = createAssumptions(var1, var2, latticeCopy, assumptions); |
|
|
result.insert(myMap.begin(), myMap.end()); |
|
|
result.insert(myMap.begin(), myMap.end()); |
|
|
|
|
|
|
|
|
std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>> assumptions2; |
|
|
|
|
|
|
|
|
std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>, bool>> assumptions2; |
|
|
myMap = createAssumptions(var2, var1, lattice, assumptions2); |
|
|
myMap = createAssumptions(var2, var1, lattice, assumptions2); |
|
|
result.insert(myMap.begin(), myMap.end()); |
|
|
result.insert(myMap.begin(), myMap.end()); |
|
|
} |
|
|
} |
|
@ -43,12 +43,17 @@ namespace storm { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template<typename ValueType> |
|
|
template<typename ValueType> |
|
|
std::map<storm::analysis::Lattice*, std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>>> AssumptionMaker<ValueType>::runRecursive(storm::analysis::Lattice* lattice, std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>> assumptions) { |
|
|
|
|
|
std::map<storm::analysis::Lattice*, std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>>> result; |
|
|
|
|
|
std::tuple<storm::analysis::Lattice*, uint_fast64_t, uint_fast64_t> criticalTriple = this->latticeExtender->extendLattice(lattice, assumptions); |
|
|
|
|
|
|
|
|
std::map<storm::analysis::Lattice*, std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>, bool>>> AssumptionMaker<ValueType>::runRecursive(storm::analysis::Lattice* lattice, std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>,bool>> assumptions) { |
|
|
|
|
|
std::map<storm::analysis::Lattice*, std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>,bool>>> result; |
|
|
|
|
|
// only the last assumption is new
|
|
|
|
|
|
std::tuple<storm::analysis::Lattice*, uint_fast64_t, uint_fast64_t> criticalTriple = this->latticeExtender->extendLattice(lattice, assumptions.back().first); |
|
|
|
|
|
|
|
|
|
|
|
if (assumptions.back().second) { |
|
|
|
|
|
assumptions.pop_back(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (std::get<1>(criticalTriple) == numberOfStates) { |
|
|
if (std::get<1>(criticalTriple) == numberOfStates) { |
|
|
result.insert(std::pair<storm::analysis::Lattice*, std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>>>(lattice, assumptions)); |
|
|
|
|
|
|
|
|
result.insert(std::pair<storm::analysis::Lattice*, std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>,bool>>>(lattice, assumptions)); |
|
|
} else { |
|
|
} else { |
|
|
auto val1 = std::get<1>(criticalTriple); |
|
|
auto val1 = std::get<1>(criticalTriple); |
|
|
auto val2 = std::get<2>(criticalTriple); |
|
|
auto val2 = std::get<2>(criticalTriple); |
|
@ -56,7 +61,7 @@ namespace storm { |
|
|
storm::expressions::Variable var2 = expressionManager->getVariable(std::to_string(val2)); |
|
|
storm::expressions::Variable var2 = expressionManager->getVariable(std::to_string(val2)); |
|
|
|
|
|
|
|
|
auto latticeCopy = new Lattice(lattice); |
|
|
auto latticeCopy = new Lattice(lattice); |
|
|
std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>> assumptionsCopy = std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>>( |
|
|
|
|
|
|
|
|
std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>, bool>> assumptionsCopy = std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>, bool>>( |
|
|
assumptions); |
|
|
assumptions); |
|
|
auto myMap = createAssumptions(var1, var2, latticeCopy, assumptionsCopy); |
|
|
auto myMap = createAssumptions(var1, var2, latticeCopy, assumptionsCopy); |
|
|
result.insert(myMap.begin(), myMap.end()); |
|
|
result.insert(myMap.begin(), myMap.end()); |
|
@ -68,15 +73,15 @@ namespace storm { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template <typename ValueType> |
|
|
template <typename ValueType> |
|
|
std::map<storm::analysis::Lattice*, std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>>> AssumptionMaker<ValueType>::createAssumptions(storm::expressions::Variable var1, storm::expressions::Variable var2, storm::analysis::Lattice* lattice, std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>> assumptions) { |
|
|
|
|
|
std::map<storm::analysis::Lattice*, std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>>> result; |
|
|
|
|
|
|
|
|
std::map<storm::analysis::Lattice*, std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>, bool>>> AssumptionMaker<ValueType>::createAssumptions(storm::expressions::Variable var1, storm::expressions::Variable var2, storm::analysis::Lattice* lattice, std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>, bool>> assumptions) { |
|
|
|
|
|
std::map<storm::analysis::Lattice*, std::vector<std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>, bool>>> result; |
|
|
|
|
|
|
|
|
std::shared_ptr<storm::expressions::BinaryRelationExpression> assumption |
|
|
std::shared_ptr<storm::expressions::BinaryRelationExpression> assumption |
|
|
= std::make_shared<storm::expressions::BinaryRelationExpression>(storm::expressions::BinaryRelationExpression(*expressionManager, expressionManager->getBooleanType(), |
|
|
= std::make_shared<storm::expressions::BinaryRelationExpression>(storm::expressions::BinaryRelationExpression(*expressionManager, expressionManager->getBooleanType(), |
|
|
var1.getExpression().getBaseExpressionPointer(), var2.getExpression().getBaseExpressionPointer(), |
|
|
var1.getExpression().getBaseExpressionPointer(), var2.getExpression().getBaseExpressionPointer(), |
|
|
storm::expressions::BinaryRelationExpression::RelationType::GreaterOrEqual)); |
|
|
storm::expressions::BinaryRelationExpression::RelationType::GreaterOrEqual)); |
|
|
if (assumptionChecker->checkOnSamples(assumption)) { |
|
|
if (assumptionChecker->checkOnSamples(assumption)) { |
|
|
assumptions.insert(assumption); |
|
|
|
|
|
|
|
|
assumptions.push_back(std::pair<std::shared_ptr<storm::expressions::BinaryRelationExpression>, bool>(assumption, assumptionChecker->validateAssumption(assumption, lattice))); |
|
|
result = (runRecursive(lattice, assumptions)); |
|
|
result = (runRecursive(lattice, assumptions)); |
|
|
} else { |
|
|
} else { |
|
|
delete lattice; |
|
|
delete lattice; |
|
|