Browse Source

updates after cherry pick

tempestpy_adaptions
Stefan Pranger 3 years ago
parent
commit
7a851901e2
  1. 14
      src/storm-parsers/parser/FormulaParserGrammar.cpp
  2. 2
      src/storm-parsers/parser/FormulaParserGrammar.h
  3. 2
      src/storm/logic/BoundedGloballyFormula.cpp
  4. 5
      src/storm/logic/BoundedGloballyFormula.h
  5. 1
      src/storm/logic/Formula.h
  6. 9
      src/storm/logic/FragmentSpecification.cpp
  7. 4
      src/storm/logic/ToPrefixStringVisitor.cpp
  8. 2
      src/storm/logic/ToPrefixStringVisitor.h
  9. 1
      src/storm/modelchecker/csl/SparseCtmcCslModelChecker.h
  10. 1
      src/storm/modelchecker/prctl/SparseDtmcPrctlModelChecker.h
  11. 2
      src/storm/modelchecker/prctl/helper/SparseMdpPrctlHelper.cpp
  12. 1
      src/storm/storage/Scheduler.cpp
  13. 1
      src/storm/storage/Scheduler.h

14
src/storm-parsers/parser/FormulaParserGrammar.cpp

@ -388,21 +388,9 @@ namespace storm {
}
}
std::shared_ptr<storm::logic::Formula const> FormulaParserGrammar::createGloballyFormula(boost::optional<std::vector<std::tuple<boost::optional<storm::logic::TimeBound>, boost::optional<storm::logic::TimeBound>, std::shared_ptr<storm::logic::TimeBoundReference>>>> const& timeBounds, std::shared_ptr<storm::logic::Formula const> const& subformula) const {
if (timeBounds && !timeBounds.get().empty()) {
std::vector<boost::optional<storm::logic::TimeBound>> lowerBounds, upperBounds;
std::vector<storm::logic::TimeBoundReference> timeBoundReferences;
for (auto const& timeBound : timeBounds.get()) {
STORM_LOG_ASSERT(!std::get<0>(timeBound), "Cannot use lower time bounds (or intervals) in globally formulas.");
lowerBounds.push_back(std::get<0>(timeBound));
upperBounds.push_back(std::get<1>(timeBound));
timeBoundReferences.emplace_back(*std::get<2>(timeBound));
}
return std::shared_ptr<storm::logic::Formula const>(new storm::logic::BoundedGloballyFormula(subformula, lowerBounds, upperBounds, timeBoundReferences));
} else {
std::shared_ptr<storm::logic::Formula const> FormulaParserGrammar::createGloballyFormula(std::shared_ptr<storm::logic::Formula const> const& subformula) const {
return std::shared_ptr<storm::logic::Formula const>(new storm::logic::GloballyFormula(subformula));
}
}
std::shared_ptr<storm::logic::Formula const> FormulaParserGrammar::createNextFormula(std::shared_ptr<storm::logic::Formula const> const& subformula) const {
return std::shared_ptr<storm::logic::Formula const>(new storm::logic::NextFormula(subformula));

2
src/storm-parsers/parser/FormulaParserGrammar.h

@ -263,7 +263,7 @@ namespace storm {
std::shared_ptr<storm::logic::Formula const> createBooleanLiteralFormula(bool literal) const;
std::shared_ptr<storm::logic::Formula const> createAtomicLabelFormula(std::string const& label) const;
std::shared_ptr<storm::logic::Formula const> createEventuallyFormula(boost::optional<std::vector<std::tuple<boost::optional<storm::logic::TimeBound>, boost::optional<storm::logic::TimeBound>, std::shared_ptr<storm::logic::TimeBoundReference>>>> const& timeBounds, storm::logic::FormulaContext context, std::shared_ptr<storm::logic::Formula const> const& subformula) const;
std::shared_ptr<storm::logic::Formula const> createGloballyFormula(boost::optional<std::vector<std::tuple<boost::optional<storm::logic::TimeBound>, boost::optional<storm::logic::TimeBound>, std::shared_ptr<storm::logic::TimeBoundReference>>>> const& timeBounds, std::shared_ptr<storm::logic::Formula const> const& subformula) const;
std::shared_ptr<storm::logic::Formula const> createGloballyFormula(std::shared_ptr<storm::logic::Formula const> const& subformula) const;
std::shared_ptr<storm::logic::Formula const> createNextFormula(std::shared_ptr<storm::logic::Formula const> const& subformula) const;
std::shared_ptr<storm::logic::Formula const> createUntilFormula(std::shared_ptr<storm::logic::Formula const> const& leftSubformula, boost::optional<std::vector<std::tuple<boost::optional<storm::logic::TimeBound>, boost::optional<storm::logic::TimeBound>, std::shared_ptr<storm::logic::TimeBoundReference>>>> const& timeBounds, std::shared_ptr<storm::logic::Formula const> const& rightSubformula);
std::shared_ptr<storm::logic::Formula const> createHOAPathFormula(const std::string& automataFile) const;

2
src/storm/logic/BoundedGloballyFormula.cpp

@ -218,7 +218,7 @@ namespace storm {
STORM_LOG_THROW(!bound.containsVariables(), storm::exceptions::InvalidOperationException, "Cannot evaluate time-bound '" << bound << "' as it contains undefined constants.");
}
std::ostream& BoundedGloballyFormula::writeToStream(std::ostream& out) const {
std::ostream& BoundedGloballyFormula::writeToStream(std::ostream& out, bool allowParentheses) const {
out << "G" ;
if (this->isMultiDimensional()) {
out << "^{";

5
src/storm/logic/BoundedGloballyFormula.h

@ -60,10 +60,7 @@ namespace storm {
template<typename ValueType>
ValueType getNonStrictLowerBound(unsigned i = 0) const;
virtual std::ostream &writeToStream(std::ostream &out) const override;
virtual std::ostream &writeToStream(std::ostream &out, bool allowParentheses = false) const override;
private:
static void checkNoVariablesInBound(storm::expressions::Expression const& bound);

1
src/storm/logic/Formula.h

@ -74,6 +74,7 @@ namespace storm {
virtual bool isGloballyFormula() const;
virtual bool isEventuallyFormula() const;
virtual bool isReachabilityProbabilityFormula() const;
virtual bool isHOAPathFormula() const;
virtual bool isBoundedGloballyFormula() const;
// Reward formulas.

9
src/storm/logic/FragmentSpecification.cpp

@ -433,6 +433,15 @@ namespace storm {
return *this;
}
bool FragmentSpecification::areBinaryBooleanStateFormulasAllowed() const {
return binaryBooleanStateFormula;
}
FragmentSpecification& FragmentSpecification::setBinaryBooleanStateFormulasAllowed(bool newValue) {
this->binaryBooleanStateFormula = newValue;
return *this;
}
bool FragmentSpecification::areBinaryBooleanPathFormulasAllowed() const {
return binaryBooleanPathFormula;
}

4
src/storm/logic/ToPrefixStringVisitor.cpp

@ -59,6 +59,10 @@ namespace storm {
return result;
}
boost::any ToPrefixStringVisitor::visit(BoundedGloballyFormula const&, boost::any const&) const {
STORM_LOG_THROW(false, storm::exceptions::InvalidOperationException, "Can not convert to prefix string");
}
boost::any ToPrefixStringVisitor::visit(BoundedUntilFormula const&, boost::any const&) const {
STORM_LOG_THROW(false, storm::exceptions::InvalidOperationException, "Can not convert to prefix string");
}

2
src/storm/logic/ToPrefixStringVisitor.h

@ -16,6 +16,7 @@ namespace storm {
virtual boost::any visit(BinaryBooleanStateFormula const& f, boost::any const& data) const override;
virtual boost::any visit(BinaryBooleanPathFormula const& f, boost::any const& data) const override;
virtual boost::any visit(BooleanLiteralFormula const& f, boost::any const& data) const override;
virtual boost::any visit(BoundedGloballyFormula const& f, boost::any const& data) const override;
virtual boost::any visit(BoundedUntilFormula const& f, boost::any const& data) const override;
virtual boost::any visit(ConditionalFormula const& f, boost::any const& data) const override;
virtual boost::any visit(CumulativeRewardFormula const& f, boost::any const& data) const override;
@ -40,4 +41,3 @@ namespace storm {
}
}

1
src/storm/modelchecker/csl/SparseCtmcCslModelChecker.h

@ -29,6 +29,7 @@ namespace storm {
virtual std::unique_ptr<CheckResult> computeBoundedUntilProbabilities(Environment const& env, CheckTask<storm::logic::BoundedUntilFormula, ValueType> const& checkTask) override;
virtual std::unique_ptr<CheckResult> computeNextProbabilities(Environment const& env, CheckTask<storm::logic::NextFormula, ValueType> const& checkTask) override;
virtual std::unique_ptr<CheckResult> computeUntilProbabilities(Environment const& env, CheckTask<storm::logic::UntilFormula, ValueType> const& checkTask) override;
virtual std::unique_ptr<CheckResult> computeLTLProbabilities(Environment const& env, CheckTask<storm::logic::PathFormula, ValueType> const& checkTask) override;
virtual std::unique_ptr<CheckResult> computeLongRunAverageProbabilities(Environment const& env, CheckTask<storm::logic::StateFormula, ValueType> const& checkTask) override;
virtual std::unique_ptr<CheckResult> computeReachabilityTimes(Environment const& env, storm::logic::RewardMeasureType rewardMeasureType, CheckTask<storm::logic::EventuallyFormula, ValueType> const& checkTask) override;

1
src/storm/modelchecker/prctl/SparseDtmcPrctlModelChecker.h

@ -30,6 +30,7 @@ namespace storm {
virtual std::unique_ptr<CheckResult> computeNextProbabilities(Environment const& env, CheckTask<storm::logic::NextFormula, ValueType> const& checkTask) override;
virtual std::unique_ptr<CheckResult> computeUntilProbabilities(Environment const& env, CheckTask<storm::logic::UntilFormula, ValueType> const& checkTask) override;
virtual std::unique_ptr<CheckResult> computeGloballyProbabilities(Environment const& env, CheckTask<storm::logic::GloballyFormula, ValueType> const& checkTask) override;
virtual std::unique_ptr<CheckResult> computeHOAPathProbabilities(Environment const& env, CheckTask<storm::logic::HOAPathFormula, ValueType> const& checkTask) override;
virtual std::unique_ptr<CheckResult> computeConditionalProbabilities(Environment const& env, CheckTask<storm::logic::ConditionalFormula, ValueType> const& checkTask) override;
virtual std::unique_ptr<CheckResult> computeLongRunAverageProbabilities(Environment const& env, CheckTask<storm::logic::StateFormula, ValueType> const& checkTask) override;
virtual std::unique_ptr<CheckResult> computeLTLProbabilities(Environment const& env, CheckTask<storm::logic::PathFormula, ValueType> const& checkTask) override;

2
src/storm/modelchecker/prctl/helper/SparseMdpPrctlHelper.cpp

@ -635,6 +635,8 @@ namespace storm {
}
}
std::vector<ValueType> maybeStateChoiceValues = std::vector<ValueType>(sizeMaybeStateChoiceValues, storm::utility::zero<ValueType>());
// Check whether we need to compute exact probabilities for some states.
if ((qualitative || maybeStatesNotRelevant) && !goal.isShieldingTask()) {
// Set the values for all maybe-states to 0.5 to indicate that their probability values are neither 0 nor 1.

1
src/storm/storage/Scheduler.cpp

@ -275,6 +275,7 @@ namespace storm {
stateString << "model state' = " << entryIt->getColumn() << ": -> " << "(m' = "<<this->memoryStructure->getSuccessorMemoryState(memoryState, entryIt - model->getTransitionMatrix().begin()) <<")";
// out << "model state' = " << entryIt->getColumn() << ": (transition = " << entryIt - model->getTransitionMatrix().begin() << ") -> " << "(m' = "<<this->memoryStructure->getSuccessorMemoryState(memoryState, entryIt - model->getTransitionMatrix().begin()) <<")";
}
}
stateString << std::endl;
}

1
src/storm/storage/Scheduler.h

@ -154,7 +154,6 @@ namespace storm {
std::vector<storm::storage::BitVector> reachableStates;
uint_fast64_t numOfUndefinedChoices; // Only consider reachable ones
std::vector<storm::storage::BitVector> dontCareStates; // Their choices are neither considered deterministic nor undefined
uint_fast64_t numOfUndefinedChoices;
uint_fast64_t numOfDeterministicChoices;
uint_fast64_t numOfDontCareStates;
};

Loading…
Cancel
Save