20 #ifndef PREPAREDGTS_H_
21 #define PREPAREDGTS_H_
23 #include "../graphs/GTS.h"
24 #include "RulePreparer.h"
25 #include "../graphs/UQRuleInstance.h"
unordered_map< IDType, vector< size_t > > uqRuleLengths
For each ID of a UQRule (key) this map stores a vector of positions (value).
Definition: PreparedGTS.h:221
The StdRuleMapCB is a helper class defining a CollectionCallback to a PreparedGTS standard rule map...
Definition: PreparedGTS.h:231
void loadNextRule(bool firstTime=false)
Drops the current UQRuleInstance and computes the next one if possible.
Definition: PreparedGTS.cpp:179
bool addStdRule(Rule_sp rule)
Adds the given Rule to the standard rules of this GTS.
Definition: GTS.cpp:41
graphs::UQRule_sp rule
Stores the UQRule used by this iterator.
Definition: PreparedGTS.h:122
PreparedGTS(GTS const >s, RulePreparer_sp rulePrep, bool opt=true)
Creates a Prepared GTS using the given GTS and RulePreparer.
Definition: PreparedGTS.cpp:33
map< IDType, vector< IDType > > prepFrom
Stores for every new (prepared) rule the ID of the original rules from which it was prepared...
Definition: PreparedGTS.h:203
RulePreparer_sp rulePreparer
Stores the RulePreparer used by this iterator.
Definition: PreparedGTS.h:127
IDType currentRuleID
Stores an ID which will be set as the original rule ID from which any rules added by insert(...
Definition: PreparedGTS.h:275
StdRuleMapCB(PreparedGTS >s)
Creates a new CollectionCallback to the given PreparedGTS standard rule map.
Definition: PreparedGTS.h:239
vector< unsigned int > * currentQuant
Stores a count for each Quantification of the UQRule storing how often each Quantification will be us...
Definition: PreparedGTS.h:133
shared_ptr< RulePreparer > RulePreparer_sp
Alias for a shared pointer of a RulePreparer.
Definition: RulePreparer.h:105
shared_ptr< Rule > Rule_sp
Alias for a shared pointer to a Rule.
Definition: Rule.h:105
void createInstancesUpTo(IDType const &ruleID, size_t bound)
Creates and stores all UQRuleInstances for the given UQRule up to the given bound.
Definition: PreparedGTS.cpp:108
unsigned int sumCurrentQuant()
Sums up how much instantiations will be performed when using the current value of currentQuant...
Definition: PreparedGTS.cpp:223
uqinst_iterator(PreparedGTS::uqinst_iterator &&old)
Move constructor.
Definition: PreparedGTS.cpp:146
shared_ptr< UQRuleInstance > UQRuleInstance_sp
Alias of a shared pointer to a UQRuleIstance.
Definition: UQRuleInstance.h:139
shared_ptr< PreparedGTS const > PreparedGTS_csp
Alias of a shared pointer to a constant PreparedGTS.
Definition: PreparedGTS.h:289
unsigned int bound
Stores the bound to which UQRuleInstances are generated.
Definition: PreparedGTS.h:144
PreparedGTS::uqinst_iterator & operator++()
Computes the next UQRuleInstance of the UQRule corresponding to this iterator.
Definition: PreparedGTS.cpp:232
shared_ptr< vector< graphs::AnonRule_csp > > getOriginalRules(IDType id) const
Creates a new collection which contains all original rules from which the prepared rule with the give...
Definition: PreparedGTS.cpp:75
This template provides a possibility to add elements to a collection without having a reference to th...
Definition: CollectionCallback.h:34
vector< graphs::UQRuleInstance_sp > * currentInstances
Stores the UQRuleInstances generated by preparing a last computed UQRuleInstance. ...
Definition: PreparedGTS.h:139
PreparedGTS::uqinst_iterator beginUQInstances(IDType const &ruleID, graphs::Hypergraph const &graph)
Creates and returns an iterator, iterating over all UQRuleInstances of the UQRule with the given ID...
Definition: PreparedGTS.cpp:95
RulePreparer_sp rulePreparer
Stores the RulePreparer used by this PreparedGTS.
Definition: PreparedGTS.h:208
virtual ~PreparedGTS()
Destroys this PreparedGTS.
Definition: PreparedGTS.cpp:72
A Hypergraph represents a graph with a unique identifier.
Definition: Hypergraph.h:35
virtual void insert(graphs::Rule_sp rule)
Adds the given Rule to the standard rule map of the PreparedGTS.
Definition: PreparedGTS.h:251
The uqinst_iterator generates UQRuleInstances for backward application.
Definition: PreparedGTS.h:52
shared_ptr< UQRule > UQRule_sp
Alias for a shared pointer to a UQRule.
Definition: UQRule.h:261
graphs::UQRuleInstance_sp operator*()
Returns the last UQRuleInstance computed by this iterator (i.e.
Definition: PreparedGTS.cpp:237
const RuleMap oldStdRules
Stores the RuleMap containing the (unprepared) rules of the original GTS.
Definition: PreparedGTS.h:196
unordered_map< IDType, Rule_sp > RuleMap
An alias for the map storing standard rules.
Definition: GTS.h:44
bool hasEnded()
Returns true, if this iterator has ended, i.e.
Definition: PreparedGTS.cpp:245
void setCurrentRuleID(IDType id)
Sets the ID of the rule which was used to generate any subsequently added (prepared) rules (until the...
Definition: PreparedGTS.h:260
The GTS class is the data structure for a graph transformation system.
Definition: GTS.h:36
unordered_map< IDType, vector< graphs::UQRuleInstance_sp > > uqRuleInstances
For each ID of a UQRule (key) this map stores all UQRuleInstances (value) generated for the correspon...
Definition: PreparedGTS.h:214
~uqinst_iterator()
Destroys this iterator.
Definition: PreparedGTS.cpp:174
GTS(string name="", RuleMap const &rules=(RuleMap()), UQRuleMap const &uqRules=(UQRuleMap()), vector< Hypergraph_sp > const &initialGraphs=vector< Hypergraph_sp >())
Generates a new GTS with the given name, standard rule set, quantified rule set and initial graphs...
Definition: GTS.cpp:29
PreparedGTS & gts
Stores a reference to the PreparedGTS to which Rules will be added by this callback.
Definition: PreparedGTS.h:269
The PreparedGTS class represents a graph transformation system that was prepared for use in the backw...
Definition: PreparedGTS.h:40
shared_ptr< PreparedGTS > PreparedGTS_sp
Alias of a shared pointer to a PreparedGTS.
Definition: PreparedGTS.h:284
unsigned int IDType
IDType is an (unsigned) integer specifically used as an Identifier of graphs, elements of graphs or a...
Definition: globals.h:53
virtual ~StdRuleMapCB()
Destroys this StdRuleMapCB, not affecting the references PreparedGTS.
Definition: PreparedGTS.h:244