UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
PreparedGTS::uqinst_iterator Class Reference

The uqinst_iterator generates UQRuleInstances for backward application. More...

#include <PreparedGTS.h>

Collaboration diagram for PreparedGTS::uqinst_iterator:
Collaboration graph
[legend]

Public Member Functions

 uqinst_iterator (PreparedGTS::uqinst_iterator &&old)
 Move constructor. More...
 
 ~uqinst_iterator ()
 Destroys this iterator.
 
PreparedGTS::uqinst_iteratoroperator++ ()
 Computes the next UQRuleInstance of the UQRule corresponding to this iterator. More...
 
graphs::UQRuleInstance_sp operator* ()
 Returns the last UQRuleInstance computed by this iterator (i.e. More...
 
bool hasEnded ()
 Returns true, if this iterator has ended, i.e. More...
 

Private Member Functions

 uqinst_iterator (graphs::UQRule_sp rule, RulePreparer_sp rulepreparer, unsigned int bound)
 Generates a new iterator for the given rule. More...
 
void loadNextRule (bool firstTime=false)
 Drops the current UQRuleInstance and computes the next one if possible. More...
 
unsigned int sumCurrentQuant ()
 Sums up how much instantiations will be performed when using the current value of currentQuant. More...
 

Private Attributes

graphs::UQRule_sp rule
 Stores the UQRule used by this iterator.
 
RulePreparer_sp rulePreparer
 Stores the RulePreparer used by this iterator.
 
vector< unsigned int > * currentQuant
 Stores a count for each Quantification of the UQRule storing how often each Quantification will be used when generating the next UQRuleInstance.
 
vector
< graphs::UQRuleInstance_sp > * 
currentInstances
 Stores the UQRuleInstances generated by preparing a last computed UQRuleInstance. More...
 
unsigned int bound
 Stores the bound to which UQRuleInstances are generated.
 

Friends

class PreparedGTS
 

Detailed Description

The uqinst_iterator generates UQRuleInstances for backward application.

It is generated by the beginUQInstances() and endUQInstances() methods of PreparedGTS. The number of UQInstances generated depends on the number of universal quantifications of the corresponding UQRule and on the graph to which the rule should be applied backwards.

Author
Jan Stückrath
See Also
PreparedGTS

Constructor & Destructor Documentation

Move constructor.

Generates a new iterator using the data of the given iterator. The given iterator is invalidated by this constructor and may not be used any further (except for deletion).

Parameters
oldthe old iterator for which the data will be copied
uqinst_iterator ( graphs::UQRule_sp  rule,
RulePreparer_sp  rulepreparer,
unsigned int  bound 
)
private

Generates a new iterator for the given rule.

This iterator will use the given RulePreparer on every generated UQRuleInstance and will generate instances up to the given bound.

Parameters
rulethe rule to be used
rulepreparerthe RulePreparer to be used
boundthe bound up to which UQRuleInstances will be generated

Member Function Documentation

bool hasEnded ( )

Returns true, if this iterator has ended, i.e.

the last UQRuleInstance was already computed and returned.

Returns
true, if this iterator has ended
void loadNextRule ( bool  firstTime = false)
private

Drops the current UQRuleInstance and computes the next one if possible.

If there is no UQRuleInstance to compute, this iterator ends.

Parameters
firstTimeif this parameter is true, the internal iterator will no be incremented by this call; this is necessary in the first call of this function after initializing the iterator
UQRuleInstance_sp operator* ( )

Returns the last UQRuleInstance computed by this iterator (i.e.

by the last ++ call). The returned UQRuleInstance can be used and modified freely, without affecting the this iterator. However, this iterator keeps a pointer to the UQRuleInstance and will return this pointer in any subsequent * call, as long as the iterator was not incremented again. If the iterator ended, this operator will return a null pointer.

Returns
the last computed UQRuleInstance
PreparedGTS::uqinst_iterator & operator++ ( )

Computes the next UQRuleInstance of the UQRule corresponding to this iterator.

Returns
a reference to this iterator
unsigned int sumCurrentQuant ( )
private

Sums up how much instantiations will be performed when using the current value of currentQuant.

The sum computed by this function may not exceed the defined bound.

Returns
how much instantiations will be performed when using the current value of currentQuant

Member Data Documentation

vector<graphs::UQRuleInstance_sp>* currentInstances
private

Stores the UQRuleInstances generated by preparing a last computed UQRuleInstance.

These instances will be returned one after the other before computing the next UQRuleInstance.


The documentation for this class was generated from the following files: