UnCoVer (Using Coverability for Verification)
|
This class imports GXL or GTXL XML files and converts them to Hypergraph and GTS objects respectively. More...
#include <GTXLReaderXerces.h>
Public Member Functions | |
GTXLReaderXerces () | |
Creates a new GTXLReaderXerces object, which includes initialization of the Xerces framework. More... | |
virtual | ~GTXLReaderXerces () |
Destroys the GTXLReaderXerces object. More... | |
virtual shared_ptr< vector < graphs::Hypergraph_sp > > | readGXL (string filename, unordered_map< IDType, IDType > *oldIDs) const override |
This method takes a path to a GXL XML-file and reads all hypergraphs stored in it. More... | |
virtual graphs::GTS_sp | readGTXL (string filename, unordered_map< IDType, IDType > *oldRuleIDs=nullptr, unordered_map< IDType, IDType > *oldGraphIDs=nullptr) const override |
This method takes a path to a GTXL XML-file and reads the stored GTS. More... | |
bool | areWarningsShown () |
Returns true, iff warnings will be logged when they occur. More... | |
void | setWarningsShown (bool show) |
Sets whether warning will be logged when they occur. More... | |
Static Public Member Functions | |
static GTXLReader * | newReader () |
Use this method to generate a new GTXLReader object. More... | |
static unique_ptr< GTXLReader > | newUniqueReader () |
Use this method to generate a new GTXLReader object. More... | |
Protected Attributes | |
bool | showWarnings |
Specifies whether warnings for ignored XML nodes and attributes should be displayed or not. | |
Private Types | |
typedef unordered_map< string, unordered_set< IDType > > | QuantMap |
Alias for a map, mapping every quantification name to the set of ID of which it consists. | |
typedef std::tuple < graphs::Rule_sp, GTXLReaderXerces::QuantMap, GTXLReaderXerces::QuantMap > | RuleTriple |
Alias for a triple consisting of a rule (first element) and two QuantMaps for the left rule side (second element) and the right rule side (third element). | |
Private Member Functions | |
void | convertToQuant (graphs::UQRule &rule, unordered_set< IDType > const &leftQuant, unordered_set< IDType > const &rightQuant) const |
Takes the given UQRule and generates a quantification consisting of all specified element in the left and right sides. More... | |
pair< graphs::Hypergraph_sp, unordered_map< string, IDType > > | readHypergraph (xercesc::DOMElement *graphroot, unordered_map< IDType, IDType > *oldIDs=nullptr) const |
This method takes a DOMElement object and tries to extract a Hypergraph out of it. More... | |
pair < graphs::AnonHypergraph_sp, unordered_map< string, IDType > > | readAnonHypergraph (xercesc::DOMElement *graphroot) const |
This method takes a DOMElement object and tries to extract an AnonHypergraph out of it. More... | |
void | readAnonHypergraph (xercesc::DOMElement *graphroot, unordered_map< IDType, IDType > *oldIDs, graphs::AnonHypergraph &graph, IDType const &graphID, unordered_map< string, IDType > &strToID) const |
This method serves as an implementation of both the readHypergraph(..,..) and the readAnonHypergraph(..) functions, filling all parameters given, with exception of the first, with data read from the given XML node. More... | |
GTXLReaderXerces::RuleTriple | readRule (xercesc::DOMElement *ruleroot, unordered_map< IDType, IDType > *oldIDs=nullptr) const |
This method takes a DOMElement object and tries to extract a Rule out of it. More... | |
void | readQuantMap (xercesc::DOMElement *root, GTXLReaderXerces::QuantMap &quantMap, unordered_map< string, IDType > &idMap) const |
Takes a 'quantification' XML element and extracts the QuantMap from it. More... | |
void | checkConsistency (const graphs::Mapping &match, const graphs::Hypergraph &left, const graphs::Hypergraph &right) const |
Checks if the input parameters form a correct and consistent Rule. More... | |
void | checkConsistency (graphs::Rule const &rule, GTXLReaderXerces::QuantMap &leftQuantMap, GTXLReaderXerces::QuantMap &rightQuantMap) const |
Checks if a consistent UQRule can be generated from the given Rule and QuantMaps. More... | |
void | checkConsistency (graphs::AnonHypergraph const &graph, GTXLReaderXerces::QuantMap const &quantMap) const |
Checks if the given partition of the given graph into quantifications is consistent. More... | |
bool | isEqualIgnoringCase2 (const XMLCh *lowerCase, const XMLCh *notLowerCase) const |
Checks if the two strings are equal. More... | |
This class imports GXL or GTXL XML files and converts them to Hypergraph and GTS objects respectively.
Xerces is used as underlying Framework.
GTXLReaderXerces | ( | ) |
Creates a new GTXLReaderXerces object, which includes initialization of the Xerces framework.
No additional initialization is needed.
|
virtual |
Destroys the GTXLReaderXerces object.
This also frees all resources reserved for Xerces.
|
inherited |
Returns true, iff warnings will be logged when they occur.
|
private |
Checks if the input parameters form a correct and consistent Rule.
Existence of mapped IDs is checked as well as the morphism property. An exception is thrown if the check is not successful.
mapping | a reference to the mapping to be checked |
left | a pointer to the left graph of the Match |
right | a pointer to the right graph of the Match |
XMLioException | if the given parameters form no correct Rule object |
|
private |
Checks if a consistent UQRule can be generated from the given Rule and QuantMaps.
An exception is thrown if the check is not successful.
rule | the rule for which consistency should be checked |
leftQuantMap | a mapping of all quantifications to the IDs of which they consist in the left rule side |
rightQuantMap | a mapping of all quantifications to the IDs of which they consist in the right rule side |
|
private |
Checks if the given partition of the given graph into quantifications is consistent.
An exception is thrown if the check is not successful.
graph | the graph to be checked |
quantMap | a mapping of all quantifications to the IDs of which they consist |
|
private |
Takes the given UQRule and generates a quantification consisting of all specified element in the left and right sides.
The elements with IDs specified by 'leftQuant' and 'rightQuant' are moved from the core rule of the given UQRule into a new quantification (deleting parts of the core rule). The mapping of the quantification is implicitly given by the core rule (and deleted from it in the process).
rule | the UQRule for which the quantification should be generated |
leftQuant | the set of IDs of which the left quantification side will consist |
rightQuant | the set of IDs of which the right quantification side will consist |
|
inlineprivate |
Checks if the two strings are equal.
The first string is assumed to be lower case, while upper case symbols of the second string will be treated as if they where lower case.
lowerCase | a string containing only lower case symbols |
notLowerCase | a string containing lower and/or upper case symbols |
|
staticinherited |
Use this method to generate a new GTXLReader object.
No initialization is needed before use.
|
staticinherited |
Use this method to generate a new GTXLReader object.
No initialization is needed before use.
|
private |
This method takes a DOMElement object and tries to extract an AnonHypergraph out of it.
The given DOMElement has to be the root element of a 'graph' node specified by the GXL definition. Additionally to a pointer to the extracted AnonHypergraph, a mapping of the IDs used in the XML file to the internal IDs of the Hypergraph, is returned.
graphroot | a DOMElement object containing the root element of a 'graph' |
exceptions::XMLioException | if the given DOMElement is not a correct graph |
|
private |
This method serves as an implementation of both the readHypergraph(..,..) and the readAnonHypergraph(..) functions, filling all parameters given, with exception of the first, with data read from the given XML node.
The given DOMElement has to be the root element of a 'graph' node specified by the GXL definition. If the oldIDs parameter in not null, the old ID stored in the 'graph' XML node is read and the graphs new ID is mapped to it. The read graph is stored into the given graph parameter. The given graphID is only used if oldIDs is not null (as key in the mapping). In the strToID parameter all XML IDs of vertices and edges are mapped to their IDs in the read graph.
graphroot | a DOMElement object containing the root element of a 'graph' |
oldIDs | if given, the read graphs new ID is mapped to the old (stored) ID |
graph | the graph to which the read data is stored |
graphID | the ID of the given graph, if it is not an anonymous graph (ignored if oldIDs is null) |
strToID | every XML ID of a vertex or edge with be mapped by this map to their ID in the read graph |
exceptions::XMLioException | if the given DOMElement is not a correct graph |
|
overridevirtual |
This method takes a path to a GTXL XML-file and reads the stored GTS.
filename | a complete path to a GTXL file |
oldRuleIDs | if given, this map will be filled with pairs of rule IDs mapped to (old) IDs read from the input files |
oldGraphIDs | if given, this map will be filled with pairs of graph IDs mapped to (old) IDs read from the input files |
io::XMLioException | if the specified file is not found or erroneous |
Implements GTXLReader.
|
overridevirtual |
This method takes a path to a GXL XML-file and reads all hypergraphs stored in it.
filename | a complete path to a GXL file |
oldIDs | if given, this map will be filled with pairs of graph IDs mapped to (old) IDs read from the input files |
io::XMLioException | if the specified file is not found or erroneous |
Implements GTXLReader.
|
private |
This method takes a DOMElement object and tries to extract a Hypergraph out of it.
The given DOMElement has to be the root element of a 'graph' node specified by the GXL definition. Additionally to a pointer to the extracted Hypergraph, a mapping of the IDs used in the XML file to the internal IDs of the Hypergraph, is returned.
graphroot | a DOMElement object containing the root element of a 'graph' |
oldIDs | if given, the read graphs new ID is mapped to the old (stored) ID |
exceptions::XMLioException | if the given DOMElement is not a correct Hypergraph |
|
private |
Takes a 'quantification' XML element and extracts the QuantMap from it.
root | the 'quantification' XML element |
quantMap | the QuantMap in which the read entries will be stored |
idMap | a mapping from the XML IDs to IDs of the graph on which the quantification is defined |
|
private |
This method takes a DOMElement object and tries to extract a Rule out of it.
The given DOMElement has to be the root element of a 'rule' node specified by the GTXL definition.
ruleroot | a DOMElement object containing the root element of a 'rule' |
oldIDs | if given, the read rules new ID is mapped to the old (stored) ID |
exceptions::XMLioException | if the given DOMElement is not a correct Rule |
|
inherited |
Sets whether warning will be logged when they occur.
show | set to true, if warnings should be logged |