25template<
typename ValueType>
28template<
typename ValueType>
31template<
typename ValueType>
38template<
typename ValueType>
40 using DFTGatePointer = std::shared_ptr<DFTGate<ValueType>>;
41 using DFTGateVector = std::vector<DFTGatePointer>;
42 using DFTDependencyPointer = std::shared_ptr<DFTDependency<ValueType>>;
43 using DFTDependencyVector = std::vector<DFTDependencyPointer>;
44 using DFTRestrictionPointer = std::shared_ptr<DFTRestriction<ValueType>>;
45 using DFTRestrictionVector = std::vector<DFTRestrictionPointer>;
62 virtual std::shared_ptr<DFTElement<ValueType>>
clone()
const = 0;
73 virtual size_t id()
const {
89 virtual std::string
const&
name()
const {
242 std::vector<size_t> ids;
243 for (
auto parent : this->
parents()) {
244 ids.push_back(parent->id());
254 for (
auto const& parent : this->
parents()) {
255 if (!parent->isStaticElement()) {
326 STORM_LOG_ASSERT(outgoingDependency->triggerEvent()->id() == this->id(),
"Ids do not match.");
347 virtual void extendUnit(std::set<size_t>& unit)
const;
355 virtual std::vector<size_t>
independentSubDft(
bool blockParents,
bool sparesAsLeaves =
false)
const;
361 virtual void extendSubDft(std::set<size_t>& elemsInSubtree, std::vector<size_t>
const& parentsOfSubRoot,
bool blockParents,
bool sparesAsLeaves)
const;
389template<
typename ValueType>
Abstract base class for DFT elements.
virtual size_t id() const
Get id.
virtual void extendUnit(std::set< size_t > &unit) const
Helper to independent unit computation.
virtual bool checkDontCareAnymore(storm::dft::storage::DFTState< ValueType > &state, storm::dft::storage::DFTStateSpaceGenerationQueues< ValueType > &queues) const
virtual std::string toString() const =0
Print information about element to string.
virtual std::string typestring() const
Get type as string.
virtual std::string const & name() const
Get name.
void addOutgoingDependency(DFTDependencyPointer const &outgoingDependency)
Add outgoing dependency.
virtual bool isBasicElement() const
Checks whether the element is a basic element.
std::vector< size_t > parentIds() const
Return Ids of parents.
virtual std::size_t nrChildren() const =0
Get number of children.
DFTRestrictionVector mRestrictions
virtual bool isRelevant() const
Get whether the element is relevant.
void addParent(DFTGatePointer const &parent)
Add parent.
virtual void setRelevance(bool relevant) const
Set the relevancy of the element.
DFTDependencyVector const & outgoingDependencies() const
Get outgoing dependencies.
virtual bool isDependency() const
Check whether the element is a dependency.
void addRestriction(DFTRestrictionPointer const &restriction)
Add restriction.
virtual std::vector< size_t > independentUnit() const
Computes the independent unit of this element, that is, all elements which are direct or indirect suc...
virtual void setId(size_t id)
Set id.
size_t nrOutgoingDependencies() const
Return the number of outgoing dependencies.
size_t nrRestrictions() const
Return the number of restrictions.
virtual bool isGate() const
Check whether the element is a gate.
virtual size_t rank() const
Get rank.
bool hasRestrictions() const
Return whether the element has restrictions.
virtual ~DFTElement()=default
Destructor.
virtual bool isSpareGate() const
Check whether the element is a SPARE gate.
virtual bool isRestriction() const
Check whether the element is a restriction.
virtual void setAllowDC(bool allowDC) const
Set whether Don't Care propagation is allowed for this element.
DFTGateVector const & parents() const
Get parents.
virtual bool isTypeEqualTo(DFTElement< ValueType > const &other) const
Check whether two elements have the same type.
virtual void extendSpareModule(std::set< size_t > &elementsInModule) const
virtual bool isStaticElement() const
Check whether the element is static, ie a BE or a static gate (AND, OR, VOT).
DFTDependencyVector mOutgoingDependencies
DFTRestrictionVector const & restrictions() const
Get restrictions.
bool hasParents() const
Return whether the element has parents.
virtual void setRank(size_t rank)
Set rank.
virtual void extendSubDft(std::set< size_t > &elemsInSubtree, std::vector< size_t > const &parentsOfSubRoot, bool blockParents, bool sparesAsLeaves) const
Helper to the independent subtree computation.
bool hasOnlyStaticParents() const
Check whether the element has only static gates as parents.
DFTElement(size_t id, std::string const &name)
Constructor.
virtual std::shared_ptr< DFTElement< ValueType > > clone() const =0
Create a shallow copy of the element.
virtual std::vector< size_t > independentSubDft(bool blockParents, bool sparesAsLeaves=false) const
Computes independent subtrees starting with this element (this), that is, all elements (x) which are ...
bool hasOutgoingDependencies() const
Return whether the element has outgoing dependencies.
virtual storm::dft::storage::elements::DFTElementType type() const =0
Get type.
size_t nrParents() const
Return the number of parents.
#define STORM_LOG_ASSERT(cond, message)
std::ostream & operator<<(std::ostream &os, DFTElement< ValueType > const &element)
DFTElementType
Element types in a DFT.
std::string toString(DFTElementType const &type)