From 76bc502b4cdbc51cf2d54cd067c7377a28f815c0 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Sun, 24 May 2015 21:56:47 +0200 Subject: [PATCH] -rankedBarSymbol refactor rankedSymbol --- .../src/tree/generate/RandomTreeFactory.cpp | 6 +- alib2data/src/XmlApi.cpp | 17 - alib2data/src/XmlApi.hpp | 9 - alib2data/src/alphabet/NextSymbol.cpp | 8 - alib2data/src/alphabet/NextSymbol.h | 1 - alib2data/src/alphabet/RankedBarSymbol.cpp | 44 -- alib2data/src/alphabet/RankedBarSymbol.h | 65 -- alib2data/src/alphabet/RankedSymbol.cpp | 18 +- alib2data/src/alphabet/RankedSymbol.h | 7 +- .../src/alphabet/SymbolFromXMLParser.cpp | 16 +- alib2data/src/alphabet/SymbolFromXMLParser.h | 2 - .../src/alphabet/SymbolToStringComposer.cpp | 10 +- .../src/alphabet/SymbolToStringComposer.h | 1 - .../src/alphabet/SymbolToXMLComposer.cpp | 8 +- alib2data/src/alphabet/SymbolToXMLComposer.h | 1 - alib2data/src/object/ObjectBase.h | 3 +- alib2data/src/tree/TreeFromRawParser.cpp | 4 +- alib2data/src/tree/TreeFromXMLParser.cpp | 10 +- alib2data/src/tree/TreeFromXMLParser.h | 2 +- alib2data/src/tree/TreeToXMLComposer.cpp | 6 +- alib2data/src/tree/TreeToXMLComposer.h | 2 +- .../src/tree/common/UnrankedAlphabet.cpp | 14 +- alib2data/src/tree/common/UnrankedAlphabet.h | 14 +- alib2data/src/tree/ranked/RankedNode.cpp | 4 +- alib2data/src/tree/unranked/UnrankedNode.cpp | 17 +- alib2data/src/tree/unranked/UnrankedNode.h | 14 +- alib2data/src/tree/unranked/UnrankedTree.cpp | 6 +- alib2data/src/tree/unranked/UnrankedTree.h | 4 +- alib2data/test-src/tree/TreeTest.cpp | 40 +- examples2/automaton/DFTA.xml | 651 +++++++++++++++++- examples2/automaton/NFTA.xml | 162 ++++- examples2/tree/RankedTree.xml | 14 + examples2/tree/RankedTree2.xml | 26 + 33 files changed, 942 insertions(+), 264 deletions(-) delete mode 100644 alib2data/src/alphabet/RankedBarSymbol.cpp delete mode 100644 alib2data/src/alphabet/RankedBarSymbol.h diff --git a/alib2algo/src/tree/generate/RandomTreeFactory.cpp b/alib2algo/src/tree/generate/RandomTreeFactory.cpp index 678ac462de..49824cbc87 100644 --- a/alib2algo/src/tree/generate/RandomTreeFactory.cpp +++ b/alib2algo/src/tree/generate/RandomTreeFactory.cpp @@ -99,7 +99,7 @@ struct Node { children.push_back(nextChild -> createUnrankedNode()); nextChild = nextChild -> right; } - return new UnrankedNode(alphabet::LabeledSymbol(symbol), children); + return new UnrankedNode(alphabet::symbolFrom(symbol), children); } RankedNode * createRankedNode() { @@ -207,9 +207,9 @@ UnrankedTree RandomTreeFactory::generateUnrankedTree(int depth, int nodesCount, std::vector<char> alphabet = generateUnrankedAlphabet(maxAlphabetSize, randomizedAlphabet); root -> generateUnrankedSymbols(alphabet); - std::set<alphabet::LabeledSymbol> treeAlphabet; + std::set<alphabet::Symbol> treeAlphabet; for (std::vector<char>::iterator it = alphabet.begin(); it != alphabet.end(); ++it) { - treeAlphabet.insert(alphabet::LabeledSymbol(*it)); + treeAlphabet.insert(alphabet::symbolFrom(*it)); } UnrankedTree tree (treeAlphabet, *std::move(root -> createUnrankedNode())); delete root; diff --git a/alib2data/src/XmlApi.cpp b/alib2data/src/XmlApi.cpp index f475913d07..f769107bcd 100644 --- a/alib2data/src/XmlApi.cpp +++ b/alib2data/src/XmlApi.cpp @@ -49,7 +49,6 @@ const std::string Names::ALPHABET_BOTTOM_OF_THE_STACK_SYMBOL = "BottomOfTheStack const std::string Names::ALPHABET_END_SYMBOL = "EndSymbol"; const std::string Names::ALPHABET_RANKED_SYMBOL = "RankedSymbol"; const std::string Names::ALPHABET_BAR_SYMBOL = "BarSymbol"; -const std::string Names::ALPHABET_RANKED_BAR_SYMBOL = "RankedBarSymbol"; const std::string Names::ALPHABET_SUBTREE_WILDCARD_SYMBOL = "SubtreeWildcardSymbol"; const std::string Names::ALPHABET_SYMBOL_SET_SYMBOL = "SymbolSetSymbol"; const std::string Names::ALPHABET_SYMBOL_PAIR_SYMBOL = "SymbolPairSymbol"; @@ -303,18 +302,6 @@ void xmlApi<alphabet::BarSymbol>::compose(std::deque<sax::Token>& output, const ToXMLComposers::symbolComposer.compose(output, data); } -alphabet::RankedBarSymbol xmlApi<alphabet::RankedBarSymbol>::parse(std::deque<sax::Token>& input) { - return FromXMLParsers::symbolParser.parseRankedBarSymbol(input); -} - -bool xmlApi<alphabet::RankedBarSymbol>::first(const std::deque<sax::Token>& input) { - return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::ALPHABET_RANKED_BAR_SYMBOL); -} - -void xmlApi<alphabet::RankedBarSymbol>::compose(std::deque<sax::Token>& output, const alphabet::RankedBarSymbol& data) { - ToXMLComposers::symbolComposer.compose(output, data); -} - alphabet::SubtreeWildcardSymbol xmlApi<alphabet::SubtreeWildcardSymbol>::parse(std::deque<sax::Token>& input) { return FromXMLParsers::symbolParser.parseSubtreeWildcardSymbol(input); } @@ -1234,10 +1221,6 @@ void ToXMLComposers::Visit(void* data, const alphabet::BarSymbol& symbol) const xmlApi<alphabet::BarSymbol>::compose(*((std::deque<sax::Token>*) data), symbol); } -void ToXMLComposers::Visit(void* data, const alphabet::RankedBarSymbol& symbol) const { - xmlApi<alphabet::RankedBarSymbol>::compose(*((std::deque<sax::Token>*) data), symbol); -} - void ToXMLComposers::Visit(void* data, const alphabet::SubtreeWildcardSymbol& symbol) const { xmlApi<alphabet::SubtreeWildcardSymbol>::compose(*((std::deque<sax::Token>*) data), symbol); } diff --git a/alib2data/src/XmlApi.hpp b/alib2data/src/XmlApi.hpp index 6b646031bc..8fed15d19e 100644 --- a/alib2data/src/XmlApi.hpp +++ b/alib2data/src/XmlApi.hpp @@ -50,7 +50,6 @@ public: const static std::string ALPHABET_END_SYMBOL; const static std::string ALPHABET_RANKED_SYMBOL; const static std::string ALPHABET_BAR_SYMBOL; - const static std::string ALPHABET_RANKED_BAR_SYMBOL; const static std::string ALPHABET_SUBTREE_WILDCARD_SYMBOL; const static std::string ALPHABET_SYMBOL_PAIR_SYMBOL; const static std::string ALPHABET_SYMBOL_SET_SYMBOL; @@ -269,13 +268,6 @@ struct xmlApi<alphabet::BarSymbol> { static void compose(std::deque<sax::Token>& output, const alphabet::BarSymbol& data); }; -template<> -struct xmlApi<alphabet::RankedBarSymbol> { - static alphabet::RankedBarSymbol parse(std::deque<sax::Token>& input); - static bool first(const std::deque<sax::Token>& input); - static void compose(std::deque<sax::Token>& output, const alphabet::RankedBarSymbol& data); -}; - template<> struct xmlApi<alphabet::SubtreeWildcardSymbol> { static alphabet::SubtreeWildcardSymbol parse(std::deque<sax::Token>& input); @@ -837,7 +829,6 @@ private: void Visit(void*, const alphabet::EndSymbol& symbol) const; void Visit(void*, const alphabet::RankedSymbol& symbol) const; void Visit(void*, const alphabet::BarSymbol& symbol) const; - void Visit(void*, const alphabet::RankedBarSymbol& symbol) const; void Visit(void*, const alphabet::SubtreeWildcardSymbol& symbol) const; void Visit(void*, const alphabet::SymbolSetSymbol& label) const; void Visit(void*, const alphabet::SymbolPairSymbol& label) const; diff --git a/alib2data/src/alphabet/NextSymbol.cpp b/alib2data/src/alphabet/NextSymbol.cpp index 47e23c1f9a..7e44b3f31f 100644 --- a/alib2data/src/alphabet/NextSymbol.cpp +++ b/alib2data/src/alphabet/NextSymbol.cpp @@ -10,7 +10,6 @@ #include "../primitive/NextPrimitive.h" #include "LabeledSymbol.h" #include "RankedSymbol.h" -#include "RankedBarSymbol.h" #include "SymbolPairSymbol.h" #include "SymbolSetSymbol.h" #include "UniqueSymbol.h" @@ -72,13 +71,6 @@ void NextSymbol::Visit(void* userData, const BarSymbol& symbol) { out = new Symbol(UniqueSymbol(Symbol(symbol), newId)); } -void NextSymbol::Visit(void* userData, const RankedBarSymbol& symbol) { - Symbol* &out = *((Symbol**) userData); - - primitive::Integer newId(0); - out = new Symbol(UniqueSymbol(Symbol(symbol), newId)); -} - void NextSymbol::Visit(void* userData, const SubtreeWildcardSymbol& symbol) { Symbol* &out = *((Symbol**) userData); diff --git a/alib2data/src/alphabet/NextSymbol.h b/alib2data/src/alphabet/NextSymbol.h index b581cb0286..c3e7bf51f0 100644 --- a/alib2data/src/alphabet/NextSymbol.h +++ b/alib2data/src/alphabet/NextSymbol.h @@ -25,7 +25,6 @@ class NextSymbol : public VisitableSymbolBase::visitor_type { void Visit(void*, const StartSymbol& symbol); void Visit(void*, const RankedSymbol& symbol); void Visit(void*, const BarSymbol& symbol); - void Visit(void*, const RankedBarSymbol& symbol); void Visit(void*, const SubtreeWildcardSymbol& symbol); void Visit(void*, const SymbolPairSymbol& symbol); void Visit(void*, const SymbolSetSymbol& symbol); diff --git a/alib2data/src/alphabet/RankedBarSymbol.cpp b/alib2data/src/alphabet/RankedBarSymbol.cpp deleted file mode 100644 index de3ef5be6b..0000000000 --- a/alib2data/src/alphabet/RankedBarSymbol.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * RankedBarSymbol.cpp - * - * Created on: Apr 10, 2013 - * Author: Jan Travnicek - */ - -#include "RankedBarSymbol.h" - -namespace alphabet { - -RankedBarSymbol::RankedBarSymbol(int rank) : rank(primitive::Unsigned(rank)) { - -} - -RankedBarSymbol::RankedBarSymbol(primitive::Unsigned rank) : rank(std::move(rank)) { - -} - -SymbolBase* RankedBarSymbol::clone() const { - return new RankedBarSymbol(*this); -} - -SymbolBase* RankedBarSymbol::plunder() && { - return new RankedBarSymbol(std::move(*this)); -} - -const primitive::Unsigned& RankedBarSymbol::getRank() const { - return rank; -} - -int RankedBarSymbol::compare(const RankedBarSymbol&) const { - return 0; -} - -void RankedBarSymbol::operator>>(std::ostream& out) const { - out << "(RankedBar symbol)"; -} - -RankedBarSymbol::operator std::string () const { - return "|"; -} - -} /* namespace alphabet */ diff --git a/alib2data/src/alphabet/RankedBarSymbol.h b/alib2data/src/alphabet/RankedBarSymbol.h deleted file mode 100644 index f285c1543a..0000000000 --- a/alib2data/src/alphabet/RankedBarSymbol.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * RankedBarSymbol.h - * - * Created on: Apr 10, 2013 - * Author: Jan Travnicek - */ - -#ifndef RANKED_BAR_SYMBOL_H_ -#define RANKED_BAR_SYMBOL_H_ - -#include "Symbol.h" -#include "../primitive/Unsigned.h" - -namespace alphabet { - -/** - * Represents rankedBar symbol for tree linearization. - */ -class RankedBarSymbol : public std::acceptor<RankedBarSymbol, VisitableSymbolBase, std::acceptor<RankedBarSymbol, alib::VisitableObjectBase, SymbolBase> > { - primitive::Unsigned rank; -public: - /** - * Creates a rankedBar symbol. - * @param symbol name of the symbol - */ - explicit RankedBarSymbol(int rank); - explicit RankedBarSymbol(primitive::Unsigned rank); - - virtual SymbolBase* clone() const; - virtual SymbolBase* plunder() &&; - - /** - * @return rank of the symbol - */ - const primitive::Unsigned& getRank() const; - - virtual int compare(const ObjectBase& other) const { - return -other.compare(*this); - } - - virtual int compare(const RankedBarSymbol& other) const; - - virtual void operator>>(std::ostream& out) const; - - virtual explicit operator std::string () const; - - virtual int selfTypeId() const { - return typeId(*this); - } -}; - -} /* namespace alphabet */ - -namespace std { - -template<> -struct compare<alphabet::RankedBarSymbol> { - int operator()(const alphabet::RankedBarSymbol& first, const alphabet::RankedBarSymbol& second) const { - return first.compare(second); - } -}; - -} /* namespace std */ - -#endif /* RANKED_BAR_SYMBOL_H_ */ diff --git a/alib2data/src/alphabet/RankedSymbol.cpp b/alib2data/src/alphabet/RankedSymbol.cpp index 7021c0cbbb..68f30a69cc 100644 --- a/alib2data/src/alphabet/RankedSymbol.cpp +++ b/alib2data/src/alphabet/RankedSymbol.cpp @@ -9,19 +9,19 @@ namespace alphabet { -RankedSymbol::RankedSymbol(int number, int rank) : label(label::labelFrom(number)), rank(primitive::Unsigned(rank)) { +RankedSymbol::RankedSymbol(int number, int rank) : symbol(alphabet::symbolFrom(number)), rank(primitive::Unsigned(rank)) { } -RankedSymbol::RankedSymbol(char character, int rank) : label(label::labelFrom(character)), rank(primitive::Unsigned(rank)) { +RankedSymbol::RankedSymbol(char character, int rank) : symbol(alphabet::symbolFrom(character)), rank(primitive::Unsigned(rank)) { } -RankedSymbol::RankedSymbol(std::string label, int rank) : label(label::labelFrom(std::move(label))), rank(primitive::Unsigned(rank)) { +RankedSymbol::RankedSymbol(std::string symbol, int rank) : symbol(alphabet::symbolFrom(std::move(symbol))), rank(primitive::Unsigned(rank)) { } -RankedSymbol::RankedSymbol(label::Label label, primitive::Unsigned rank) : label(std::move(label)), rank(std::move(rank)) { +RankedSymbol::RankedSymbol(alphabet::Symbol symbol, primitive::Unsigned rank) : symbol(std::move(symbol)), rank(std::move(rank)) { } @@ -33,8 +33,8 @@ SymbolBase* RankedSymbol::plunder() && { return new RankedSymbol(std::move(*this)); } -const label::Label& RankedSymbol::getLabel() const { - return label; +const alphabet::Symbol& RankedSymbol::getSymbol() const { + return symbol; } const primitive::Unsigned& RankedSymbol::getRank() const { @@ -42,17 +42,17 @@ const primitive::Unsigned& RankedSymbol::getRank() const { } int RankedSymbol::compare(const RankedSymbol& other) const { - int res = this->label.getData().compare(other.label.getData()); + int res = this->symbol.getData().compare(other.symbol.getData()); if(res == 0) res = this->rank.compare(other.rank); return res; } void RankedSymbol::operator>>(std::ostream& out) const { - out << "(RankedSymbol " << label << " #" << rank << ")"; + out << "(RankedSymbol " << symbol << " #" << rank << ")"; } RankedSymbol::operator std::string () const { - return (std::string) label + "_" + (std::string) rank; + return (std::string) symbol + "_" + (std::string) rank; } } /* namespace alphabet */ diff --git a/alib2data/src/alphabet/RankedSymbol.h b/alib2data/src/alphabet/RankedSymbol.h index d1591ae9ea..f9ccfe08f8 100644 --- a/alib2data/src/alphabet/RankedSymbol.h +++ b/alib2data/src/alphabet/RankedSymbol.h @@ -10,6 +10,7 @@ #include "../label/Label.h" #include "SymbolBase.h" +#include "Symbol.h" #include <ostream> #include "../primitive/Unsigned.h" @@ -20,7 +21,7 @@ namespace alphabet { */ class RankedSymbol : public std::acceptor<RankedSymbol, VisitableSymbolBase, std::acceptor<RankedSymbol, alib::VisitableObjectBase, SymbolBase> > { protected: - label::Label label; + alphabet::Symbol symbol; primitive::Unsigned rank; public: @@ -33,7 +34,7 @@ public: * @param symbol name of the symbol * @param rank of the symbol */ - explicit RankedSymbol(label::Label label, primitive::Unsigned rank); + explicit RankedSymbol(alphabet::Symbol symbol, primitive::Unsigned rank); virtual SymbolBase* clone() const; virtual SymbolBase* plunder() &&; @@ -41,7 +42,7 @@ public: /** * @return name of the symbol */ - const label::Label& getLabel() const; + const alphabet::Symbol& getSymbol() const; /** * @return rank of the symbol diff --git a/alib2data/src/alphabet/SymbolFromXMLParser.cpp b/alib2data/src/alphabet/SymbolFromXMLParser.cpp index a2499534c3..58578b6901 100644 --- a/alib2data/src/alphabet/SymbolFromXMLParser.cpp +++ b/alib2data/src/alphabet/SymbolFromXMLParser.cpp @@ -40,9 +40,6 @@ Symbol SymbolFromXMLParser::parseSymbol(std::deque<sax::Token>& input, const std } else if(alib::xmlApi<BarSymbol>::first(input)) { if(!features.count(FEATURES::BAR)) throw exception::AlibException(); return Symbol(parseBarSymbol(input)); - } else if(alib::xmlApi<RankedBarSymbol>::first(input)) { - if(!features.count(FEATURES::RANKED_BAR)) throw exception::AlibException(); - return Symbol(parseRankedBarSymbol(input)); } else if(alib::xmlApi<SubtreeWildcardSymbol>::first(input)) { if(!features.count(FEATURES::SUBTREE_WILDCARD)) throw exception::AlibException(); return Symbol(parseSubtreeWildcardSymbol(input)); @@ -56,12 +53,12 @@ Symbol SymbolFromXMLParser::parseSymbol(std::deque<sax::Token>& input, const std if(!features.count(FEATURES::UNIQUE_SYMBOL)) throw exception::AlibException(); return Symbol(parseUniqueSymbol(input)); } else { - throw sax::ParserException(sax::Token("LabeledSymbol, BlankSymbol, BottomOfTheStackSymbol, EndSymbol, StartSymbol, RankedSymbol, BarSymbol, RankedBarSymbol, SubtreeWildcardSymbol, SymbolPairSymbol, SymbolSetSymbol, UniqueSymbol", sax::Token::TokenType::START_ELEMENT), input.front()); + throw sax::ParserException(sax::Token("LabeledSymbol, BlankSymbol, BottomOfTheStackSymbol, EndSymbol, StartSymbol, RankedSymbol, BarSymbol, SubtreeWildcardSymbol, SymbolPairSymbol, SymbolSetSymbol, UniqueSymbol", sax::Token::TokenType::START_ELEMENT), input.front()); } } bool SymbolFromXMLParser::first(const std::deque<sax::Token>& input) const { - if(alib::xmlApi<LabeledSymbol>::first(input) || alib::xmlApi<BlankSymbol>::first(input) || alib::xmlApi<BottomOfTheStackSymbol>::first(input) || alib::xmlApi<EndSymbol>::first(input) || alib::xmlApi<StartSymbol>::first(input) || alib::xmlApi<RankedSymbol>::first(input) || alib::xmlApi<BarSymbol>::first(input) || alib::xmlApi<RankedBarSymbol>::first(input) || alib::xmlApi<SubtreeWildcardSymbol>::first(input) || alib::xmlApi<SymbolPairSymbol>::first(input) || alib::xmlApi<SymbolSetSymbol>::first(input)) { + if(alib::xmlApi<LabeledSymbol>::first(input) || alib::xmlApi<BlankSymbol>::first(input) || alib::xmlApi<BottomOfTheStackSymbol>::first(input) || alib::xmlApi<EndSymbol>::first(input) || alib::xmlApi<StartSymbol>::first(input) || alib::xmlApi<RankedSymbol>::first(input) || alib::xmlApi<BarSymbol>::first(input) || alib::xmlApi<SubtreeWildcardSymbol>::first(input) || alib::xmlApi<SymbolPairSymbol>::first(input) || alib::xmlApi<SymbolSetSymbol>::first(input)) { return true; } else { return false; @@ -101,7 +98,7 @@ StartSymbol SymbolFromXMLParser::parseStartSymbol(std::deque<sax::Token>& input) RankedSymbol SymbolFromXMLParser::parseRankedSymbol(std::deque<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, alib::Names::ALPHABET_RANKED_SYMBOL); - label::Label data = alib::xmlApi<label::Label>::parse(input); + alphabet::Symbol data = alib::xmlApi<alphabet::Symbol>::parse(input); primitive::Unsigned rank = alib::xmlApi<primitive::Unsigned>::parse(input); popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::ALPHABET_RANKED_SYMBOL); return RankedSymbol(std::move(data), std::move(rank)); @@ -113,13 +110,6 @@ BarSymbol SymbolFromXMLParser::parseBarSymbol(std::deque<sax::Token>& input) con return BarSymbol(); } -RankedBarSymbol SymbolFromXMLParser::parseRankedBarSymbol(std::deque<sax::Token>& input) const { - popToken(input, sax::Token::TokenType::START_ELEMENT, alib::Names::ALPHABET_RANKED_BAR_SYMBOL); - primitive::Unsigned rank = alib::xmlApi<primitive::Unsigned>::parse(input); - popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::ALPHABET_RANKED_BAR_SYMBOL); - return RankedBarSymbol(std::move(rank)); -} - SubtreeWildcardSymbol SymbolFromXMLParser::parseSubtreeWildcardSymbol(std::deque<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, alib::Names::ALPHABET_SUBTREE_WILDCARD_SYMBOL); popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::ALPHABET_SUBTREE_WILDCARD_SYMBOL); diff --git a/alib2data/src/alphabet/SymbolFromXMLParser.h b/alib2data/src/alphabet/SymbolFromXMLParser.h index 9a8ac474f0..0dfa598c3a 100644 --- a/alib2data/src/alphabet/SymbolFromXMLParser.h +++ b/alib2data/src/alphabet/SymbolFromXMLParser.h @@ -23,7 +23,6 @@ #include "LabeledSymbol.h" #include "RankedSymbol.h" #include "BarSymbol.h" -#include "RankedBarSymbol.h" #include "SubtreeWildcardSymbol.h" #include "SymbolPairSymbol.h" #include "SymbolSetSymbol.h" @@ -56,7 +55,6 @@ private: StartSymbol parseStartSymbol(std::deque<sax::Token>& input) const; RankedSymbol parseRankedSymbol(std::deque<sax::Token>& input) const; BarSymbol parseBarSymbol(std::deque<sax::Token>& input) const; - RankedBarSymbol parseRankedBarSymbol(std::deque<sax::Token>& input) const; SubtreeWildcardSymbol parseSubtreeWildcardSymbol(std::deque<sax::Token>& input) const; SymbolPairSymbol parseSymbolPairSymbol(std::deque<sax::Token>& input) const; SymbolSetSymbol parseSymbolSetSymbol(std::deque<sax::Token>& input) const; diff --git a/alib2data/src/alphabet/SymbolToStringComposer.cpp b/alib2data/src/alphabet/SymbolToStringComposer.cpp index 9203f88505..e944bb41e2 100644 --- a/alib2data/src/alphabet/SymbolToStringComposer.cpp +++ b/alib2data/src/alphabet/SymbolToStringComposer.cpp @@ -8,7 +8,6 @@ #include "SymbolToStringComposer.h" #include "LabeledSymbol.h" #include "RankedSymbol.h" -#include "RankedBarSymbol.h" #include "SymbolPairSymbol.h" #include "SymbolSetSymbol.h" #include "UniqueSymbol.h" @@ -50,7 +49,7 @@ void SymbolToStringComposer::Visit(void* userData, const StartSymbol&) const { void SymbolToStringComposer::Visit(void* userData, const RankedSymbol& symbol) const { std::ostream &out = *((std::ostream*) userData); - alib::stringApi<label::Label>::compose(out, symbol.getLabel()); + alib::stringApi<alphabet::Symbol>::compose(out, symbol.getSymbol()); alib::stringApi<primitive::Primitive>::compose(out, primitive::Primitive(symbol.getRank())); } @@ -60,13 +59,6 @@ void SymbolToStringComposer::Visit(void* userData, const BarSymbol&) const { out << "#|"; } -void SymbolToStringComposer::Visit(void* userData, const RankedBarSymbol& symbol) const { - std::ostream &out = *((std::ostream*) userData); - - out << "#|"; - alib::stringApi<primitive::Primitive>::compose(out, primitive::Primitive(symbol.getRank())); -} - void SymbolToStringComposer::Visit(void* userData, const SubtreeWildcardSymbol&) const { std::ostream &out = *((std::ostream*) userData); diff --git a/alib2data/src/alphabet/SymbolToStringComposer.h b/alib2data/src/alphabet/SymbolToStringComposer.h index aee929cc76..55af738296 100644 --- a/alib2data/src/alphabet/SymbolToStringComposer.h +++ b/alib2data/src/alphabet/SymbolToStringComposer.h @@ -28,7 +28,6 @@ private: void Visit(void*, const StartSymbol& symbol) const; void Visit(void*, const RankedSymbol& symbol) const; void Visit(void*, const BarSymbol& symbol) const; - void Visit(void*, const RankedBarSymbol& symbol) const; void Visit(void*, const SubtreeWildcardSymbol& symbol) const; void Visit(void*, const SymbolPairSymbol& symbol) const; void Visit(void*, const SymbolSetSymbol& symbol) const; diff --git a/alib2data/src/alphabet/SymbolToXMLComposer.cpp b/alib2data/src/alphabet/SymbolToXMLComposer.cpp index 97a596f4df..7685dbe545 100644 --- a/alib2data/src/alphabet/SymbolToXMLComposer.cpp +++ b/alib2data/src/alphabet/SymbolToXMLComposer.cpp @@ -47,7 +47,7 @@ void SymbolToXMLComposer::compose(std::deque<sax::Token>& out, const StartSymbol void SymbolToXMLComposer::compose(std::deque<sax::Token>& out, const RankedSymbol& symbol) const { out.emplace_back(alib::Names::ALPHABET_RANKED_SYMBOL, sax::Token::TokenType::START_ELEMENT); - alib::xmlApi<label::Label>::compose(out, symbol.getLabel()); + alib::xmlApi<alphabet::Symbol>::compose(out, symbol.getSymbol()); alib::xmlApi<primitive::Unsigned>::compose(out, symbol.getRank()); out.emplace_back(alib::Names::ALPHABET_RANKED_SYMBOL, sax::Token::TokenType::END_ELEMENT); } @@ -57,12 +57,6 @@ void SymbolToXMLComposer::compose(std::deque<sax::Token>& out, const BarSymbol&) out.emplace_back(alib::Names::ALPHABET_BAR_SYMBOL, sax::Token::TokenType::END_ELEMENT); } -void SymbolToXMLComposer::compose(std::deque<sax::Token>& out, const RankedBarSymbol& symbol) const { - out.emplace_back(alib::Names::ALPHABET_RANKED_BAR_SYMBOL, sax::Token::TokenType::START_ELEMENT); - alib::xmlApi<primitive::Unsigned>::compose(out, symbol.getRank()); - out.emplace_back(alib::Names::ALPHABET_RANKED_BAR_SYMBOL, sax::Token::TokenType::END_ELEMENT); -} - void SymbolToXMLComposer::compose(std::deque<sax::Token>& out, const SubtreeWildcardSymbol&) const { out.emplace_back(alib::Names::ALPHABET_SUBTREE_WILDCARD_SYMBOL, sax::Token::TokenType::START_ELEMENT); out.emplace_back(alib::Names::ALPHABET_SUBTREE_WILDCARD_SYMBOL, sax::Token::TokenType::END_ELEMENT); diff --git a/alib2data/src/alphabet/SymbolToXMLComposer.h b/alib2data/src/alphabet/SymbolToXMLComposer.h index c896fc9ad5..15642f74ed 100644 --- a/alib2data/src/alphabet/SymbolToXMLComposer.h +++ b/alib2data/src/alphabet/SymbolToXMLComposer.h @@ -51,7 +51,6 @@ private: void compose(std::deque<sax::Token>& output, const StartSymbol& symbol) const; void compose(std::deque<sax::Token>& output, const RankedSymbol& symbol) const; void compose(std::deque<sax::Token>& output, const BarSymbol& symbol) const; - void compose(std::deque<sax::Token>& output, const RankedBarSymbol& symbol) const; void compose(std::deque<sax::Token>& output, const SubtreeWildcardSymbol& symbol) const; void compose(std::deque<sax::Token>& output, const SymbolPairSymbol& symbol) const; void compose(std::deque<sax::Token>& output, const SymbolSetSymbol& symbol) const; diff --git a/alib2data/src/object/ObjectBase.h b/alib2data/src/object/ObjectBase.h index 48061a90d0..eebd4da7ae 100644 --- a/alib2data/src/object/ObjectBase.h +++ b/alib2data/src/object/ObjectBase.h @@ -108,7 +108,6 @@ class BlankSymbol; class BottomOfTheStackSymbol; class RankedSymbol; class BarSymbol; -class RankedBarSymbol; class SubtreeWildcardSymbol; class SymbolSetSymbol; class SymbolPairSymbol; @@ -160,7 +159,7 @@ typedef std::tuple< primitive::String, primitive::Integer, primitive::Character, typedef std::tuple< container::ObjectsSet, container::ObjectsVector, container::ObjectsPair, container::ObjectsMap > ContainerTypes; -typedef std::tuple< alphabet::EndSymbol, alphabet::LabeledSymbol, alphabet::BlankSymbol, alphabet::BottomOfTheStackSymbol, alphabet::RankedSymbol, alphabet::BarSymbol, alphabet::RankedBarSymbol, alphabet::SubtreeWildcardSymbol, alphabet::SymbolPairSymbol, alphabet::SymbolSetSymbol, alphabet::UniqueSymbol, alphabet::StartSymbol +typedef std::tuple< alphabet::EndSymbol, alphabet::LabeledSymbol, alphabet::BlankSymbol, alphabet::BottomOfTheStackSymbol, alphabet::RankedSymbol, alphabet::BarSymbol, alphabet::SubtreeWildcardSymbol, alphabet::SymbolPairSymbol, alphabet::SymbolSetSymbol, alphabet::UniqueSymbol, alphabet::StartSymbol > SymbolTypes; typedef std::tuple< string::Epsilon, string::LinearString, string::CyclicString diff --git a/alib2data/src/tree/TreeFromRawParser.cpp b/alib2data/src/tree/TreeFromRawParser.cpp index fc5bfcd739..8c0d712556 100644 --- a/alib2data/src/tree/TreeFromRawParser.cpp +++ b/alib2data/src/tree/TreeFromRawParser.cpp @@ -41,7 +41,7 @@ Tree TreeFromRawParser::parseTree(std::deque<sax::Token> &input, const std::set< } UnrankedNode* TreeFromRawParser::parseContent(std::deque<sax::Token>& input) const { - UnrankedNode* node = new UnrankedNode(alphabet::LabeledSymbol(label::labelFrom(popTokenData(input, sax::Token::TokenType::START_ELEMENT))), std::vector<UnrankedNode*> {}); + UnrankedNode* node = new UnrankedNode(alphabet::symbolFrom(popTokenData(input, sax::Token::TokenType::START_ELEMENT)), std::vector<UnrankedNode*> {}); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { UnrankedNode* child = this->parseContent(input); node->pushBackChild(std::move(*child)); @@ -57,7 +57,7 @@ UnrankedNode* TreeFromRawParser::parseContent(std::deque<sax::Token>& input) con } UnrankedNode* TreeFromRawParser::parseContentLeaf(std::deque<sax::Token>& input) const { - return new UnrankedNode(alphabet::LabeledSymbol(label::labelFrom(popTokenData(input, sax::Token::TokenType::CHARACTER))), std::vector<UnrankedNode*> {}); + return new UnrankedNode(alphabet::symbolFrom(popTokenData(input, sax::Token::TokenType::CHARACTER)), std::vector<UnrankedNode*> {}); } } /* namespace tree */ diff --git a/alib2data/src/tree/TreeFromXMLParser.cpp b/alib2data/src/tree/TreeFromXMLParser.cpp index 5e89d0da0b..033ff79de9 100644 --- a/alib2data/src/tree/TreeFromXMLParser.cpp +++ b/alib2data/src/tree/TreeFromXMLParser.cpp @@ -71,7 +71,7 @@ PrefixRankedNotation TreeFromXMLParser::parsePrefixRankedNotation(std::deque<sax UnrankedTree TreeFromXMLParser::parseUnrankedTree(std::deque<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, alib::Names::TREE_UNRANKED_TREE); - std::set<alphabet::LabeledSymbol> alphabet = parseAlphabet(input); + std::set<alphabet::Symbol> alphabet = parseAlphabet(input); UnrankedNode * root = parseUnrankedNode(input); UnrankedTree tree(std::move(alphabet), std::move(*root)); delete root; @@ -97,11 +97,11 @@ std::set<alphabet::RankedSymbol> TreeFromXMLParser::parseRankedAlphabet(std::deq return rankedSymbols; } -std::set<alphabet::LabeledSymbol> TreeFromXMLParser::parseAlphabet(std::deque<sax::Token> &input) const { - std::set<alphabet::LabeledSymbol> symbols; +std::set<alphabet::Symbol> TreeFromXMLParser::parseAlphabet(std::deque<sax::Token> &input) const { + std::set<alphabet::Symbol> symbols; popToken(input, sax::Token::TokenType::START_ELEMENT, "alphabet"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - symbols.insert(alib::xmlApi<alphabet::LabeledSymbol>::parse(input)); + symbols.insert(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "alphabet"); return symbols; @@ -133,7 +133,7 @@ RankedNode * TreeFromXMLParser::parseRankedNode(std::deque<sax::Token> &input) c UnrankedNode * TreeFromXMLParser::parseUnrankedNode(std::deque<sax::Token> &input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "unrankedNode"); - alphabet::LabeledSymbol symbol = alib::xmlApi<alphabet::LabeledSymbol>::parse(input); + alphabet::Symbol symbol = alib::xmlApi<alphabet::Symbol>::parse(input); std::vector<UnrankedNode *> children; while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { children.push_back(parseUnrankedNode(input)); diff --git a/alib2data/src/tree/TreeFromXMLParser.h b/alib2data/src/tree/TreeFromXMLParser.h index 1540a65fba..c3d9452443 100644 --- a/alib2data/src/tree/TreeFromXMLParser.h +++ b/alib2data/src/tree/TreeFromXMLParser.h @@ -40,7 +40,7 @@ private: std::vector<alphabet::RankedSymbol> parseContentData(std::deque<sax::Token> &input) const; UnrankedNode * parseUnrankedNode(std::deque<sax::Token> &input) const; std::set<alphabet::RankedSymbol> parseRankedAlphabet(std::deque<sax::Token> &input) const; - std::set<alphabet::LabeledSymbol> parseAlphabet(std::deque<sax::Token> &input) const; + std::set<alphabet::Symbol> parseAlphabet(std::deque<sax::Token> &input) const; template<class T> T parseSubtreeVariable(std::deque<sax::Token> &input) const; diff --git a/alib2data/src/tree/TreeToXMLComposer.cpp b/alib2data/src/tree/TreeToXMLComposer.cpp index 637e0d95d1..4127e0bb6f 100644 --- a/alib2data/src/tree/TreeToXMLComposer.cpp +++ b/alib2data/src/tree/TreeToXMLComposer.cpp @@ -26,10 +26,10 @@ void TreeToXMLComposer::composeAlphabet(std::deque<sax::Token>& out, const std:: out.emplace_back(sax::Token("rankedAlphabet", sax::Token::TokenType::END_ELEMENT)); } -void TreeToXMLComposer::composeAlphabet(std::deque<sax::Token>& out, const std::set<alphabet::LabeledSymbol>& symbols) const { +void TreeToXMLComposer::composeAlphabet(std::deque<sax::Token>& out, const std::set<alphabet::Symbol>& symbols) const { out.emplace_back(sax::Token("alphabet", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol : symbols) { - alib::xmlApi<alphabet::LabeledSymbol>::compose(out, symbol); + alib::xmlApi<alphabet::Symbol>::compose(out, symbol); } out.emplace_back(sax::Token("alphabet", sax::Token::TokenType::END_ELEMENT)); } @@ -95,7 +95,7 @@ void TreeToXMLComposer::composeNode(std::deque<sax::Token>& out, const RankedNod void TreeToXMLComposer::composeNode(std::deque<sax::Token>& out, const UnrankedNode& node) const { out.emplace_back(sax::Token("unrankedNode", sax::Token::TokenType::START_ELEMENT)); - alib::xmlApi<alphabet::LabeledSymbol>::compose(out, node.getSymbol()); + alib::xmlApi<alphabet::Symbol>::compose(out, node.getSymbol()); for(const auto& child : node.getChildren()) { composeNode(out, *child); } diff --git a/alib2data/src/tree/TreeToXMLComposer.h b/alib2data/src/tree/TreeToXMLComposer.h index 6a5ccc8db9..6fa6d8c812 100644 --- a/alib2data/src/tree/TreeToXMLComposer.h +++ b/alib2data/src/tree/TreeToXMLComposer.h @@ -35,7 +35,7 @@ public: private: void composeAlphabet(std::deque<sax::Token>& out, const std::set<alphabet::RankedSymbol>& symbols) const; - void composeAlphabet(std::deque<sax::Token>& out, const std::set<alphabet::LabeledSymbol>& symbols) const; + void composeAlphabet(std::deque<sax::Token>& out, const std::set<alphabet::Symbol>& symbols) const; template<class T> void composeSubtreeVariable(std::deque<sax::Token>& out, const T& symbol) const; diff --git a/alib2data/src/tree/common/UnrankedAlphabet.cpp b/alib2data/src/tree/common/UnrankedAlphabet.cpp index cf748ecb6d..acf9aba24c 100644 --- a/alib2data/src/tree/common/UnrankedAlphabet.cpp +++ b/alib2data/src/tree/common/UnrankedAlphabet.cpp @@ -11,25 +11,25 @@ namespace tree { -const std::set<alphabet::LabeledSymbol>& UnrankedAlphabet::getAlphabet() const { +const std::set<alphabet::Symbol>& UnrankedAlphabet::getAlphabet() const { return alphabet; } -bool UnrankedAlphabet::addSymbolToAlphabet(alphabet::LabeledSymbol symbol) { +bool UnrankedAlphabet::addSymbolToAlphabet(alphabet::Symbol symbol) { return alphabet.insert(std::move(symbol)).second; } -void UnrankedAlphabet::addSymbolsToAlphabet(const std::set<alphabet::LabeledSymbol>& symbols) { - for(const alphabet::LabeledSymbol& addedSymbol : symbols) { +void UnrankedAlphabet::addSymbolsToAlphabet(const std::set<alphabet::Symbol>& symbols) { + for(const alphabet::Symbol& addedSymbol : symbols) { addSymbolToAlphabet(addedSymbol); } } -void UnrankedAlphabet::setAlphabet(std::set<alphabet::LabeledSymbol> newSymbols) { - std::set<alphabet::LabeledSymbol> removed; +void UnrankedAlphabet::setAlphabet(std::set<alphabet::Symbol> newSymbols) { + std::set<alphabet::Symbol> removed; std::set_difference(alphabet.begin(), alphabet.end(), newSymbols.begin(), newSymbols.end(), std::inserter(removed, removed.end())); - for(const alphabet::LabeledSymbol& removedSymbol : removed) { + for(const alphabet::Symbol& removedSymbol : removed) { removeSymbolFromAlphabet(removedSymbol); } diff --git a/alib2data/src/tree/common/UnrankedAlphabet.h b/alib2data/src/tree/common/UnrankedAlphabet.h index 982529e324..38c11f8d8e 100644 --- a/alib2data/src/tree/common/UnrankedAlphabet.h +++ b/alib2data/src/tree/common/UnrankedAlphabet.h @@ -9,7 +9,7 @@ #define UNRANKED_ALPHABET_H_ #include <set> -#include "../../alphabet/LabeledSymbol.h" +#include "../../alphabet/Symbol.h" namespace tree { @@ -18,26 +18,26 @@ namespace tree { */ class UnrankedAlphabet { protected: - std::set<alphabet::LabeledSymbol> alphabet; + std::set<alphabet::Symbol> alphabet; public: /** * Adds input symbol to input alphabet. * @param symbol Symbol to add */ - bool addSymbolToAlphabet(alphabet::LabeledSymbol symbol); + bool addSymbolToAlphabet(alphabet::Symbol symbol); /** * Adds input symbols to input alphabet. * @param symbols Symbol to add */ - void addSymbolsToAlphabet(const std::set<alphabet::LabeledSymbol>& symbols); + void addSymbolsToAlphabet(const std::set<alphabet::Symbol>& symbols); /** * Sets input symbols of the tree. * @param symbols Symbols to set */ - void setAlphabet(std::set<alphabet::LabeledSymbol> symbols); + void setAlphabet(std::set<alphabet::Symbol> symbols); /** * Removes input symbol from the input alphabet. @@ -45,12 +45,12 @@ public: * @throws AutomatonException when symbol is not present in input alphabet * or when symbol is part of the transition */ - virtual bool removeSymbolFromAlphabet(const alphabet::LabeledSymbol& symbol) = 0; + virtual bool removeSymbolFromAlphabet(const alphabet::Symbol& symbol) = 0; /** * @return the input alphabet */ - const std::set<alphabet::LabeledSymbol>& getAlphabet() const; + const std::set<alphabet::Symbol>& getAlphabet() const; }; diff --git a/alib2data/src/tree/ranked/RankedNode.cpp b/alib2data/src/tree/ranked/RankedNode.cpp index 062f0d5af0..514da467ba 100644 --- a/alib2data/src/tree/ranked/RankedNode.cpp +++ b/alib2data/src/tree/ranked/RankedNode.cpp @@ -119,7 +119,7 @@ UnrankedNode* RankedNode::cloneAsUnranked() const { for(const RankedNode* child : this->children) { clonedChildren.push_back(child->cloneAsUnranked()); } - return new UnrankedNode(alphabet::LabeledSymbol(this->symbol.getLabel()), std::move(clonedChildren)); + return new UnrankedNode(this->symbol.getSymbol(), std::move(clonedChildren)); } int RankedNode::compare(const RankedNode& other) const { @@ -188,7 +188,7 @@ void RankedNode::nicePrint(std::ostream & os, const std::string & prefix, const os << "|-"; nextPrefix += "| "; } - os << (std::string) symbol.getLabel() << "(" << symbol.getRank().getData() << ")" << std::endl; + os << (std::string) symbol.getSymbol() << "(" << symbol.getRank().getData() << ")" << std::endl; for (unsigned int i = 0; i < children.size(); i++) { os << nextPrefix << "|" << std::endl; diff --git a/alib2data/src/tree/unranked/UnrankedNode.cpp b/alib2data/src/tree/unranked/UnrankedNode.cpp index 0f28b7e6e0..02f3779a47 100644 --- a/alib2data/src/tree/unranked/UnrankedNode.cpp +++ b/alib2data/src/tree/unranked/UnrankedNode.cpp @@ -14,7 +14,7 @@ namespace tree { -UnrankedNode::UnrankedNode(alphabet::LabeledSymbol symbol, std::vector<UnrankedNode *> children) : symbol(std::move(symbol)), children(std::move(children)), parentTree(NULL) { +UnrankedNode::UnrankedNode(alphabet::Symbol symbol, std::vector<UnrankedNode *> children) : symbol(std::move(symbol)), children(std::move(children)), parentTree(NULL) { for (auto& element : this->children) { element->parent = this; } @@ -85,7 +85,7 @@ const UnrankedNode * UnrankedNode::getParent() const { return parent; } -void UnrankedNode::setSymbol(alphabet::LabeledSymbol symbol) { +void UnrankedNode::setSymbol(alphabet::Symbol symbol) { this->symbol = std::move(symbol); if(this->parentTree != NULL && this->parentTree->getAlphabet().find(this->symbol) == this->parentTree->getAlphabet().end()) throw TreeException("Symbol is not in the alphabet"); } @@ -121,11 +121,12 @@ RankedNode* UnrankedNode::cloneAsRanked() const { for(const UnrankedNode* child : this->children) { clonedChildren.push_back(child->cloneAsRanked()); } - return new RankedNode(alphabet::RankedSymbol(this->symbol.getLabel(), primitive::Unsigned(clonedChildren.size())), std::move(clonedChildren)); + return new RankedNode(alphabet::RankedSymbol(this->symbol, primitive::Unsigned(clonedChildren.size())), std::move(clonedChildren)); } int UnrankedNode::compare(const UnrankedNode& other) const { - int res = this->symbol.compare(other.symbol); + std::compare<alphabet::Symbol> comp; + int res = comp(this->symbol, other.symbol); if(res != 0) return res; int thisSize = this->children.size(); @@ -151,7 +152,7 @@ std::ostream& operator<<(std::ostream& out, const UnrankedNode& node) { return out; } -bool UnrankedNode::testSymbol( const alphabet::LabeledSymbol & symbol ) const { +bool UnrankedNode::testSymbol( const alphabet::Symbol & symbol ) const { return symbol == this->symbol; } @@ -165,13 +166,13 @@ bool UnrankedNode::attachTree(const UnrankedAlphabet * tree ) { return true; } -void UnrankedNode::computeMinimalAlphabet( std::set<alphabet::LabeledSymbol>& alphabet ) const { +void UnrankedNode::computeMinimalAlphabet( std::set<alphabet::Symbol>& alphabet ) const { alphabet.insert(this->symbol); for(const auto& child : this->children) child->computeMinimalAlphabet(alphabet); } -const alphabet::LabeledSymbol& UnrankedNode::getSymbol() const { +const alphabet::Symbol& UnrankedNode::getSymbol() const { return this->symbol; } @@ -192,7 +193,7 @@ void UnrankedNode::nicePrint(std::ostream & os, const std::string & prefix, cons os << "|-"; nextPrefix += "| "; } - os << (std::string) symbol.getLabel() << std::endl; + os << (std::string) symbol << std::endl; for (unsigned int i = 0; i < children.size(); i++) { os << nextPrefix << "|" << std::endl; diff --git a/alib2data/src/tree/unranked/UnrankedNode.h b/alib2data/src/tree/unranked/UnrankedNode.h index d9d33cc192..2183265ff0 100644 --- a/alib2data/src/tree/unranked/UnrankedNode.h +++ b/alib2data/src/tree/unranked/UnrankedNode.h @@ -8,7 +8,7 @@ #ifndef UNRANKED_NODE_H_ #define UNRANKED_NODE_H_ -#include "../../alphabet/LabeledSymbol.h" +#include "../../alphabet/Symbol.h" #include "../../alphabet/RankedSymbol.h" #include <vector> #include <set> @@ -23,7 +23,7 @@ class RankedNode; */ class UnrankedNode { protected: - alphabet::LabeledSymbol symbol; + alphabet::Symbol symbol; std::vector<UnrankedNode*> children; @@ -42,7 +42,7 @@ protected: /** * @copydoc UnrankedNode::testSymbol() const */ - bool testSymbol( const alphabet::LabeledSymbol & symbol ) const; + bool testSymbol( const alphabet::Symbol & symbol ) const; /** * @copydoc UnrankedNode::attachTree() @@ -52,9 +52,9 @@ protected: /** * @copydoc UnrankedNode::computeMinimalAlphabet() */ - void computeMinimalAlphabet( std::set<alphabet::LabeledSymbol>& alphabet ) const; + void computeMinimalAlphabet( std::set<alphabet::Symbol>& alphabet ) const; public: - explicit UnrankedNode(alphabet::LabeledSymbol symbol, std::vector<UnrankedNode *> children); + explicit UnrankedNode(alphabet::Symbol symbol, std::vector<UnrankedNode *> children); UnrankedNode(const UnrankedNode& other); UnrankedNode(UnrankedNode&& other) noexcept; @@ -86,7 +86,7 @@ public: const UnrankedNode * getParent() const; - void setSymbol(alphabet::LabeledSymbol symbol); + void setSymbol(alphabet::Symbol symbol); void pushBackChild(const UnrankedNode & node); @@ -104,7 +104,7 @@ public: /** * Returns the string representation of Node's Symbol. */ - const alphabet::LabeledSymbol& getSymbol() const; + const alphabet::Symbol& getSymbol() const; explicit operator std::string() const; diff --git a/alib2data/src/tree/unranked/UnrankedTree.cpp b/alib2data/src/tree/unranked/UnrankedTree.cpp index 4f7ac90f34..3634c5fa39 100644 --- a/alib2data/src/tree/unranked/UnrankedTree.cpp +++ b/alib2data/src/tree/unranked/UnrankedTree.cpp @@ -24,7 +24,7 @@ UnrankedTree::UnrankedTree(const RankedTree& other) { delete element; } -UnrankedTree::UnrankedTree(std::set<alphabet::LabeledSymbol> alphabet, UnrankedNode tree) { +UnrankedTree::UnrankedTree(std::set<alphabet::Symbol> alphabet, UnrankedNode tree) { setAlphabet(std::move(alphabet)); this->tree = NULL; setTree(std::move(tree)); @@ -92,7 +92,7 @@ void UnrankedTree::setTree(UnrankedNode tree) { } } -bool UnrankedTree::removeSymbolFromAlphabet(const alphabet::LabeledSymbol & symbol) { +bool UnrankedTree::removeSymbolFromAlphabet(const alphabet::Symbol & symbol) { if(this->tree->testSymbol(symbol)) throw exception::AlibException("Input symbol \"" + (std::string) symbol + "\" is used."); @@ -106,7 +106,7 @@ void UnrankedTree::operator >>(std::ostream& out) const { int UnrankedTree::compare(const UnrankedTree& other) const { int res = tree->compare(*other.tree); if(res == 0) { - std::compare<std::set<alphabet::LabeledSymbol>> comp; + std::compare<std::set<alphabet::Symbol>> comp; res = comp(alphabet, other.alphabet); } return res; diff --git a/alib2data/src/tree/unranked/UnrankedTree.h b/alib2data/src/tree/unranked/UnrankedTree.h index a9a0e84367..e5c73338a6 100644 --- a/alib2data/src/tree/unranked/UnrankedTree.h +++ b/alib2data/src/tree/unranked/UnrankedTree.h @@ -40,7 +40,7 @@ public: virtual TreeBase* plunder() &&; explicit UnrankedTree(const RankedTree& other); - explicit UnrankedTree(std::set<alphabet::LabeledSymbol> alphabet, UnrankedNode tree); + explicit UnrankedTree(std::set<alphabet::Symbol> alphabet, UnrankedNode tree); explicit UnrankedTree(UnrankedNode tree); /** @@ -73,7 +73,7 @@ public: * Removes symbol from the alphabet of symbol available in the regular expression * @param symbol removed symbol from the alphabet */ - bool removeSymbolFromAlphabet(const alphabet::LabeledSymbol & symbol); + bool removeSymbolFromAlphabet(const alphabet::Symbol & symbol); /** * Prints XML representation of the tree to the output stream. diff --git a/alib2data/test-src/tree/TreeTest.cpp b/alib2data/test-src/tree/TreeTest.cpp index d79f1e779a..2c9d910974 100644 --- a/alib2data/test-src/tree/TreeTest.cpp +++ b/alib2data/test-src/tree/TreeTest.cpp @@ -222,11 +222,11 @@ void TreeTest::testUnrankedTreeParser() { | \-4.c */ - const alphabet::LabeledSymbol a ('a'); - const alphabet::LabeledSymbol b ('b'); - const alphabet::LabeledSymbol c ('c'); + const alphabet::Symbol a = alphabet::symbolFrom('a'); + const alphabet::Symbol b = alphabet::symbolFrom('b'); + const alphabet::Symbol c = alphabet::symbolFrom('c'); - const std::set<alphabet::LabeledSymbol> alphabet {a, b, c}; + const std::set<alphabet::Symbol> alphabet {a, b, c}; tree::UnrankedNode * node3 = new tree::UnrankedNode(c, {}); tree::UnrankedNode * node4 = new tree::UnrankedNode(c, {}); @@ -273,11 +273,11 @@ void TreeTest::testUnrankedTreeCompare() { | \-8.c */ - const alphabet::LabeledSymbol a ('a'); - const alphabet::LabeledSymbol b ('b'); - const alphabet::LabeledSymbol c ('c'); + const alphabet::Symbol a = alphabet::symbolFrom('a'); + const alphabet::Symbol b = alphabet::symbolFrom('b'); + const alphabet::Symbol c = alphabet::symbolFrom('c'); - const std::set<alphabet::LabeledSymbol> alphabet {a, b, c}; + const std::set<alphabet::Symbol> alphabet {a, b, c}; tree::UnrankedNode * node3 = new tree::UnrankedNode(c, {}); tree::UnrankedNode * node4 = new tree::UnrankedNode(c, {}); @@ -299,13 +299,13 @@ void TreeTest::testUnrankedTreeCompare() { } void TreeTest::testUnrankedTreeSymbolValidityCheck() { - const alphabet::LabeledSymbol a ('a'); - const alphabet::LabeledSymbol b ('b'); - const alphabet::LabeledSymbol c ('c'); - const alphabet::LabeledSymbol d ('d'); - const alphabet::LabeledSymbol e ('e'); + const alphabet::Symbol a = alphabet::symbolFrom('a'); + const alphabet::Symbol b = alphabet::symbolFrom('b'); + const alphabet::Symbol c = alphabet::symbolFrom('c'); + const alphabet::Symbol d = alphabet::symbolFrom('d'); + const alphabet::Symbol e = alphabet::symbolFrom('e'); - const std::set<alphabet::LabeledSymbol> alphabet {a, b, c, e}; + const std::set<alphabet::Symbol> alphabet {a, b, c, e}; tree::UnrankedNode * node3 = new tree::UnrankedNode(d, {}); tree::UnrankedNode * node4 = new tree::UnrankedNode(c, {}); @@ -331,13 +331,13 @@ void TreeTest::testUnrankedTreeSymbolValidityCheck() { } void TreeTest::testUnrankedTreeSubtreeSwitch() { - alphabet::LabeledSymbol a ('a'); - alphabet::LabeledSymbol b ('b'); - alphabet::LabeledSymbol c ('c'); - alphabet::LabeledSymbol d ('d'); + alphabet::Symbol a = alphabet::symbolFrom('a'); + alphabet::Symbol b = alphabet::symbolFrom('b'); + alphabet::Symbol c = alphabet::symbolFrom('c'); + alphabet::Symbol d = alphabet::symbolFrom('d'); - const std::set<alphabet::LabeledSymbol> alphabet1 {a, b, c, d}; - const std::set<alphabet::LabeledSymbol> alphabet2 {a, b, c, d}; + const std::set<alphabet::Symbol> alphabet1 {a, b, c, d}; + const std::set<alphabet::Symbol> alphabet2 {a, b, c, d}; tree::UnrankedNode * node3 = new tree::UnrankedNode(c, {}); tree::UnrankedNode * node4 = new tree::UnrankedNode(c, {}); diff --git a/examples2/automaton/DFTA.xml b/examples2/automaton/DFTA.xml index 403a296271..78b83184ce 100644 --- a/examples2/automaton/DFTA.xml +++ b/examples2/automaton/DFTA.xml @@ -1,2 +1,651 @@ <?xml version="1.0"?> -<DFTA><states><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></states><rankedInputAlphabet><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol><RankedSymbol><PrimitiveLabel><Character>b</Character></PrimitiveLabel><Unsigned>1</Unsigned></RankedSymbol><RankedSymbol><PrimitiveLabel><Character>c</Character></PrimitiveLabel><Unsigned>0</Unsigned></RankedSymbol></rankedInputAlphabet><finalStates><LabelSetLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></finalStates><transitions><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></from><to><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></from><to><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></from><to><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><LabelSetLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></from><to><LabelSetLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><LabelSetLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></from><to><LabelSetLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><LabelSetLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></from><to><LabelSetLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></from><to><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></from><to><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></from><to><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></from><to><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></from><to><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></from><to><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>b</Character></PrimitiveLabel><Unsigned>1</Unsigned></RankedSymbol></input><from><LabelSetLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel></LabelSetLabel></from><to><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>b</Character></PrimitiveLabel><Unsigned>1</Unsigned></RankedSymbol></input><from><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></from><to><LabelSetLabel><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>c</Character></PrimitiveLabel><Unsigned>0</Unsigned></RankedSymbol></input><from/><to><LabelSetLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></LabelSetLabel></to></transition></transitions></DFTA> +<DFTA> + <states> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </states> + <rankedInputAlphabet> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>b</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>1</Unsigned> + </RankedSymbol> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>c</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>0</Unsigned> + </RankedSymbol> + </rankedInputAlphabet> + <finalStates> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </finalStates> + <transitions> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </from> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </from> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </from> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </from> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </from> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </from> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </from> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </from> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </from> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </from> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </from> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </from> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>b</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>1</Unsigned> + </RankedSymbol> + </input> + <from> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </from> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>b</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>1</Unsigned> + </RankedSymbol> + </input> + <from> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </from> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>c</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>0</Unsigned> + </RankedSymbol> + </input> + <from/> + <to> + <LabelSetLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </LabelSetLabel> + </to> + </transition> + </transitions> +</DFTA> diff --git a/examples2/automaton/NFTA.xml b/examples2/automaton/NFTA.xml index 2466b9dc39..c8c3c37b6b 100644 --- a/examples2/automaton/NFTA.xml +++ b/examples2/automaton/NFTA.xml @@ -1,2 +1,162 @@ <?xml version="1.0"?> -<NFTA><states><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></states><rankedInputAlphabet><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol><RankedSymbol><PrimitiveLabel><Character>b</Character></PrimitiveLabel><Unsigned>1</Unsigned></RankedSymbol><RankedSymbol><PrimitiveLabel><Character>c</Character></PrimitiveLabel><Unsigned>0</Unsigned></RankedSymbol></rankedInputAlphabet><finalStates><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></finalStates><transitions><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></from><to><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></from><to><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>a</Character></PrimitiveLabel><Unsigned>2</Unsigned></RankedSymbol></input><from><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></from><to><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>b</Character></PrimitiveLabel><Unsigned>1</Unsigned></RankedSymbol></input><from><PrimitiveLabel><Unsigned>2</Unsigned></PrimitiveLabel></from><to><PrimitiveLabel><Unsigned>1</Unsigned></PrimitiveLabel></to></transition><transition><input><RankedSymbol><PrimitiveLabel><Character>c</Character></PrimitiveLabel><Unsigned>0</Unsigned></RankedSymbol></input><from/><to><PrimitiveLabel><Unsigned>3</Unsigned></PrimitiveLabel></to></transition></transitions></NFTA> +<NFTA> + <states> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </states> + <rankedInputAlphabet> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>b</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>1</Unsigned> + </RankedSymbol> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>c</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>0</Unsigned> + </RankedSymbol> + </rankedInputAlphabet> + <finalStates> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </finalStates> + <transitions> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </from> + <to> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </from> + <to> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>a</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>2</Unsigned> + </RankedSymbol> + </input> + <from> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </from> + <to> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>b</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>1</Unsigned> + </RankedSymbol> + </input> + <from> + <PrimitiveLabel> + <Unsigned>2</Unsigned> + </PrimitiveLabel> + </from> + <to> + <PrimitiveLabel> + <Unsigned>1</Unsigned> + </PrimitiveLabel> + </to> + </transition> + <transition> + <input> + <RankedSymbol> +<LabeledSymbol> + <PrimitiveLabel> + <Character>c</Character> + </PrimitiveLabel> +</LabeledSymbol> + <Unsigned>0</Unsigned> + </RankedSymbol> + </input> + <from/> + <to> + <PrimitiveLabel> + <Unsigned>3</Unsigned> + </PrimitiveLabel> + </to> + </transition> + </transitions> +</NFTA> diff --git a/examples2/tree/RankedTree.xml b/examples2/tree/RankedTree.xml index f397d52b31..fab30bef14 100644 --- a/examples2/tree/RankedTree.xml +++ b/examples2/tree/RankedTree.xml @@ -2,51 +2,65 @@ <RankedTree> <rankedAlphabet> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>a</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>2</Unsigned> </RankedSymbol> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>b</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>1</Unsigned> </RankedSymbol> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>c</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>0</Unsigned> </RankedSymbol> </rankedAlphabet> <rankedNode> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>b</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>1</Unsigned> </RankedSymbol> <rankedNode> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>a</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>2</Unsigned> </RankedSymbol> <rankedNode> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>c</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>0</Unsigned> </RankedSymbol> </rankedNode> <rankedNode> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>c</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>0</Unsigned> </RankedSymbol> </rankedNode> diff --git a/examples2/tree/RankedTree2.xml b/examples2/tree/RankedTree2.xml index 4bf50c0256..bee9955128 100644 --- a/examples2/tree/RankedTree2.xml +++ b/examples2/tree/RankedTree2.xml @@ -2,72 +2,92 @@ <RankedTree> <rankedAlphabet> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>a</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>2</Unsigned> </RankedSymbol> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>b</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>1</Unsigned> </RankedSymbol> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>c</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>0</Unsigned> </RankedSymbol> </rankedAlphabet> <rankedNode> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>a</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>2</Unsigned> </RankedSymbol> <rankedNode> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>a</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>2</Unsigned> </RankedSymbol> <rankedNode> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>a</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>2</Unsigned> </RankedSymbol> <rankedNode> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>b</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>1</Unsigned> </RankedSymbol> <rankedNode> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>a</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>2</Unsigned> </RankedSymbol> <rankedNode> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>c</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>0</Unsigned> </RankedSymbol> </rankedNode> <rankedNode> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>c</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>0</Unsigned> </RankedSymbol> </rankedNode> @@ -75,27 +95,33 @@ </rankedNode> <rankedNode> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>c</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>0</Unsigned> </RankedSymbol> </rankedNode> </rankedNode> <rankedNode> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>c</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>0</Unsigned> </RankedSymbol> </rankedNode> </rankedNode> <rankedNode> <RankedSymbol> +<LabeledSymbol> <PrimitiveLabel> <Character>c</Character> </PrimitiveLabel> +</LabeledSymbol> <Unsigned>0</Unsigned> </RankedSymbol> </rankedNode> -- GitLab