Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code formatting #593

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ e58679da05190fe064ca063b07ac56428162a8fb
634053fe63e39b80fff2355bb4e5b50839cd1e68
a177724097d3f807a6b8950b1cd378c34d040d1b
5016fac7d4014f1113c3d410a65aa5b39a74be64
c0dae886d1e8283a783ab884f64b443e436c106b
11 changes: 5 additions & 6 deletions src/storm-dft/generator/DftNextStateGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ typename DftNextStateGenerator<ValueType, StateType>::DFTStatePointer DftNextSta

if (dependencySuccessful) {
// Dependency was successful -> dependent BE fails
STORM_LOG_TRACE("With the successful triggering of PDEP " << dependency->name() << " [" << dependency->id() << "]"
<< " in " << mDft.getStateString(origState));
STORM_LOG_TRACE("With the successful triggering of PDEP " << dependency->name() << " [" << dependency->id() << "]" << " in "
<< mDft.getStateString(origState));
newState->letDependencyTrigger(dependency, true);
STORM_LOG_ASSERT(dependency->dependentEvents().size() == 1, "Dependency " << dependency->name() << " does not have unique dependent event.");
STORM_LOG_ASSERT(dependency->dependentEvents().front()->isBasicElement(),
Expand All @@ -223,8 +223,8 @@ typename DftNextStateGenerator<ValueType, StateType>::DFTStatePointer DftNextSta
return createSuccessorState(newState, trigger);
} else {
// Dependency was unsuccessful -> no BE fails
STORM_LOG_TRACE("With the unsuccessful triggering of PDEP " << dependency->name() << " [" << dependency->id() << "]"
<< " in " << mDft.getStateString(origState));
STORM_LOG_TRACE("With the unsuccessful triggering of PDEP " << dependency->name() << " [" << dependency->id() << "]" << " in "
<< mDft.getStateString(origState));
newState->letDependencyTrigger(dependency, false);
return newState;
}
Expand All @@ -236,8 +236,7 @@ typename DftNextStateGenerator<ValueType, StateType>::DFTStatePointer DftNextSta
// Construct new state as copy from original one
DFTStatePointer newState = origState->copy();

STORM_LOG_TRACE("With the failure of " << be->name() << " [" << be->id() << "]"
<< " in " << mDft.getStateString(origState));
STORM_LOG_TRACE("With the failure of " << be->name() << " [" << be->id() << "]" << " in " << mDft.getStateString(origState));
newState->letBEFail(be);

// Propagate
Expand Down
6 changes: 2 additions & 4 deletions src/storm-gamebased-ar/abstraction/MenuGameAbstractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ void MenuGameAbstractor<DdType, ValueType>::exportToDot(storm::gbar::abstraction
uint_fast64_t index = abstractionInformation.decodePlayer1Choice(stateValue.first, abstractionInformation.getPlayer1VariableCount());
out << stateName << "_" << index;
out << " [ shape=\"square\", width=0, height=0, margin=0, label=\"" << index << "\" ];\n";
out << "\tpl1_" << stateName << " -> "
<< "pl2_" << stateName << "_" << index << " [ label=\"" << index << "\" ];\n";
out << "\tpl1_" << stateName << " -> " << "pl2_" << stateName << "_" << index << " [ label=\"" << index << "\" ];\n";
}

// Create the nodes of the probabilistic player.
Expand All @@ -157,8 +156,7 @@ void MenuGameAbstractor<DdType, ValueType>::exportToDot(storm::gbar::abstraction
index = abstractionInformation.decodePlayer2Choice(stateValue.first, currentGame.getPlayer2Variables().size());
out << stateName << "_" << index;
out << " [ shape=\"point\", label=\"\" ];\n";
out << "\tpl2_" << stateName << " -> "
<< "plp_" << stateName << "_" << index << " [ label=\"" << index << "\" ];\n";
out << "\tpl2_" << stateName << " -> " << "plp_" << stateName << "_" << index << " [ label=\"" << index << "\" ];\n";
}

for (auto stateValue : filteredTransitions) {
Expand Down
6 changes: 2 additions & 4 deletions src/storm-gspn/storage/gspn/GSPN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,14 @@ void GSPN::writeDotToStream(std::ostream& outStream) const {
outStream << "digraph " << this->getName() << " {\n";

// print places with initial marking (not printed is the capacity)
outStream << "\t"
<< "node [shape=ellipse]\n";
outStream << "\t" << "node [shape=ellipse]\n";
for (auto& place : this->getPlaces()) {
outStream << "\t" << place.getName() << " [label=\"" << place.getName() << "(" << place.getNumberOfInitialTokens();
outStream << ")\"];\n";
}

// print transitions with weight/rate
outStream << "\t"
<< "node [shape=box]\n";
outStream << "\t" << "node [shape=box]\n";

for (auto& trans : this->getImmediateTransitions()) {
outStream << "\t" << trans.getName() << " [fontcolor=white, style=filled, fillcolor=black, label=<" << trans.getName()
Expand Down
3 changes: 1 addition & 2 deletions src/storm-parsers/parser/SpiritErrorHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ struct SpiritErrorHandler {
std::string line(lineStart, lineEnd);

std::stringstream stream;
stream << "Parsing error at " << get_line(where) << ":" << boost::spirit::get_column(lineStart, where) << ": "
<< " expecting " << what << ", here:\n";
stream << "Parsing error at " << get_line(where) << ":" << boost::spirit::get_column(lineStart, where) << ": " << " expecting " << what << ", here:\n";
stream << "\t" << line << '\n';
auto caretColumn = boost::spirit::get_column(lineStart, where);
stream << "\t" << std::string(caretColumn - 1, ' ') << "^\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,7 @@ void BeliefExplorationPomdpModelChecker<PomdpModelType, BeliefValueType, BeliefM
// While we tell the procedure to be paused, idle
while (unfoldingControl ==
storm::pomdp::modelchecker::BeliefExplorationPomdpModelChecker<PomdpModelType, BeliefValueType, BeliefMDPType>::UnfoldingControl::Pause &&
!storm::utility::resources::isTerminate())
;
!storm::utility::resources::isTerminate());
}
STORM_LOG_INFO("\tInteractive Unfolding terminated.\n");
}
Expand Down Expand Up @@ -1090,8 +1089,8 @@ bool BeliefExplorationPomdpModelChecker<PomdpModelType, BeliefValueType, BeliefM
}
if (printUpdateStopwatch.getTimeInSeconds() >= 60) {
printUpdateStopwatch.restart();
STORM_PRINT_AND_LOG("### " << underApproximation->getCurrentNumberOfMdpStates() << " beliefs in underapproximation MDP"
<< " ##### " << underApproximation->getUnexploredStates().size() << " beliefs queued\n");
STORM_PRINT_AND_LOG("### " << underApproximation->getCurrentNumberOfMdpStates() << " beliefs in underapproximation MDP" << " ##### "
<< underApproximation->getUnexploredStates().size() << " beliefs queued\n");
if (underApproximation->getCurrentNumberOfMdpStates() > heuristicParameters.sizeThreshold && options.useClipping) {
STORM_PRINT_AND_LOG("##### Clipping Attempts: " << statistics.nrClippingAttempts.value() << " ##### "
<< "Clipped States: " << statistics.nrClippedStates.value() << "\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ namespace pomdp {
namespace modelchecker {
template<typename ValueType>
PreprocessingPomdpValueBoundsModelChecker<ValueType>::PreprocessingPomdpValueBoundsModelChecker(storm::models::sparse::Pomdp<ValueType> const& pomdp)
: pomdp(pomdp) { /* Intentionally left empty */
}
: pomdp(pomdp) { /* Intentionally left empty */ }

template<typename ValueType>
typename PreprocessingPomdpValueBoundsModelChecker<ValueType>::ValueBounds PreprocessingPomdpValueBoundsModelChecker<ValueType>::getValueBounds(
Expand Down
4 changes: 1 addition & 3 deletions src/storm/adapters/Smt2ExpressionAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ class Smt2ExpressionAdapter {
*/
std::string translateExpression(storm::RationalFunction const& leftHandSide, storm::CompareRelation const& relation) {
std::stringstream ss;
ss << "(" << relation << " " << leftHandSide.toString(false, useReadableVarNames) << " "
<< "0 "
<< ")";
ss << "(" << relation << " " << leftHandSide.toString(false, useReadableVarNames) << " " << "0 " << ")";
return ss.str();
}

Expand Down
3 changes: 1 addition & 2 deletions src/storm/automata/DeterministicAutomaton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ void DeterministicAutomaton::printHOA(std::ostream& out) const {

out << "Acceptance: " << acceptance->getNumberOfAcceptanceSets() << " " << *acceptance->getAcceptanceExpression() << "\n";

out << "--BODY--"
<< "\n";
out << "--BODY--" << "\n";

for (std::size_t s = 0; s < getNumberOfStates(); s++) {
out << "State: " << s;
Expand Down
3 changes: 1 addition & 2 deletions src/storm/automata/LTL2DeterministicAutomaton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ std::shared_ptr<DeterministicAutomaton> LTL2DeterministicAutomaton::ltl2daExtern
int status;

// wait for completion
while (wait(&status) != pid)
;
while (wait(&status) != pid);

int rv;
if (WIFEXITED(status)) {
Expand Down
3 changes: 1 addition & 2 deletions src/storm/models/symbolic/Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,7 @@ void Model<Type, ValueType>::printDdVariableInformationToStream(std::ostream& ou
columnVariableCount += this->getManager().getMetaVariable(metaVariable).getNumberOfDdVariables();
}

out << "Variables: \t"
<< "rows: " << this->rowVariables.size() << " meta variables (" << rowVariableCount << " DD variables)"
out << "Variables: \t" << "rows: " << this->rowVariables.size() << " meta variables (" << rowVariableCount << " DD variables)"
<< ", columns: " << this->columnVariables.size() << " meta variables (" << columnVariableCount << " DD variables)";
}

Expand Down
4 changes: 2 additions & 2 deletions src/storm/storage/Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ void Scheduler<ValueType>::printToStream(std::ostream& out, std::shared_ptr<stor
}
out << ":\n";
STORM_LOG_WARN_COND(!(skipUniqueChoices && model == nullptr), "Can not skip unique choices if the model is not given.");
out << std::setw(widthOfStates) << "model state:"
<< " " << (isMemorylessScheduler() ? "" : " memory: ") << "choice(s)" << (isMemorylessScheduler() ? "" : " memory updates: ") << '\n';
out << std::setw(widthOfStates) << "model state:" << " " << (isMemorylessScheduler() ? "" : " memory: ") << "choice(s)"
<< (isMemorylessScheduler() ? "" : " memory updates: ") << '\n';
for (uint_fast64_t state = 0; state < schedulerChoices.front().size(); ++state) {
// Check whether the state is skipped
if (skipUniqueChoices && model != nullptr && model->getTransitionMatrix().getRowGroupSize(state) == 1) {
Expand Down
3 changes: 1 addition & 2 deletions src/storm/storage/SparseMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,7 @@ void print(std::vector<typename SparseMatrix<ValueType>::index_type> const& rowG
for (typename SparseMatrix<ValueType>::index_type i = rowGroupIndices[group]; i < endGroups; ++i) {
endRows = i < rowIndications.size() - 1 ? rowIndications[i + 1] : columnsAndValues.size();
// Print the actual row.
std::cout << "Row " << i << " (" << rowIndications[i] << " - " << endRows << ")"
<< ": ";
std::cout << "Row " << i << " (" << rowIndications[i] << " - " << endRows << ")" << ": ";
for (typename SparseMatrix<ValueType>::index_type pos = rowIndications[i]; pos < endRows; ++pos) {
std::cout << "(" << columnsAndValues[pos].getColumn() << ": " << columnsAndValues[pos].getValue() << ") ";
}
Expand Down
3 changes: 1 addition & 2 deletions src/storm/storage/jani/Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1631,8 +1631,7 @@ Model Model::createModelFromAutomaton(Automaton const& automaton) const {

std::string filterName(std::string const& text) {
std::string result = text;
std::replace_if(
result.begin(), result.end(), [](const char& c) { return std::ispunct(c); }, '_');
std::replace_if(result.begin(), result.end(), [](const char& c) { return std::ispunct(c); }, '_');
return result;
}

Expand Down
3 changes: 1 addition & 2 deletions src/storm/storage/prism/ClockVariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ void ClockVariable::createMissingInitialValue() {
}

std::ostream& operator<<(std::ostream& stream, ClockVariable const& variable) {
stream << variable.getName() << ": clock"
<< ";";
stream << variable.getName() << ": clock" << ";";
return stream;
}

Expand Down
3 changes: 1 addition & 2 deletions src/storm/storage/prism/Constant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ Constant Constant::substitute(std::map<storm::expressions::Variable, storm::expr
std::ostream& operator<<(std::ostream& stream, Constant const& constant) {
stream << "const ";
if (constant.getType().isRationalType()) {
stream << "double"
<< " ";
stream << "double" << " ";
} else {
stream << constant.getType() << " ";
}
Expand Down
4 changes: 1 addition & 3 deletions src/storm/storage/prism/HidingComposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ std::set<std::string> const& HidingComposition::getActionsToHide() const {
}

void HidingComposition::writeToStream(std::ostream& stream) const {
stream << "(" << *sub << ")"
<< " "
<< "{" << boost::join(actionsToHide, ", ") << "}";
stream << "(" << *sub << ")" << " " << "{" << boost::join(actionsToHide, ", ") << "}";
}

} // namespace prism
Expand Down
3 changes: 1 addition & 2 deletions src/test/storm-pomdp/api/BeliefExplorationAPITest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ class DefaultDoubleVIEnvironment {
static ValueType precision() {
return storm::utility::convertNumber<ValueType>(0.12);
} // there actually aren't any precision guarantees, but we still want to detect if results are weird.
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */
}
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */ }
};

template<typename TestType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ class DefaultDoubleVIEnvironment {
static ValueType precision() {
return storm::utility::convertNumber<ValueType>(0.12);
} // there actually aren't any precision guarantees, but we still want to detect if results are weird.
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */
}
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */ }
static PreprocessingType const preprocessingType = PreprocessingType::None;
};

Expand All @@ -45,8 +44,7 @@ class SelfloopReductionDefaultDoubleVIEnvironment {
static ValueType precision() {
return storm::utility::convertNumber<ValueType>(0.12);
} // there actually aren't any precision guarantees, but we still want to detect if results are weird.
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */
}
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */ }
static PreprocessingType const preprocessingType = PreprocessingType::SelfloopReduction;
};

Expand All @@ -63,8 +61,7 @@ class QualitativeReductionDefaultDoubleVIEnvironment {
static ValueType precision() {
return storm::utility::convertNumber<ValueType>(0.12);
} // there actually aren't any precision guarantees, but we still want to detect if results are weird.
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */
}
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */ }
static PreprocessingType const preprocessingType = PreprocessingType::QualitativeReduction;
};

Expand All @@ -81,8 +78,7 @@ class PreprocessedDefaultDoubleVIEnvironment {
static ValueType precision() {
return storm::utility::convertNumber<ValueType>(0.12);
} // there actually aren't any precision guarantees, but we still want to detect if results are weird.
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */
}
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */ }
static PreprocessingType const preprocessingType = PreprocessingType::All;
};

Expand Down Expand Up @@ -159,8 +155,7 @@ class DefaultDoubleOVIEnvironment {
static ValueType precision() {
return storm::utility::convertNumber<ValueType>(0.12);
} // there actually aren't any precision guarantees, but we still want to detect if results are weird.
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */
}
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */ }
static PreprocessingType const preprocessingType = PreprocessingType::None;
};

Expand All @@ -177,8 +172,7 @@ class DefaultRationalPIEnvironment {
static ValueType precision() {
return storm::utility::convertNumber<ValueType>(0.12);
} // there actually aren't any precision guarantees, but we still want to detect if results are weird.
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */
}
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */ }
static PreprocessingType const preprocessingType = PreprocessingType::None;
};

Expand All @@ -195,8 +189,7 @@ class PreprocessedDefaultRationalPIEnvironment {
static ValueType precision() {
return storm::utility::convertNumber<ValueType>(0.12);
} // there actually aren't any precision guarantees, but we still want to detect if results are weird.
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */
}
static void adaptOptions(storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>&) { /* intentionally left empty */ }
static PreprocessingType const preprocessingType = PreprocessingType::All;
};

Expand Down
Loading