Browse Source

better inclusive/exclusive support, including parsing

tempestpy_adaptions
Sebastian Junges 8 years ago
parent
commit
9c5444e059
  1. 8
      src/storm-dft/parser/DFTGalileoParser.cpp
  2. 9
      src/storm-dft/storage/dft/DFTBuilder.h
  3. 6
      src/storm-dft/storage/dft/elements/DFTPand.h
  4. 9
      src/storm-dft/storage/dft/elements/DFTPor.h

8
src/storm-dft/parser/DFTGalileoParser.cpp

@ -110,8 +110,16 @@ namespace storm {
success = builder.addVotElement(name, threshold, childNames);
} else if (tokens[1] == "pand") {
success = builder.addPandElement(name, childNames);
} else if (tokens[1] == "pand-inc") {
success = builder.addPandElement(name, childNames, true);
} else if (tokens[1] == "pand-ex") {
success = builder.addPandElement(name, childNames, false);
} else if (tokens[1] == "por") {
success = builder.addPorElement(name, childNames);
} else if (tokens[1] == "por-ex") {
success = builder.addPorElement(name, childNames, false);
} else if (tokens[1] == "por-inc") {
success = builder.addPorElement(name, childNames, true);
} else if (tokens[1] == "wsp" || tokens[1] == "csp") {
success = builder.addSpareElement(name, childNames);
} else if (tokens[1] == "seq") {

9
src/storm-dft/storage/dft/DFTBuilder.h

@ -53,6 +53,7 @@ namespace storm {
bool addPandElement(std::string const& name, std::vector<std::string> const& children, bool inclusive) {
bool tmpDefault = pandDefaultInclusive;
pandDefaultInclusive = inclusive;
bool result = addStandardGate(name, children, DFTElementType::PAND);
pandDefaultInclusive = tmpDefault;
return result;
@ -62,6 +63,14 @@ namespace storm {
return addStandardGate(name, children, DFTElementType::POR);
}
bool addPorElement(std::string const& name, std::vector<std::string> const& children, bool inclusive) {
bool tmpDefault = porDefaultInclusive;
porDefaultInclusive = inclusive;
bool result = addStandardGate(name, children, DFTElementType::POR);
pandDefaultInclusive = tmpDefault;
return result;
}
bool addSpareElement(std::string const& name, std::vector<std::string> const& children) {
return addStandardGate(name, children, DFTElementType::SPARE);
}

6
src/storm-dft/storage/dft/elements/DFTPand.h

@ -50,7 +50,11 @@ namespace storm {
}
std::string typestring() const override {
return "PAND" + inclusive ? "" : "-ex";
if (inclusive) {
return "PAND-inc";
} else {
return "PAND-ex";
}
}
protected:
bool inclusive;

9
src/storm-dft/storage/dft/elements/DFTPor.h

@ -42,10 +42,15 @@ namespace storm {
}
std::string typestring() const override {
return "POR" + inclusive ? "" : "-ex";
if (inclusive) {
return "POR-inc";
} else {
return "POR-ex";
}
}
bool isInclusive() {
bool isInclusive() const {
return inclusive;
}
protected:

Loading…
Cancel
Save