Browse Source

some fixes (in particular for warnings)

tempestpy_adaptions
dehnert 7 years ago
parent
commit
1169195be7
  1. 28
      src/storm/abstraction/MenuGameRefiner.cpp
  2. 2
      src/storm/builder/DdJaniModelBuilder.cpp
  3. 2
      src/storm/modelchecker/exploration/SparseExplorationModelChecker.cpp
  4. 2
      src/storm/solver/stateelimination/DynamicStatePriorityQueue.h
  5. 2
      src/storm/storage/bisimulation/DeterministicModelBisimulationDecomposition.cpp
  6. 2
      src/storm/storage/bisimulation/NondeterministicModelBisimulationDecomposition.cpp
  7. 2
      src/storm/storage/jani/ParallelComposition.cpp
  8. 2
      src/storm/storage/jani/ParallelComposition.h

28
src/storm/abstraction/MenuGameRefiner.cpp

@ -639,6 +639,7 @@ namespace storm {
}
predicates.back().push_back(initialExpression.changeManager(expressionManager).substitute(lastSubstitution));
return std::make_pair(predicates, stepVariableToCopiedVariableMap);
}
@ -649,11 +650,13 @@ namespace storm {
boost::optional<RefinementPredicates> predicates;
// Create solver and interpolation groups.
auto assertionStart = std::chrono::high_resolution_clock::now();
storm::solver::MathsatSmtSolver interpolatingSolver(interpolationManager, storm::solver::MathsatSmtSolver::Options(true, false, true));
uint64_t stepCounter = 0;
auto traceIt = trace.rbegin();
auto traceIte = trace.rend();
for (; traceIt != traceIte; ++traceIt) {
auto iterationStart = std::chrono::high_resolution_clock::now();
auto const& step = *traceIt;
interpolatingSolver.push();
@ -661,15 +664,13 @@ namespace storm {
for (auto const& predicate : step) {
interpolatingSolver.add(predicate);
}
storm::solver::SmtSolver::CheckResult result = interpolatingSolver.check();
// If the result already became unsatisfiable
if (result == storm::solver::SmtSolver::CheckResult::Unsat) {
STORM_LOG_TRACE("Trace formula became unsatisfiable after step " << stepCounter << ".");
break;
}
auto iterationEnd = std::chrono::high_resolution_clock::now();
STORM_LOG_TRACE("Asserting step of trace formula took " << std::chrono::duration_cast<std::chrono::milliseconds>(iterationEnd - iterationStart).count() << "ms.");
++stepCounter;
}
auto assertionEnd = std::chrono::high_resolution_clock::now();
STORM_LOG_TRACE("Asserting trace formula until unsatisfiability took " << std::chrono::duration_cast<std::chrono::milliseconds>(assertionEnd - assertionStart).count() << "ms.");
// Now encode the trace as an SMT problem.
storm::solver::SmtSolver::CheckResult result = interpolatingSolver.check();
@ -691,7 +692,12 @@ namespace storm {
STORM_LOG_TRACE("Trace formula is satisfiable, not using interpolation.");
}
auto end = std::chrono::high_resolution_clock::now();
if (predicates) {
STORM_LOG_TRACE("Deriving predicates using interpolation from witness of size " << trace.size() << " took " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms.");
} else {
STORM_LOG_TRACE("Tried deriving predicates using interpolation but failed in " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms.");
}
return predicates;
}
@ -712,7 +718,10 @@ namespace storm {
std::shared_ptr<storm::expressions::ExpressionManager> interpolationManager = abstractionInformation.getExpressionManager().clone();
// Build the trace of the most probable path in terms of which predicates hold in each step.
auto start = std::chrono::high_resolution_clock::now();
std::pair<std::vector<std::vector<storm::expressions::Expression>>, std::map<storm::expressions::Variable, storm::expressions::Expression>> traceAndVariableSubstitution = buildTrace(*interpolationManager, game, symbolicMostProbablePathsResult.spanningTree, symbolicPivotStateResult.pivotState);
auto end = std::chrono::high_resolution_clock::now();
STORM_LOG_DEBUG("Building the trace and variable substitution for interpolation from symbolic most-probable paths result took " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms.");
return storm::abstraction::derivePredicatesFromInterpolation(*interpolationManager, abstractionInformation, traceAndVariableSubstitution.first, traceAndVariableSubstitution.second);
}
@ -725,7 +734,10 @@ namespace storm {
std::shared_ptr<storm::expressions::ExpressionManager> interpolationManager = abstractionInformation.getExpressionManager().clone();
// Build the trace of the most probable path in terms of which predicates hold in each step.
auto start = std::chrono::high_resolution_clock::now();
std::pair<std::vector<std::vector<storm::expressions::Expression>>, std::map<storm::expressions::Variable, storm::expressions::Expression>> traceAndVariableSubstitution = buildTrace(*interpolationManager, game, pivotStateResult, odd);
auto end = std::chrono::high_resolution_clock::now();
STORM_LOG_DEBUG("Building the trace and variable substitution for interpolation from explicit most-probable paths result took " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms.");
return storm::abstraction::derivePredicatesFromInterpolation(*interpolationManager, abstractionInformation, traceAndVariableSubstitution.first, traceAndVariableSubstitution.second);
}
@ -857,8 +869,6 @@ namespace storm {
ValueType pivotStateDeviation = storm::utility::zero<ValueType>();
auto const& player2Grouping = transitionMatrix.getRowGroupIndices();
uint64_t pivotStates = 0;
while (!dijkstraQueue.empty()) {
auto distanceStatePair = *dijkstraQueue.begin();
uint64_t currentState = distanceStatePair.second;
@ -961,8 +971,6 @@ namespace storm {
}
}
std::cout << "found " << pivotStates << " pivots" << std::endl;
if (foundPivotState) {
return result;
}

2
src/storm/builder/DdJaniModelBuilder.cpp

@ -1275,7 +1275,7 @@ namespace storm {
// Finally treat the transient assignments.
std::map<storm::expressions::Variable, storm::dd::Add<Type, ValueType>> transientEdgeAssignments;
if (!this->transientVariables.empty()) {
performTransientAssignments(edge.getAssignments().getTransientAssignments(), [this, &transientEdgeAssignments, &guard, &sourceLocationAndGuard] (storm::jani::Assignment const& assignment) {
performTransientAssignments(edge.getAssignments().getTransientAssignments(), [this, &transientEdgeAssignments, &sourceLocationAndGuard] (storm::jani::Assignment const& assignment) {
transientEdgeAssignments[assignment.getExpressionVariable()] = sourceLocationAndGuard * this->variables.rowExpressionAdapter->translateExpression(assignment.getAssignedExpression());
} );
}

2
src/storm/modelchecker/exploration/SparseExplorationModelChecker.cpp

@ -341,7 +341,7 @@ namespace storm {
});
} else if (explorationInformation.useProbabilityHeuristic()) {
std::transform(row.begin(), row.end(), probabilities.begin(),
[&bounds, &explorationInformation] (storm::storage::MatrixEntry<StateType, ValueType> const& entry) {
[] (storm::storage::MatrixEntry<StateType, ValueType> const& entry) {
return entry.getValue();
});
}

2
src/storm/solver/stateelimination/DynamicStatePriorityQueue.h

@ -17,7 +17,7 @@ namespace storm {
namespace stateelimination {
struct PriorityComparator {
bool operator()(std::pair<storm::storage::sparse::state_type, uint_fast64_t> const& first, std::pair<storm::storage::sparse::state_type, uint_fast64_t> const& second) {
bool operator()(std::pair<storm::storage::sparse::state_type, uint_fast64_t> const& first, std::pair<storm::storage::sparse::state_type, uint_fast64_t> const& second) const {
return (first.second < second.second) || (first.second == second.second && first.first < second.first) ;
}
};

2
src/storm/storage/bisimulation/DeterministicModelBisimulationDecomposition.cpp

@ -419,7 +419,7 @@ namespace storm {
// the sorting is over. Otherwise, this interferes with the data used in the sorting process.
storm::storage::sparse::state_type originalBlockIndex = block.getBeginIndex();
auto split = this->partition.splitBlock(block,
[&weakStateLabels,&block,originalBlockIndex,this] (storm::storage::sparse::state_type state1, storm::storage::sparse::state_type state2) {
[&weakStateLabels,originalBlockIndex,this] (storm::storage::sparse::state_type state1, storm::storage::sparse::state_type state2) {
return weakStateLabels[this->partition.getPosition(state1) - originalBlockIndex] < weakStateLabels[this->partition.getPosition(state2) - originalBlockIndex];
},
[this, &splitterQueue, &block] (bisimulation::Block<BlockDataType>& newBlock) {

2
src/storm/storage/bisimulation/NondeterministicModelBisimulationDecomposition.cpp

@ -367,7 +367,7 @@ namespace storm {
bool result = quotientDistributionsLess(state1, state2);
return result;
},
[this, &block, &splitterQueue, &newBlocks] (Block<BlockDataType>& newBlock) {
[&newBlocks] (Block<BlockDataType>& newBlock) {
newBlocks.push_back(&newBlock);
});

2
src/storm/storage/jani/ParallelComposition.cpp

@ -116,7 +116,7 @@ namespace storm {
return !(vector1 == vector2);
}
bool SynchronizationVectorLexicographicalLess::operator()(SynchronizationVector const& vector1, SynchronizationVector const& vector2) {
bool SynchronizationVectorLexicographicalLess::operator()(SynchronizationVector const& vector1, SynchronizationVector const& vector2) const {
STORM_LOG_THROW(vector1.size() == vector2.size(), storm::exceptions::WrongFormatException, "Cannot compare synchronization vectors of different size.");
for (uint64_t i = 0; i < vector1.size(); ++i) {
if (vector1.getInput(i) < vector2.getInput(i)) {

2
src/storm/storage/jani/ParallelComposition.h

@ -62,7 +62,7 @@ namespace storm {
bool operator!=(SynchronizationVector const& vector1, SynchronizationVector const& vector2);
struct SynchronizationVectorLexicographicalLess {
bool operator()(SynchronizationVector const& vector1, SynchronizationVector const& vector2);
bool operator()(SynchronizationVector const& vector1, SynchronizationVector const& vector2) const;
};
std::ostream& operator<<(std::ostream& stream, SynchronizationVector const& synchronizationVector);

Loading…
Cancel
Save