Browse Source

Correct indentation

tempestpy_adaptions
Matthias Volk 7 years ago
parent
commit
8051912147
  1. 42
      src/storm-dft/modelchecker/dft/DFTASFChecker.cpp
  2. 4
      src/storm-dft/modelchecker/dft/DFTASFChecker.h

42
src/storm-dft/modelchecker/dft/DFTASFChecker.cpp

@ -12,11 +12,9 @@ namespace storm {
class IsMaximum : public DFTConstraint { class IsMaximum : public DFTConstraint {
public: public:
IsMaximum(uint64_t varIndex, std::vector<uint64_t> const& varIndices) : varIndex(varIndex), varIndices(varIndices) { IsMaximum(uint64_t varIndex, std::vector<uint64_t> const& varIndices) : varIndex(varIndex), varIndices(varIndices) {
} }
virtual ~IsMaximum() { virtual ~IsMaximum() {
} }
std::string toSmtlib2(std::vector<std::string> const& varNames) const override { std::string toSmtlib2(std::vector<std::string> const& varNames) const override {
@ -34,26 +32,23 @@ namespace storm {
sstr << ")"; // end of the or sstr << ")"; // end of the or
sstr << ")"; // end outer and. sstr << ")"; // end outer and.
return sstr.str(); return sstr.str();
} }
private: private:
uint64_t varIndex; uint64_t varIndex;
std::vector<uint64_t> varIndices; std::vector<uint64_t> varIndices;
}; };
/* /*
* First is the minimum of the others * First is the minimum of the others
*/ */
class IsMinimum : public DFTConstraint { class IsMinimum : public DFTConstraint {
public: public:
IsMinimum(uint64_t varIndex, std::vector<uint64_t> const& varIndices) : varIndex(varIndex), varIndices(varIndices) { IsMinimum(uint64_t varIndex, std::vector<uint64_t> const& varIndices) : varIndex(varIndex), varIndices(varIndices) {
} }
virtual ~IsMinimum() { virtual ~IsMinimum() {
} }
std::string toSmtlib2(std::vector<std::string> const& varNames) const override { std::string toSmtlib2(std::vector<std::string> const& varNames) const override {
@ -71,22 +66,19 @@ namespace storm {
sstr << ")"; // end of the or sstr << ")"; // end of the or
sstr << ")"; // end outer and. sstr << ")"; // end outer and.
return sstr.str(); return sstr.str();
} }
private: private:
uint64_t varIndex; uint64_t varIndex;
std::vector<uint64_t> varIndices; std::vector<uint64_t> varIndices;
}; };
class BetweenValues : public DFTConstraint { class BetweenValues : public DFTConstraint {
public: public:
BetweenValues(uint64_t varIndex, uint64_t lower, uint64_t upper) : varIndex(varIndex), upperBound(upper) , lowerBound(lower) { BetweenValues(uint64_t varIndex, uint64_t lower, uint64_t upper) : varIndex(varIndex), upperBound(upper) , lowerBound(lower) {
} }
virtual ~BetweenValues() { virtual ~BetweenValues() {
} }
std::string toSmtlib2(std::vector<std::string> const& varNames) const override { std::string toSmtlib2(std::vector<std::string> const& varNames) const override {
@ -104,12 +96,11 @@ namespace storm {
uint64_t lowerBound; uint64_t lowerBound;
}; };
class And : public DFTConstraint { class And : public DFTConstraint {
public: public:
And(std::vector<std::shared_ptr<DFTConstraint>> const& constraints) : constraints(constraints) {} And(std::vector<std::shared_ptr<DFTConstraint>> const& constraints) : constraints(constraints) {}
virtual ~And() { virtual ~And() {
} }
std::string toSmtlib2(std::vector<std::string> const& varNames) const override { std::string toSmtlib2(std::vector<std::string> const& varNames) const override {
@ -121,18 +112,18 @@ namespace storm {
sstr << ")"; sstr << ")";
return sstr.str(); return sstr.str();
} }
private: private:
std::vector<std::shared_ptr<DFTConstraint>> constraints; std::vector<std::shared_ptr<DFTConstraint>> constraints;
}; };
class Iff : public DFTConstraint { class Iff : public DFTConstraint {
public: public:
Iff(std::shared_ptr<DFTConstraint> l, std::shared_ptr<DFTConstraint> r) : lhs(l), rhs(r) { Iff(std::shared_ptr<DFTConstraint> l, std::shared_ptr<DFTConstraint> r) : lhs(l), rhs(r) {
} }
std::string toSmtlib2(std::vector<std::string> const& varNames) const override { std::string toSmtlib2(std::vector<std::string> const& varNames) const override {
std::stringstream sstr; std::stringstream sstr;
sstr << "(= " << lhs->toSmtlib2(varNames) << " " << rhs->toSmtlib2(varNames) << ")"; sstr << "(= " << lhs->toSmtlib2(varNames) << " " << rhs->toSmtlib2(varNames) << ")";
@ -144,14 +135,13 @@ namespace storm {
std::shared_ptr<DFTConstraint> rhs; std::shared_ptr<DFTConstraint> rhs;
}; };
class IsConstantValue : public DFTConstraint { class IsConstantValue : public DFTConstraint {
public: public:
IsConstantValue(uint64_t varIndex, uint64_t val) : varIndex(varIndex), value(val) { IsConstantValue(uint64_t varIndex, uint64_t val) : varIndex(varIndex), value(val) {
} }
virtual ~IsConstantValue() { virtual ~IsConstantValue() {
} }
std::string toSmtlib2(std::vector<std::string> const& varNames) const override { std::string toSmtlib2(std::vector<std::string> const& varNames) const override {
@ -166,14 +156,13 @@ namespace storm {
uint64_t value; uint64_t value;
}; };
class IsEqual : public DFTConstraint { class IsEqual : public DFTConstraint {
public: public:
IsEqual(uint64_t varIndex1, uint64_t varIndex2) :var1Index(varIndex1), var2Index(varIndex2) { IsEqual(uint64_t varIndex1, uint64_t varIndex2) :var1Index(varIndex1), var2Index(varIndex2) {
} }
virtual ~IsEqual() { virtual ~IsEqual() {
} }
std::string toSmtlib2(std::vector<std::string> const& varNames) const override { std::string toSmtlib2(std::vector<std::string> const& varNames) const override {
@ -185,14 +174,13 @@ namespace storm {
uint64_t var2Index; uint64_t var2Index;
}; };
class IsLEqual : public DFTConstraint { class IsLEqual : public DFTConstraint {
public: public:
IsLEqual(uint64_t varIndex1, uint64_t varIndex2) :var1Index(varIndex1), var2Index(varIndex2) { IsLEqual(uint64_t varIndex1, uint64_t varIndex2) :var1Index(varIndex1), var2Index(varIndex2) {
} }
virtual ~IsLEqual() { virtual ~IsLEqual() {
} }
std::string toSmtlib2(std::vector<std::string> const& varNames) const override { std::string toSmtlib2(std::vector<std::string> const& varNames) const override {
@ -204,13 +192,12 @@ namespace storm {
uint64_t var2Index; uint64_t var2Index;
}; };
class PairwiseDifferent : public DFTConstraint { class PairwiseDifferent : public DFTConstraint {
public: public:
PairwiseDifferent(std::vector<uint64_t> const& indices) : varIndices(indices) { PairwiseDifferent(std::vector<uint64_t> const& indices) : varIndices(indices) {
} }
virtual ~PairwiseDifferent() { virtual ~PairwiseDifferent() {
} }
std::string toSmtlib2(std::vector<std::string> const& varNames) const override { std::string toSmtlib2(std::vector<std::string> const& varNames) const override {
@ -232,14 +219,13 @@ namespace storm {
std::vector<uint64_t> varIndices; std::vector<uint64_t> varIndices;
}; };
class Sorted : public DFTConstraint { class Sorted : public DFTConstraint {
public: public:
Sorted(std::vector<uint64_t> varIndices) : varIndices(varIndices) { Sorted(std::vector<uint64_t> varIndices) : varIndices(varIndices) {
} }
virtual ~Sorted() { virtual ~Sorted() {
} }
std::string toSmtlib2(std::vector<std::string> const& varNames) const override { std::string toSmtlib2(std::vector<std::string> const& varNames) const override {
@ -252,15 +238,14 @@ namespace storm {
return sstr.str(); return sstr.str();
} }
private: private:
std::vector<uint64_t> varIndices; std::vector<uint64_t> varIndices;
}; };
class IfThenElse : public DFTConstraint { class IfThenElse : public DFTConstraint {
public: public:
IfThenElse(std::shared_ptr<DFTConstraint> ifC, std::shared_ptr<DFTConstraint> thenC, std::shared_ptr<DFTConstraint> elseC) : ifConstraint(ifC), thenConstraint(thenC), elseConstraint(elseC) { IfThenElse(std::shared_ptr<DFTConstraint> ifC, std::shared_ptr<DFTConstraint> thenC, std::shared_ptr<DFTConstraint> elseC) : ifConstraint(ifC), thenConstraint(thenC), elseConstraint(elseC) {
} }
std::string toSmtlib2(std::vector<std::string> const& varNames) const override { std::string toSmtlib2(std::vector<std::string> const& varNames) const override {
@ -285,7 +270,6 @@ namespace storm {
} }
void DFTASFChecker::convert() { void DFTASFChecker::convert() {
std::vector<uint64_t> beVariables; std::vector<uint64_t> beVariables;
// Convert all elements // Convert all elements
for (size_t i = 0; i < dft.nrElements(); ++i) { for (size_t i = 0; i < dft.nrElements(); ++i) {
@ -333,7 +317,6 @@ namespace storm {
} }
} }
for (size_t i = 0; i < dft.nrElements(); ++i) { for (size_t i = 0; i < dft.nrElements(); ++i) {
std::vector<uint64_t> childVarIndices; std::vector<uint64_t> childVarIndices;
if (dft.isGate(i)) { if (dft.isGate(i)) {
@ -390,7 +373,6 @@ namespace storm {
break; break;
} }
} }
constraints.push_back(std::make_shared<IsConstantValue>(dft.getTopLevelIndex(), dft.nrBasicElements()+1)); constraints.push_back(std::make_shared<IsConstantValue>(dft.getTopLevelIndex(), dft.nrBasicElements()+1));
} }

4
src/storm-dft/modelchecker/dft/DFTASFChecker.h

@ -12,7 +12,6 @@ namespace storm {
class DFTConstraint { class DFTConstraint {
public: public:
virtual ~DFTConstraint() { virtual ~DFTConstraint() {
} }
virtual std::string toSmtlib2(std::vector<std::string> const& varNames) const = 0; virtual std::string toSmtlib2(std::vector<std::string> const& varNames) const = 0;
@ -27,10 +26,8 @@ namespace storm {
}; };
class SpareAndChildPair { class SpareAndChildPair {
public: public:
SpareAndChildPair(uint64_t spareIndex, uint64_t childIndex) : spareIndex(spareIndex), childIndex(childIndex) { SpareAndChildPair(uint64_t spareIndex, uint64_t childIndex) : spareIndex(spareIndex), childIndex(childIndex) {
} }
uint64_t spareIndex; uint64_t spareIndex;
@ -43,7 +40,6 @@ namespace storm {
class DFTASFChecker { class DFTASFChecker {
using ValueType = double; using ValueType = double;
public: public:
DFTASFChecker(storm::storage::DFT<ValueType> const&); DFTASFChecker(storm::storage::DFT<ValueType> const&);
void convert(); void convert();

Loading…
Cancel
Save