Browse Source

fix of static parents and fixed warning in element types

Former-commit-id: 816efd9c55
tempestpy_adaptions
sjunges 9 years ago
parent
commit
d00b32b548
  1. 36
      src/storage/dft/DFTElementType.h
  2. 4
      src/storage/dft/DFTElements.h

36
src/storage/dft/DFTElementType.h

@ -6,45 +6,49 @@ namespace storm {
enum class DFTElementType : int {AND = 0, COUNTING = 1, OR = 2, VOT = 3, BE = 4, CONSTF = 5, CONSTS = 6, PAND = 7, SPARE = 8, POR = 9, PDEP = 10, SEQAND = 11}; enum class DFTElementType : int {AND = 0, COUNTING = 1, OR = 2, VOT = 3, BE = 4, CONSTF = 5, CONSTS = 6, PAND = 7, SPARE = 8, POR = 9, PDEP = 10, SEQAND = 11};
inline bool isStaticGateType(DFTElementType const& tp) {
if(!isGateType(tp)) return false;
inline bool isGateType(DFTElementType const& tp) {
switch(tp) { switch(tp) {
case DFTElementType::AND: case DFTElementType::AND:
case DFTElementType::COUNTING:
case DFTElementType::OR: case DFTElementType::OR:
case DFTElementType::VOT: case DFTElementType::VOT:
return true;
case DFTElementType::POR:
case DFTElementType::SPARE:
case DFTElementType::PAND: case DFTElementType::PAND:
case DFTElementType::SPARE:
case DFTElementType::POR:
case DFTElementType::SEQAND: case DFTElementType::SEQAND:
return true;
case DFTElementType::BE:
case DFTElementType::CONSTF:
case DFTElementType::CONSTS:
case DFTElementType::PDEP:
return false; return false;
default: default:
assert(false); assert(false);
return false;
} }
} }
inline bool isGateType(DFTElementType const& tp) {
inline bool isStaticGateType(DFTElementType const& tp) {
if(!isGateType(tp)) return false;
switch(tp) { switch(tp) {
case DFTElementType::AND: case DFTElementType::AND:
case DFTElementType::COUNTING:
case DFTElementType::OR: case DFTElementType::OR:
case DFTElementType::VOT: case DFTElementType::VOT:
case DFTElementType::PAND:
case DFTElementType::SPARE:
return true;
case DFTElementType::POR: case DFTElementType::POR:
case DFTElementType::SPARE:
case DFTElementType::PAND:
case DFTElementType::SEQAND: case DFTElementType::SEQAND:
return true;
case DFTElementType::BE:
case DFTElementType::CONSTF:
case DFTElementType::CONSTS:
case DFTElementType::PDEP:
return false; return false;
default: default:
assert(false); assert(false);
return false;
} }
} }
} }
} }

4
src/storage/dft/DFTElements.h

@ -120,8 +120,8 @@ namespace storm {
} }
bool hasOnlyStaticParents() const { bool hasOnlyStaticParents() const {
for(auto const& parent : parents) {
if(!isStaticGateType(parents->type()) {
for(auto const& parent : mParents) {
if(!isStaticGateType(parent->type())) {
return false; return false;
} }
} }

Loading…
Cancel
Save