Skip to content
Snippets Groups Projects
Commit 81e27360 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

remove unnecessary local objects and constructors

parent 77eb45ca
No related branches found
No related tags found
Loading
...@@ -45,11 +45,10 @@ automaton::DFA<> ToAutomatonDerivation::convert(const T& regexp) { ...@@ -45,11 +45,10 @@ automaton::DFA<> ToAutomatonDerivation::convert(const T& regexp) {
Qi.push_back(std::set<regexp::RegExp>()); // initialize set Q_i Qi.push_back(std::set<regexp::RegExp>()); // initialize set Q_i
   
for(const auto& dregexp : Qi.at(i - 1)) { for(const auto& dregexp : Qi.at(i - 1)) {
regexp::RegExpDerivation deriv;
   
for(const auto& a : regexp.getAlphabet()) { for(const auto& a : regexp.getAlphabet()) {
string::LinearString < > string(std::vector<alphabet::Symbol>{a}); string::LinearString < > string(std::vector<alphabet::Symbol>{a});
regexp::RegExp derived = deriv.derivation(dregexp, string); regexp::RegExp derived = regexp::RegExpDerivation::derivation(dregexp, string);
derived = regexp::simplify::RegExpOptimize::optimize(derived); derived = regexp::simplify::RegExpOptimize::optimize(derived);
   
// this will also add \emptyset as a regexp (and as FA state) // this will also add \emptyset as a regexp (and as FA state)
...@@ -82,11 +81,10 @@ automaton::DFA<> ToAutomatonDerivation::convert(const T& regexp) { ...@@ -82,11 +81,10 @@ automaton::DFA<> ToAutomatonDerivation::convert(const T& regexp) {
automaton.setInputAlphabet(regexp.getAlphabet()); automaton.setInputAlphabet(regexp.getAlphabet());
   
for(const auto& r : Q) { for(const auto& r : Q) {
regexp::RegExpDerivation deriv;
   
for(const auto& a: regexp.getAlphabet()) { for(const auto& a: regexp.getAlphabet()) {
string::LinearString < > string(std::vector<alphabet::Symbol>{a}); string::LinearString < > string(std::vector<alphabet::Symbol>{a});
regexp::RegExp derived = deriv.derivation(r, string); regexp::RegExp derived = regexp::RegExpDerivation::derivation(r, string);
derived = regexp::simplify::RegExpOptimize::optimize(derived); derived = regexp::simplify::RegExpOptimize::optimize(derived);
   
automaton.addTransition(stateMap.find(r)->second, a, stateMap.find(derived)->second); automaton.addTransition(stateMap.find(r)->second, a, stateMap.find(derived)->second);
......
...@@ -26,8 +26,6 @@ namespace regexp { ...@@ -26,8 +26,6 @@ namespace regexp {
*/ */
class RegExpIntegral : public std::SingleDispatch < RegExpIntegral, regexp::RegExp, const regexp::RegExpBase &, const string::LinearString < >&> { class RegExpIntegral : public std::SingleDispatch < RegExpIntegral, regexp::RegExp, const regexp::RegExpBase &, const string::LinearString < >&> {
public: public:
RegExpIntegral() {}
/** /**
* @param regexp RegExp to integrate * @param regexp RegExp to integrate
* @param string String to integrate given RegExp over * @param string String to integrate given RegExp over
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment