|
|
Go to the documentation of this file.
73 mpStateSymbolTable(&mStateSymbolTable),
74 mpEventSymbolTable(GlobalEventSymbolTablep()),
76 mStateNamesEnabled(msStateNamesEnabledDefault),
77 mReindexOnWrite(msReindexOnWriteDefault),
84 pAlphabetPrototype(&AlphabetVoid()),
85 pStatesPrototype(&StatesVoid()),
86 pTransRelPrototype(&TransRelVoid()),
87 pGlobalPrototype(&GlobalVoid())
90 FD_DG( "vGenerator(" << this << ")::vGenerator()");
108 mpStateSymbolTable(&mStateSymbolTable),
109 mpEventSymbolTable(GlobalEventSymbolTablep()),
111 mStateNamesEnabled(msStateNamesEnabledDefault),
112 mReindexOnWrite(msReindexOnWriteDefault),
117 mpGlobalAttribute(0),
119 pAlphabetPrototype(&AlphabetVoid()),
120 pStatesPrototype(&StatesVoid()),
121 pTransRelPrototype(&TransRelVoid()),
122 pGlobalPrototype(&GlobalVoid())
125 FD_DG( "vGenerator(" << this << ")::vGenerator(" << &rOtherGen << ")");
142 mpStateSymbolTable(&mStateSymbolTable),
143 mpEventSymbolTable(GlobalEventSymbolTablep()),
145 mStateNamesEnabled(msStateNamesEnabledDefault),
146 mReindexOnWrite(msReindexOnWriteDefault),
151 mpGlobalAttribute(0),
153 pAlphabetPrototype(&AlphabetVoid()),
154 pStatesPrototype(&StatesVoid()),
155 pTransRelPrototype(&TransRelVoid()),
156 pGlobalPrototype(&GlobalVoid())
159 FD_DG( "vGenerator(" << this << ")::vGenerator(" << rFileName << ")");
173 Read(rFileName, "Generator");
180 FD_DG( "vGenerator(" << this << ")::New()");
192 FD_DG( "vGenerator(" << this << ")::NewCpy()");
200 return dynamic_cast< const vGenerator* > (pOther);
214 const TransSet* pNewTransRelPrototype) {
215 FD_DG( "vGenerator(" << this << ")::ConfigureAtributes(..)");
220 FD_DG( "vGenerator(" << this << ")::ConfigureAtributes(): done");
267 FD_DG( "vGenerator(" << this << ")::DoCopy(" << &rGen << ")");
269 if(&rGen== this) return;
287#ifdef FAUDES_DEBUG_CODE
289 FD_DG( "vGenerator()::DoCopy(): invalid generator");
294 FD_DG( "vGenerator(" << this << ")::DoCopy(" << &rGen << "): done");
299 FD_DG( "vGenerator(" << this << ")::Copy([type] " << &rSrc << ")");
301 if(&rSrc== this) return * this;
315 FD_DG( "vGenerator(" << this << ")::Copy(" << &rGen << ")");
332#ifdef FAUDES_DEBUG_CODE
334 FD_DG( "vGenerator()::NewCpy(): invalid generator");
345 FD_DG( "vGenerator(" << this << ")::Move([type] " << &rSrc << ")");
347 if(&rSrc== this) return * this;
361 FD_DG( "vGenerator(" << this << ")::DoMove(" << &rGen << ")");
368 if( typeid(*pt)!= typeid(*opt)) tmm= true;
371 if( typeid(*pt)!= typeid(*opt)) tmm= true;
374 if( typeid(*pt)!= typeid(*opt)) tmm= true;
377 if( typeid(*pt)!= typeid(*opt)) tmm= true;
380 FD_DG( "vGenerator(" << this << ")::Move(" << &rGen << "): using std copy");
420 FD_DG( "vGenerator(" << this << ")::operator= " << &rOtherGen);
421 FD_DG( "vGenerator(" << this << ")::operator= types " << typeid(*this).name() << " <= " << typeid(rOtherGen).name());
422 return Copy(rOtherGen);
427 FD_DG( "vGenerator(" << this << ")::operator= [rval] " << &rOtherGen);
428 FD_DG( "vGenerator(" << this << ")::operator= [rval] types " << typeid(*this).name() << " <= " << typeid(rOtherGen).name());
429 return Move(rOtherGen);
434 FD_DG( "vGenerator(" << this << ")::Version(" << version << ")");
435 std::ostringstream o;
442 FD_DG( "vGenerator(" << this << ")::Version(" << rVersion << ")");
445 std::stringstream errstr;
446 errstr << "Destination must not match source.";
447 throw Exception( "vGenerator::Version(string)", errstr.str(), 96);
452 EventSet::Iterator eit;
453 StateSet::Iterator lit;
455 std::map<Idx,Idx> eventoldnewmap;
460 eventoldnewmap[*eit] = newevent;
486 FD_DG( "vGenerator(" << this << ")::Version(" << rPattern << ", " << rReplacement << ", ...)");
489 std::stringstream errstr;
490 errstr << "Destination must not match source.";
491 throw Exception( "vGenerator::Version(string,string)", errstr.str(), 96);
494 if(rPattern.empty()) {
499 if(rPattern==rReplacement) {
507 EventSet::Iterator eit;
508 StateSet::Iterator lit;
510 std::map<Idx,Idx> eventoldnewmap;
512 std::string newstring;
513 std::string::size_type pos = 0;
514 int patternlength=rPattern.size();
515 int replacementlength=rReplacement.size();
520 while( (pos = newstring.find(rPattern, pos)) != std::string::npos ) {
521 newstring.replace(pos, patternlength, rReplacement);
523 pos=pos+replacementlength;
526 eventoldnewmap[*eit] = newevent;
532 while( (pos = newstring.find(rPattern, pos)) != std::string::npos ) {
533 newstring.replace(pos, patternlength, rReplacement);
534 pos=pos+replacementlength;
536 rResGen. Name(newstring);
560 FD_DG( "vGenerator(" << this << ")::Valid()");
568 StateSet::Iterator lit;
585 NameSet::Iterator eit;
605 FD_DG( "vGenerator(" << this << ")::Clear()");
613 FD_DG( "vGenerator(" << this << ")::Clear(): done");
697 FD_DG( "vGenerator::ClearMinStateIndexMap()");
711 FD_DG( "vGenerator::SetMinStateIndexMap()");
716 StateSet::Iterator it;
754#ifdef FAUDES_DEBUG_CONTAINER
755 std::map<Idx,Idx>::const_iterator _it;
757 FD_DC( "vGenerator::MinStateIndexMap: " << _it->first
758 << " <-- " << SStr(_it->second));
766 std::map<Idx,Idx>::const_iterator minit;
769 return minit->second;
790 StateSet::Iterator sit;
867 FD_DG( "vGenerator(" << this << ")::EventName("
868 << index << ",\"" << rName << "\")");
871 std::stringstream errstr;
872 errstr << "event \"" << index << "\" not found in generator \""
874 throw Exception( "vGenerator::EventName(name)", errstr.str(), 89);
882 std::string name=rName;
883 if(name== "") name= "ev";
891 FD_DG( "vGenerator(" << this << ")::EventRename(" << EStr(event) << ", " << rNewName << ")");
894 std::stringstream errstr;
895 errstr << "event \"" << event << "\" not found in generator \""
897 throw Exception( "vGenerator::EventReame(name)", errstr.str(), 89);
905 if(newidx==event) return true;
913 if(tit->Ev!=event) {++tit; continue;}
920 for(tit=newtrans-> Begin(); tit!=newtrans-> End(); tit++) {
929 FD_DG( "vGenerator(" << this << ")::EventRename(" << EStr(event) << ", " << rNewName << "):OK");
977 FD_DG( "vGenerator(" << this << ")::StateName("
978 << index << ",\"" << rName << "\")");
981 std::stringstream errstr;
982 errstr << "state name \"" << rName << "\" not found in generator \""
984 throw Exception( "vGenerator::StateName(name)", errstr.str(), 90);
993 FD_DG( "vGenerator(" << this << ")::ClearStateNames()");
1000 FD_DG( "Generator(" << this << ")::ClrStateName(\"" << index << "\")");
1001#ifdef FAUDES_CHECKED
1003 std::stringstream errstr;
1004 errstr << "state \"" << index << "\" not found in generator \""
1006 throw Exception( "vGenerator::ClrStateName(name)", errstr.str(), 90);
1014 FD_DG( "vGenerator(" << this << ")::ClrStateName(\"" << rName << "\")");
1038 FD_DG( "vGenerator(" << this << ")::SetDefaultStateNames()");
1040 StateSet::Iterator it;
1050 FD_DG( "vGenerator(" << this << ")::EnforceStateNames(temp)");
1051 StateSet::Iterator it;
1062 std::string name=rName;
1063 if(name== "") name= "st";
1130 const std::string& rX1, const std::string& rEv, const std::string& rX2) const
1147 const std::string& rX1, const std::string& rEv, const std::string& rX2) const
1193 FD_DG( "vGenerator::InjectAlphabet() " << rNewAlphabet. ToString());
1194#ifdef FAUDES_CHECKED
1196 std::stringstream errstr;
1197 errstr << "symboltable mismatch aka not implemented" << std::endl;
1198 throw Exception( "vGenerator::InjectAlphabet", errstr.str(), 88);
1207 FD_DG( "vGenerator::RestrictAlphabet() " << rNewAlphabet. ToString());
1208#ifdef FAUDES_CHECKED
1210 std::stringstream errstr;
1211 errstr << "symboltable mismatch aka not implemented" << std::endl;
1212 throw Exception( "vGenerator::RestrictAlphabet", errstr.str(), 88);
1221 FD_DG( "vGenerator(" << this << ")::InsEvent(" << index << ")");
1227 FD_DG( "vGenerator(" << this << ")::InsEvent(\"" << rName << "\")");
1238 FD_DG( "vGenerator(" << this << ")::DelEvent(" << index << ")");
1245 FD_DG( "vGenerator(" << this << ")::DelEvent(\"" << rName << "\")");
1253 FD_DG( "vGenerator(" << this << ")::DelEvents(\""
1255 EventSet::Iterator it;
1256 for (it = rEvents. Begin(); it != rEvents. End(); ++it) {
1263 FD_DG( "vGenerator(" << this << ")::DelEventFromAlphabet("
1270 FD_DG( "vGenerator(" << this << ")::InsState()");
1276 FD_DG( "vGenerator(" << this << ")::InsState(" << index << ")");
1282 FD_DG( "vGenerator(" << this << ")::InsState(\"" << rName << "\")");
1295 FD_DG( "vGenerator(" << this << ")::InjectState(\"" << SStr(index) << "\")");
1301 FD_DG( "vGenerator(" << this << ")::InjectStates(" << rNewStates. ToString() << ")");
1310 FD_DG( "vGenerator(" << this << ")::InsInitState()");
1319 FD_DG( "vGenerator(" << this << ")::InsInitState(\"" << rName << "\")");
1341 FD_DG( "vGenerator(" << this << ")::InsMarkedState()");
1357 FD_DG( "vGenerator(" << this << ")::InsMarkedState(\"" << rName << "\")");
1373 FD_DG( "vGenerator(" << this << ")::DelState(" << index << ")");
1388 FD_DG( "vGenerator(" << this << ")::DelState(\"" << rName << "\")");
1391#ifdef FAUDES_CHECKED
1393 std::stringstream errstr;
1394 errstr << "state name \"" << rName << "\" not found in generator \""
1396 throw Exception( "vGenerator::DelState(name)", errstr.str(), 90);
1404 FD_DG( "vGenerator(" << this << ")::DelStates("
1406 StateSet::Iterator cit;
1407 StateSet::Iterator cit_end;
1409 for (cit = rDelStates. Begin(); cit != rDelStates. End(); ++cit) {
1422 FD_DG( "vGenerator(" << this << ")::DelStateFromStates(" << index << ")");
1429 FD_DG( "vGenerator(" << this << ")::DelState(" << *pos << ")");
1435 FD_DG( "vGenerator(" << this << ")::RestrictStates("
1438 StateSet::Iterator cit;
1439 StateSet::Iterator cit_end;
1455 FD_DG( "vGenerator(" << this << ")::SetInitState(" << index << ")");
1456#ifdef FAUDES_CHECKED
1458 std::stringstream errstr;
1459 errstr << "vGenerator::SetMarkedState: index " << index
1460 << " not in stateset";
1461 throw Exception( "vGenerator::SetInitState(..)", errstr.str(), 91);
1469 FD_DG( "vGenerator(" << this << ")::SetInitState(\"" << rName << "\")");
1471#ifdef FAUDES_CHECKED
1473 std::stringstream errstr;
1474 errstr << "State name \"" << rName << "\" not known in Generator";
1475 throw Exception( "vGenerator::SetInitState(..)", errstr.str(), 90);
1483 FD_DG( "vGenerator(" << this << ")::InjectInitStates("
1484 << rNewInitStates. ToString() << ")");
1491 FD_DG( "vGenerator(" << this << ")::ClrInitState(" << index << ")");
1492#ifdef FAUDES_CHECKED
1494 std::stringstream errstr;
1495 errstr << "vGenerator::SetMarkedState: index " << index
1496 << " not in stateset";
1497 throw Exception( "vGenerator::ClrInitState(..)", errstr.str(), 91);
1505 FD_DG( "vGenerator(" << this << ")::ClrInitState(\"" << rName << "\")");
1507#ifdef FAUDES_CHECKED
1509 std::stringstream errstr;
1510 errstr << "State name \"" << rName << "\" not known in Generator";
1511 throw Exception( "vGenerator::ClrInitState(..)", errstr.str(), 90);
1519 FD_DG( "vGenerator(" << this << ")::ClrInitState(" << *pos << ")");
1530 FD_DG( "vGenerator(" << this << ")::SetMarkedState(" << index << ")");
1531#ifdef FAUDES_CHECKED
1533 std::stringstream errstr;
1534 errstr << "vGenerator::SetMarkedState: index " << index
1535 << " not in stateset";
1536 throw Exception( "vGenerator::SetMarkedState(..)", errstr.str(), 91);
1544 FD_DG( "vGenerator(" << this << ")::SetMarkedState(\"" << rName << "\")");
1546#ifdef FAUDES_CHECKED
1548 std::stringstream errstr;
1549 errstr << "State name \"" << rName << "\" not known in Generator";
1550 throw Exception( "vGenerator::SetMarkedState(..)", errstr.str(), 90);
1558 FD_DG( "vGenerator(" << this << ")::InjectMarkedStates("
1559 << rNewMarkedStates. ToString() << ")");
1566 FD_DG( "vGenerator(" << this << ")::ClrMarkedState(" << index << ")");
1567#ifdef FAUDES_CHECKED
1569 std::stringstream errstr;
1570 errstr << "vGenerator::ClrMarkedState: index " << index
1571 << " not in stateset";
1572 throw Exception( "vGenerator::ClrMarkedState(..)", errstr.str(), 91);
1580 FD_DG( "vGenerator(" << this << ")::ClrMarkedState(\"" << rName << "\")");
1582#ifdef FAUDES_CHECKED
1584 std::stringstream errstr;
1585 errstr << "State name \"" << rName << "\" not known in Generator";
1586 throw Exception( "vGenerator::ClrMarkedState(..)", errstr.str(), 90);
1594 FD_DG( "vGenerator(" << this << ")::ClrMarkedState(" << *pos << ")");
1605 FD_DG( "vGenerator::InjectTransition(" << TStr(rTrans) << ")");
1611 FD_DG( "vGenerator::InjectTransRel(...)");
1618 FD_DG( "vGenerator(" << this << ")::SetTransition(\""
1619 << rX1 << "\", \"" << rEv << "\", \"" << rX2 << "\")");
1622#ifdef FAUDES_CHECKED
1624 FD_ERR( "vGenerator::SetTransition: state " << rX1
1625 << " not in stateset");
1626 std::stringstream errstr;
1627 errstr << "State name " << rX1 << " not found in Generator";
1628 throw Exception( "vGenerator::SetTransition(..)", errstr.str(), 90);
1631 FD_ERR( "vGenerator::SetTransition: event " << rEv << " not in alphabet");
1632 std::stringstream errstr;
1633 errstr << "Event name " << rEv << " not found in event domain of Generator";
1634 throw Exception( "vGenerator::SetTransition(..)", errstr.str(), 95);
1637 FD_ERR( "vGenerator::SetTransition: state " << rX2 << " not in stateset");
1638 std::stringstream errstr;
1639 errstr << "State name " << rX2 << " not found in Generator";
1640 throw Exception( "vGenerator::SetTransition(..)", errstr.str(), 90);
1654 FD_DG( "vGenerator(" << this << ")::SetTransition(" << rTransition. X1 << ","
1655 << rTransition. Ev << "," << rTransition. X2 << ")");
1656#ifdef FAUDES_CHECKED
1658 std::stringstream errstr;
1659 errstr << "vGenerator::SetTransition: state " << SStr(rTransition. X1)
1660 << " not in stateset";
1661 throw Exception( "vGenerator::SetTransition(..)", errstr.str(), 95);
1664 std::stringstream errstr;
1665 errstr << "vGenerator::SetTransition: event " << EStr(rTransition. Ev)
1666 << " not in alphabet ";
1667 throw Exception( "vGenerator::SetTransition(..)", errstr.str(), 95);
1670 std::stringstream errstr;
1671 errstr << "vGenerator::SetTransition: state " << SStr(rTransition. X2)
1672 << " not in stateset";
1673 throw Exception( "vGenerator::SetTransition(..)", errstr.str(), 95);
1683 FD_DG( "vGenerator(" << this << ")::ClrTransition("
1684 << x1 << "," << ev << "," << x2 << ")");
1690 FD_DG( "vGenerator(" << this << ")::ClrTransition(" << TStr(rTransition) << ")");
1696 FD_DG( "vGenerator(" << this << ")::ClrTransition(" << TStr(*it)<< ")" );
1702 FD_DG( "vGenerator(" << this << ")::ClrTransition("
1703 << x1 << "," << ev << ")");
1709 FD_DG( "vGenerator(" << this << ")::ClrTransition("
1716 FD_DG( "vGenerator(" << this << ")::TransAttribute("
1717 << TStr(rTrans) << ",\"" << rAttr. ToString() << "\")");
1745 FD_DG( "vGenerator(" << this << ")::EventAttribute("
1753 FD_DG( "vGenerator(" << this << ")::EventAttributes("
1760 FD_DG( "vGenerator(" << this << ")::ClrEventAttribute(\"" << EStr(index) << "\")");
1766 FD_DG( "vGenerator(" << this << ")::StateAttribute("
1773 FD_DG( "vGenerator(" << this << ")::ClrStateAttribute(\"" << index << "\")");
1869 FD_DG( "vGenerator(" << this << ")::GlobalAttribute("
1874 std::stringstream errstr;
1875 errstr << "cannot cast global attribute " << rAttr. ToString() << " for generator " << Name();
1876 throw Exception( "vGenerator::GlobalAttribute", errstr.str(), 63);
1881 FD_DG( "vGenerator(" << this << ")::GlobalAttributeTry("
1888 FD_DG( "vGenerator(" << this << ")::GlobalAttribute()");
1894 FD_DG( "vGenerator(" << this << ")::GlobalAttributep()");
1925 const std::string& rX1, const std::string& rEv, const std::string& rX2) const {
1949 resultset. Insert(it->Ev);
2005 if(it==it_end) return 0;
2007#ifdef FAUDES_CHECKED
2010 std::stringstream errstr;
2011 errstr << "successor state does not exist uniquely" << std::endl;
2012 throw Exception( "vGenerator::SuccessorState", errstr.str(), 92);
2022 std::stack<Idx> todo;
2023 StateSet::Iterator sit;
2031 while(!todo.empty()) {
2036 if(accessibleset. Exists(x1)) continue;
2038 accessibleset. Insert(x1);
2042 for(; tit != tit_end; ++tit)
2047 accessibleset. Name( "AccessibleSet");
2048 return accessibleset;
2058 FD_DF( "vGenerator::accessible: generator is accessible");
2061 FD_DF( "vGenerator::accessible: generator is accessible but empty");
2068 FD_DF( "vGenerator::accessible: generator is accessible");
2071 FD_DF( "vGenerator::accessible: generator is not accessible");
2081 StateSet::Iterator sit;
2082 std::stack<Idx> todo;
2090 while(!todo.empty()) {
2095 if(coaccessibleset. Exists(x2)) continue;
2097 coaccessibleset. Insert(x2);
2101 for(; tit != tit_end; ++tit)
2106 coaccessibleset. Name( "CoaccessibleSet");
2107 return coaccessibleset;
2117 FD_DF( "vGenerator::coaccessible: generator is coaccessible");
2120 FD_DF( "vGenerator::coaccessible: generator is not coaccessible");
2127 FD_DF( "vGenerator::coaccessible: generator is coaccessible");
2130 FD_DF( "vGenerator::coaccessible: generator is not coaccessible");
2136 FD_DF( "vGenerator::trimset: trim states: "
2139 res. Name( "TrimSet");
2150 if(accessiblebool && coaccessiblebool) {
2151 FD_DF( "vGenerator::Trim(): generator is nontrivial");
2154 FD_DF( "vGenerator::Trim(): generator is trivial");
2164 FD_DF( "vGenerator::IsTrim(): result " << res);
2171 FD_DF( "vGenerator::BlockingSet: blocking states: "
2183 StateSet::Iterator sit=rStates. Begin();
2184 StateSet::Iterator sit_end=rStates. End();
2185 for(;sit!=sit_end;sit++){
2188 if(tit==tit_end) break;
2191 return sit==sit_end;
2199 std::stack<Idx> todo;
2202 while(tit!=tit_end){
2203 if(!rSigmaO. Exists(tit->Ev)) { ++tit; continue; }
2212 while(!todo.empty()) {
2217 if(good. Exists(x2)) continue;
2223 for(; tit != tit_end; ++tit)
2224 if(tit->X1 != x2) todo.push(tit->X1);
2226 FD_DG( "IsComplete(" << Name() << "): done");
2246 StateSet::Iterator sit_end = States(). End();
2248 for(; sit!=sit_end; ++sit) {
2249 if(termset. Exists(*sit)) continue;
2252 for (; tit != tit_end; ++tit) {
2253 if(!termset. Exists(tit->X2)) break;
2284 while(tit!=tit_end) {
2285 if(!rSigmaO. Exists(tit->Ev)) { ++tit; continue; }
2286 if(!domain. Exists(tit->X2)) { ++tit; continue; }
2293 StateSet::Iterator sit;
2294 std::stack<Idx> todo;
2295 for(sit = target. Begin(); sit != target. End(); ++sit)
2297 while(!todo.empty()) {
2302 if(good. Exists(x2)) continue;
2308 for(; tit != tit_end; ++tit)
2309 if(tit->X1 != x2) todo.push(tit->X1);
2313 if(domain <= good) break;
2316 domain = domain * good;
2331 FD_DG( "Generator::TerminalStates(" << Name() << ")");
2337 StateSet::Iterator sit=rStates. Begin();
2338 StateSet::Iterator sit_end=rStates. End();
2339 for(;sit!=sit_end;sit++){
2342 if(tit==tit_end) res. Insert(*sit);
2345 res. Name( "TerminalStates");
2361 FD_DG( "vGenerator::IsDeterministic: more than one initial state");
2369 if ((it1->X1 == it2->X1) && (it1->Ev == it2->Ev)) {
2370 FD_DG( "IsDeterministic(): at least one state "
2371 << "contains more than on transition with same event: "
2415 std::string label=rLabel;
2417 if(label== "") label= "Generator";
2418 FD_DG( "vGenerator(" << this << ")::DoWrite(): section " << label);
2450 std::string label=rLabel;
2451 if(label== "") label= "Generator";
2452 FD_DG( "vGenerator(" << this << ")::DoDWrite(): section " << label);
2480 std::string label=rLabel;
2482 if(label== "") label= "Generator";
2487 FD_DG( "vGenerator(" << this << ")::DoXWrite(..): section " << btag. StringValue() << " #" << Size());
2559 std::map<Idx,Idx> reversemap;
2560 std::map<Idx,Idx>::const_iterator minit;
2561 StateSet::Iterator sit;
2565 for(minit = reversemap.begin(); minit != reversemap.end(); ++minit) {
2567 std::map<Idx,Idx>::const_iterator conit=minit;
2568 Idx start = conit->first;
2570 for(; conit != reversemap.end(); ++conit) {
2571 if( StateName(conit->second) != "") break;
2573 if(conit->first != start+anoncount) break;
2580 rTw << start+anoncount-1;
2585 if(minit == reversemap.end()) break;
2587 std::string statename = StateName(minit->second);
2588 if (statename != "") rTw << statename;
2589 else rTw << minit->first;
2600 StateSet::Iterator sit;
2603 StateSet::Iterator conit=sit;
2609 if(*conit != start+anoncount) break;
2616 rTw << start+anoncount-1;
2623 std::string statename = StateName(*sit);
2624 if((statename != "") && symexpl) {
2626 } else if(statename != "") {
2644 std::string label=rLabel;
2645 if(label.empty()) label=rStateSet. Name();
2654 std::map<Idx,Idx> reversemap;
2655 std::map<Idx,Idx>::const_iterator minit;
2656 StateSet::Iterator sit;
2657 for (sit = rStateSet. Begin(); sit != rStateSet. End(); ++sit)
2660 for(minit = reversemap.begin(); minit != reversemap.end(); ++minit) {
2662 std::map<Idx,Idx>::const_iterator conit=minit;
2663 Idx start = conit->first;
2665 for(; conit != reversemap.end(); ++conit) {
2666 if( StateName(conit->second) != "") break;
2668 if(conit->first != start+anoncount) break;
2675 rTw << start+anoncount-1;
2680 if(minit == reversemap.end()) break;
2682 std::string statename = StateName(minit->second);
2683 if (statename != "") rTw << statename;
2684 else rTw << minit->first;
2694 StateSet::Iterator sit;
2695 for(sit = rStateSet. Begin(); sit != rStateSet. End(); ++sit) {
2697 StateSet::Iterator conit=sit;
2700 for(; conit != rStateSet. End(); ++conit) {
2703 if(*conit != start+anoncount) break;
2710 rTw << start+anoncount-1;
2715 if(sit == rStateSet. End()) break;
2717 std::string statename = StateName(*sit);
2718 if (statename != "") rTw << statename;
2733 StateSet::Iterator sit;
2734 for(sit = rStateSet. Begin(); sit != rStateSet. End(); ++sit) {
2746 std::string label=rLabel;
2747 if(label== "") label=rStateSet. Name();
2748 if(label== "") label= "StateSet";
2753 std::map<Idx,Idx> reversemap;
2754 std::map<Idx,Idx>::const_iterator minit;
2755 StateSet::Iterator sit;
2756 for (sit = rStateSet. Begin(); sit != rStateSet. End(); ++sit) {
2760 for(minit = reversemap.begin(); minit != reversemap.end(); ++minit) {
2762 std::map<Idx,Idx>::const_iterator conit=minit;
2763 Idx start = conit->first;
2765 for(; conit != reversemap.end(); ++conit) {
2766 if( StateName(conit->second) != "") break;
2770 if(conit->first != start+anoncount) break;
2783 if(minit == reversemap.end() )
2787 std::string statename = StateName(minit->second);
2788 Idx index=minit->first;
2853 int oldcolumns = rTw. Columns();
2863 if (smalltransrel) {
2864 std::string x1name = StateName(tit->X1);
2879 if (smalltransrel) {
2880 std::string x2name = StateName(tit->X2);
2901 int oldcolumns = rTw. Columns();
2907 std::ostringstream ox1;
2911 ox1 << x1name << "#" << x1;
2917 std::ostringstream oev;
2920 oev << evname << "#" << ev;
2923 std::ostringstream ox2;
2927 ox2 << x2name << "#" << x2;
2975 rTw. WriteEnd( "TransitionRelation");
2996 FD_DG( "vGenerator(" << this << ")::DotWrite(" << rFileName << ")");
3000 StateSet::Iterator lit;
3006 if(!xname.empty()) circles= false;
3008 if(xname.length()>2) circles= false;
3014 std::ofstream stream;
3015 stream.exceptions(std::ios::badbit|std::ios::failbit);
3016 stream.open(rFileName.c_str());
3017 stream << "// dot output generated by libFAUDES vGenerator" << std::endl;
3018 stream << "digraph \"" << Name() << "\" {" << std::endl;
3019 stream << " rankdir=LR" << std::endl;
3021 stream << " node [shape=circle];" << std::endl;
3023 stream << " node [shape=rectangle, style=rounded];" << std::endl;
3024 stream << std::endl;
3026 stream << " // initial states" << std::endl;
3031 stream << " dot_dummyinit_" << i << " [shape=none, label=\"\", width=\"0.0\", height=\"0.0\" ];" << std::endl;
3032 stream << " dot_dummyinit_" << i << " -> \"" << xname << "\";" << std::endl;
3035 stream << std::endl;
3037 stream << " // mstates" << std::endl;
3042 stream << " \"" << xname << "\" [shape=doublecircle];" << std::endl;
3045 "<<TABLE BORDER=\"0\"><TR><TD>" +
3047 "</TD><TD WIDTH=\"2\"></TD><TD BGCOLOR=\"black\" BORDER=\"0\" WIDTH=\"8\"></TD></TR></TABLE>>";
3048 stream << " \"" << xname << "\" [ label=" << xlabel << "];" << std::endl;
3051 stream << std::endl;
3053 stream << " // rest of stateset" << std::endl;
3058 stream << " \"" << xname << "\";" << std::endl;
3061 stream << std::endl;
3063 stream << " // transition relation" << std::endl;
3065 for(tit = trx1x2ev. Begin(); tit != trx1x2ev. End();) {
3067 if(!elabel.empty()) elabel = elabel + ", ";
3068 if(elabel.length()>9) elabel = elabel + "\n";
3075 if(tit==trx1x2ev. End())
3078 flush=((tit->X1 != x1) || (tit->X2 != x2));
3085 stream << " \"" << x1name << "\" -> \"" << x2name
3086 << "\" [label=\"" << elabel << "\"];" << std::endl;
3090 stream << "}" << std::endl;
3093 catch (std::ios::failure&) {
3095 "Exception opening/writing dotfile \""+rFileName+ "\"", 2);
3102 FD_DG( "vGenerator(" << this << ")::DDotWrite(" << rFileName << ")");
3103 StateSet::Iterator lit;
3106 std::ofstream stream;
3107 stream.exceptions(std::ios::badbit|std::ios::failbit);
3108 stream.open(rFileName.c_str());
3109 stream << "digraph \"" << Name() << "\" {" << std::endl;
3110 stream << " rankdir=LR" << std::endl;
3111 stream << " node [shape=circle];" << std::endl;
3112 stream << std::endl;
3113 stream << " // istates" << std::endl;
3116 stream << " dot_dummyinit_" << i << " [shape=none, label=\"\" ];" << std::endl;
3117 stream << " dot_dummyinit_" << i << " -> \""
3118 << SStr(*lit) << "\";" << std::endl;
3121 stream << std::endl;
3122 stream << " // mstates" << std::endl;
3124 stream << " \"" << SStr(*lit) << "\" [shape=doublecircle];" << std::endl;
3126 stream << std::endl;
3127 stream << " // rest of stateset" << std::endl;
3131 stream << " \"" << SStr(*lit) << "\";" << std::endl;
3134 stream << std::endl;
3135 stream << " // transition relation" << std::endl;
3137 stream << " \"" << SStr(tit->X1)
3138 << "\" -> \"" << SStr(tit->X2)
3139 << "\" [label=\"" << EventName(tit->Ev) << "\"];" << std::endl;
3141 stream << "}" << std::endl;
3144 catch (std::ios::failure&) {
3145 throw Exception( "vGenerator::DDotWrite",
3146 "Exception opening/writing dotfile \""+rFileName+ "\"", 2);
3153 FD_DG( "vGenerator(" << this << ")::XDotWrite(" << rFileName << ")");
3154 StateSet::Iterator lit;
3157 std::ofstream stream;
3158 stream.exceptions(std::ios::badbit|std::ios::failbit);
3159 stream.open(rFileName.c_str());
3160 stream << "digraph \"___" << Name() << "___\" {" << std::endl;
3161 stream << " rankdir=LR" << std::endl;
3162 stream << " node [shape=circle];" << std::endl;
3163 stream << std::endl;
3164 stream << " // stateset" << std::endl;
3166 stream << " \"s" << *lit << "\";" << std::endl;
3169 stream << " \"s" << *lit << "\";" << std::endl;
3174 stream << " \"s" << *lit << "\";" << std::endl;
3176 stream << std::endl;
3177 stream << " // transition relation" << std::endl;
3179 stream << " \"s" << tit->X1
3180 << "\" -> \"s" << tit->X2
3181 << "\" [label=\"e" << tit->Ev << "\" " << "polyline" << "];" << std::endl;
3183 stream << "}" << std::endl;
3186 catch (std::ios::failure&) {
3187 throw Exception( "vGenerator::XDotWrite",
3188 "Exception opening/writing dotfile \""+rFileName+ "\"", 2);
3195 std::string label=rLabel;
3196 if(label== "") label= "Generator";
3197 FD_DG( "vGenerator(" << this << ")::DoRead(): file " << rTr. FileName() << " section " << label);
3203 int seclev=rTr. Level();
3212 FD_DG( "vGenerator(" << this << ")::DoRead(): relaxed native header")
3213 std::string name= "Generator";
3225 FD_DG( "vGenerator(" << this << ")::DoRead(): relaxed native core")
3233 FD_DG( "vGenerator(" << this << ")::DoRead(): " << token. Str());
3244 FD_DG( "vGenerator(" << this << ")::DoRead(): native extra items")
3248 if(token. IsBegin( "InitStates"))
3255 if(token. IsBegin( "MarkedStates"))
3264 if(native) xml= false;
3267 FD_DG( "vGenerator(" << this << ")::DoRead(): xml")
3269 std::string name= "generator";
3288 FD_DG( "vGenerator(" << this << ")::DoRead(): done");
3293 FD_DG( "vGenerator(" << this << ")::ReadAlphabet(\""
3306 FD_DG( "vGenerator(" << this << ")::ReadStates(\"" << rTr. FileName() << "\")");
3309 std::string label= "";
3313 if(label== "") return;
3315 FD_DG( "vGenerator(" << this << ")::ReadStates(..): attribute type " << typeid(*attrp).name());
3326 while(!rTr. Eos(label)) {
3333 FD_DG( "vGenerator(" << this << ")::ReadStates(\"" << rTr. FileName() << "\"): by index " << index);
3336 std::stringstream errstr;
3337 errstr << "Token " << token. IntegerValue() << " appears twice in stateset"
3339 throw Exception( "vGenerator::ReadStates", errstr.str(), 80);
3342 attrp-> Read(rTr, "", this);
3358 std::size_t pos= statename.find_first_of( '#');
3359 if(pos==std::string::npos) symimpl= true;
3360 if(pos!=std::string::npos) symexpl= true;
3361 if(pos!=std::string::npos && pos < statename.size()-1) {
3362 std::string suffix=statename.substr(pos+1);
3363 index= ToIdx(suffix);
3364 statename=statename.substr(0,pos);
3365 FD_DG( "vGenerator(" << this << ")::ReadStates(\"" << rTr. FileName() << "\"): extracted suffix from " << token. StringValue() << ": " << statename << " idx " << index);
3370 std::stringstream errstr;
3371 errstr << "State " << statename << "(idx " << index << ") appears twice in stateset"
3373 throw Exception( "vGenerator::ReadStates", errstr.str(), 80);
3376 attrp-> Read(rTr, "", this);
3387 if(token. IsBegin( "Consecutive")) {
3389 Token token1,token2;
3392 FD_DG( "vGenerator(" << this << ")::ReadStates(\"" << rTr. FileName() << "\"): consecutive range");
3395 std::stringstream errstr;
3396 errstr << "Invalid range of consecutive states" << rTr. FileLine();
3397 throw Exception( "vGenerator::ReadStates", errstr.str(), 80);
3402 std::stringstream errstr;
3403 errstr << "Index " << index << " appears twice in stateset"
3405 throw Exception( "vGenerator::ReadStates", errstr.str(), 80);
3415 std::stringstream errstr;
3416 errstr << "Invalid token" << rTr. FileLine();
3417 throw Exception( "vGenerator::ReadStates", errstr.str(), 80);
3421 if(symimpl && symexpl) {
3423 std::stringstream errstr;
3424 errstr << "StateSet with inconsitent explicit symboltable" << rTr. FileLine();
3425 throw Exception( "vGenerator::ReadStates", errstr.str(), 80);
3429 FD_DG( "vGenerator(" << this << ")::ReadStates(\"" << rTr. FileName() << "\"): done");
3435 FD_DG( "vGenerator(" << this << ")::ReadStateSet(\"" << rLabel<< "\")");
3439 FD_DG( "vGenerator(" << this << ")::ReadStateSet(..): attribute type " << typeid(*attrp).name());
3443 rStateSet. Name(rLabel);
3445 while(!rTr. Eos(rLabel)) {
3455 std::stringstream errstr;
3456 errstr << "Token " << token. IntegerValue() << " not in generator stateset"
3458 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3461 attrp-> Read(rTr, "", this);
3475 std::size_t pos= statename.find_first_of( '#');
3476 if(pos!=std::string::npos) {
3478 std::stringstream errstr;
3479 errstr << "invalid symbolic name: " << token. StringValue()
3480 << " (no suffix allowed in external state sets)" << rTr. FileLine();
3481 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3486 std::stringstream errstr;
3487 errstr << "Symbolic name " << token. StringValue() << " not in stateset"
3489 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3492 attrp-> Read(rTr, "", this);
3504 std::string name= "";
3510 FD_DG( "vGenerator::ReadStateSet(): got idx " << index << " " << name);
3518 std::stringstream errstr;
3519 errstr << "Cannot figure index for state token " << token. Str() << rTr. FileLine();
3520 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3523 if(rStateSet. Exists(index)) {
3525 std::stringstream errstr;
3526 errstr << "Doublet state from token " << token. Str() << rTr. FileLine();
3527 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3537 if(!rTr. Eos( "State")) {
3538 FD_DG( "vGenerator(" << this << ")::ReadStates(\"" << rTr. FileName() << "\"): attribute ?");
3539 attrp-> Read(rTr, "", this);
3553 Token token1,token2;
3568 std::stringstream errstr;
3569 errstr << "Invalid range of consecutive states" << rTr. FileLine();
3570 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3576 if(idx1==0 || idx2 < idx1) {
3578 std::stringstream errstr;
3579 errstr << "Invalid range of consecutive states" << rTr. FileLine();
3580 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3583 FD_DG( "vGenerator(" << this << ")::ReadStateSet(\"" << rTr. FileName() << "\"): consecutive range " << idx1 << " to " << idx2);
3584 for( Idx index = idx1; index <= idx2; ++index) {
3587 std::stringstream errstr;
3588 errstr << "range not in generator stateset" << rTr. FileLine();
3589 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3605 std::stringstream errstr;
3606 errstr << "Section " << rLabel << ": Invalid token" << rTr. FileLine() << ": " << token. Str();
3607 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 50);
3616 FD_DG( "vGenerator(" << this << ")::XReadStateSet(\"" << rLabel<< "\")");
3618 FD_DG( "vGenerator(" << this << ")::ReadStateSet(..): attribute type " << typeid(*attrp).name());
3622 std::string label=rLabel;
3623 if(label== "") label=rStateSet. Name();
3624 if(label== "") label= "StateSet";
3633 while(!rTr. Eos(label)) {
3637 if(sttag. IsBegin( "Consecutive")) {
3646 if(idx1==0 || idx2 < idx1) {
3648 std::stringstream errstr;
3649 errstr << "Invalid range of consecutive states" << rTr. FileLine();
3650 throw Exception( "vGenerator::XReadStates", errstr.str(), 80);
3652 FD_DG( "vGenerator(" << this << ")::XReadStates(\"" << rTr. FileName() << "\"): consecutive range " << idx1 << " to " << idx2);
3653 for( Idx index = idx1; index <= idx2; ++index) {
3654 if(rStateSet. Exists(index)) {
3656 std::stringstream errstr;
3657 errstr << "Doublet state index " << index << " " << rTr. FileLine();
3658 throw Exception( "vGenerator::XReadStates", errstr.str(), 80);
3673 std::string name= "";
3679 FD_DG( "vGenerator::XReadStateSet(): got idx " << index << " " << name);
3687 std::stringstream errstr;
3688 errstr << "Cannot figure index for state token " << sttag. Str() << rTr. FileLine();
3689 throw Exception( "vGenerator::XReadStateSet", errstr.str(), 80);
3692 if(rStateSet. Exists(index)) {
3694 std::stringstream errstr;
3695 errstr << "Doublet state from token " << sttag. Str() << rTr. FileLine();
3696 throw Exception( "vGenerator::XReadStateSet", errstr.str(), 80);
3706 while(!rTr. Eos( "State")) {
3730 FD_DG( "vGenerator(" << this << ")::XReadStates(\"" << rTr. FileName() << "\"): attribute ?");
3731 attrp-> Read(rTr, "", this);
3742 FD_DG( "vGenerator(" << this << ")::XReadStates(\"" << rTr. FileName() << "\"): done");
3749 FD_DG( "vGenerator(" << this << ")::ReadTransRel(\"" << rTr. FileName() << "\")");
3751 FD_DG( "vGenerator(" << this << ")::ReadTransRel(..): attribute type " << typeid(*attrp).name());
3754 std::string label= "";
3757 if(token. IsBegin( "TransRel")) label= "TransRel";
3758 if(token. IsBegin( "T")) label= "T";
3760 std::stringstream errstr;
3761 errstr << "Reading TransRel failed in " << rTr. FileLine() << ": no valid begin token";
3762 throw Exception( "vGenerator::ReadTransRel", errstr.str(), 50);
3773 while(!rTr. Eos(label)) {
3781 Idx x1 = 0, ev = 0, x2 = 0;
3812 attrp-> Read(rTr, "", this);
3819 std::stringstream errstr;
3821 throw Exception( "vGenerator::ReadTransRel", errstr.str(), 85);
3824 std::stringstream errstr;
3826 throw Exception( "vGenerator::ReadTransRel", errstr.str(), 85);
3829 std::stringstream errstr;
3831 throw Exception( "vGenerator::ReadTransRel", errstr.str(), 85);
3844 std::stringstream errstr;
3845 errstr << "Reading TransRel failed in " << rTr. FileLine() << " " << oex. What();
3846 throw Exception( "vGenerator::ReadTransRel", errstr.str(), 50);
3853 FD_DG( "vGenerator(" << this << ")::ReadTransRel(\"" << rTr. FileName() << "\"): done");
3862 FD_DG( "vGenerator(" << this << ")::XReadTransRel()");
3864 FD_DG( "vGenerator(" << this << ")::ReadTransRel(..): attribute type " << typeid(*attrp).name());
3870 rTr. ReadBegin( "TransitionRelation",btag);
3872 while(!rTr. Eos( "TransitionRelation")) {
3876 if(!trtag. IsBegin( "Transition")) {
3905 if(x1==0 || x2==0 || ev==0) {
3907 std::stringstream errstr;
3908 errstr << "Invalid transition at token " << trtag. Str() << rTr. FileLine();
3909 throw Exception( "vGenerator::XReadTransRel", errstr.str(), 80);
3914 std::stringstream errstr;
3915 errstr << "Doublet transition at token " << trtag. Str() << rTr. FileLine();
3916 throw Exception( "vGenerator::XReadTransRel", errstr.str(), 80);
3921 std::stringstream errstr;
3922 errstr << "Invalid state x1 " << x1 << " " << rTr. FileLine();
3923 throw Exception( "vGenerator::XReadTransRel", errstr.str(), 80);
3927 std::stringstream errstr;
3928 errstr << "Invalid state x2 " << x2 << " " << rTr. FileLine();
3929 throw Exception( "vGenerator::XReadTransRel", errstr.str(), 80);
3933 std::stringstream errstr;
3934 errstr << "Invalid event " << evname << " " << rTr. FileLine();
3935 throw Exception( "vGenerator::XReadTransRel", errstr.str(), 80);
3942 if(!token. IsEnd( "Transition")) {
3944 attrp-> Read(rTr, "", this);
3950 rTr. ReadEnd( "TransitionRelation");
3953 FD_DG( "vGenerator(" << this << ")::XReadTransRel(\"" << rTr. FileName() << "\"): done");
3977 const std::string& rDotExec) const {
3978 FD_DG( "vGenerator::GraphWrite(...): " << typeid(*this).name());
3982 std::stringstream errstr;
3983 errstr << "Exception opening temp file";
3984 throw Exception( "vGenerator::GraphWrite", errstr.str(), 2);
3991 std::stringstream errstr;
3992 errstr << "Exception writing dot input file";
3993 throw Exception( "vGenerator::GraphWrite", errstr.str(), 2);
4000 std::stringstream errstr;
4001 errstr << "Exception processing dot file";
4002 throw Exception( "vGenerator::GraphWrite", errstr.str(), 3);
4119 if(rGenVec. Size()==0) return;
4133 if(rGenVec. Size()==0) return;
#define FAUDES_OBJCOUNT_DEC(type)
#define FAUDES_OBJCOUNT_INC(type)
static void Skip(TokenReader &rTr)
virtual bool IsDefault(void) const
virtual const char * What() const
const std::string & Name(void) const
virtual const std::string & TypeName(void) const
bool Exists(const Idx &rIndex) const
NameSet::Iterator Find(const Idx &rIndex) const
virtual void InsertSet(const NameSet &rOtherSet)
SymbolTable * SymbolTablep(void) const
bool Insert(const Idx &rIndex)
Idx Index(const std::string &rName) const
void RestrictSet(const NameSet &rOtherSet)
virtual bool Erase(const Idx &rIndex)
void RestrictDomain(const IndexSet &rDomain)
static SymbolTable * GlobalEventSymbolTablep(void)
std::string Symbol(Idx index) const
std::string UniqueSymbol(const std::string &rName) const
void SetEntry(Idx index, const std::string &rName)
Idx Index(const std::string &rName) const
std::vector< int >::size_type Position
virtual const T & At(const Position &pos) const
Iterator Begin(void) const
Iterator Find(Idx x1, Idx ev, Idx x2) const
TBaseSet< Transition, TransSort::X2EvX1 >::Iterator Iterator
bool Exists(const Transition &t) const
void RestrictStates(const StateSet &rStateSet)
Iterator BeginByX2(Idx x2) const
void EraseByX1Ev(Idx x1, Idx ev)
bool Insert(const Transition &rTransition)
Iterator EndByX2(Idx x2) const
bool ExistsByX1Ev(Idx x1, Idx ev) const
Iterator Inject(const Iterator &pos, const Transition &rTransition)
bool Erase(const Transition &t)
StateSet SuccessorStates(Idx x1) const
void RestrictEvents(const EventSet &rEventSet)
void EraseByX1OrX2(Idx x)
void ReSort(TTransSet< OtherCmp > &res) const
bool ExistsByX1(Idx x1) const
std::string FileLine(void) const
bool Eos(const std::string &rLabel)
void ReadEnd(const std::string &rLabel)
std::string ReadString(void)
void ReadBegin(const std::string &rLabel)
std::string FileName(void) const
void WriteComment(const std::string &rComment)
void Write(Token &rToken)
void WriteEnd(const std::string &rLabel)
void WriteBegin(const std::string &rLabel)
std::string Str(void) const
const std::string & StringValue(void) const
Int AttributeIntegerValue(const std::string &name)
bool IsString(void) const
Int IntegerValue(void) const
bool IsInteger(void) const
bool ExistsAttributeString(const std::string &name)
void SetEmpty(const std::string &rName)
void SetBegin(const std::string &rName)
bool ExistsAttributeInteger(const std::string &name)
void InsAttributeInteger(const std::string &name, Int value)
void InsAttributeString(const std::string &name, const std::string &value)
const std::string & AttributeStringValue(const std::string &name)
virtual Type * NewCpy(void) const
void DWrite(const Type *pContext=0) const
void Read(const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
std::string ToString(const std::string &rLabel="", const Type *pContext=0) const
virtual Type & Copy(const Type &rSrc)
virtual void XWrite(const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
virtual Type * New(void) const
virtual void DoSWrite(TokenWriter &rTw) const
void Write(const Type *pContext=0) const
static bool ReindexOnWriteDefault(void)
const EventSet * pAlphabetPrototype
virtual void TransAttribute(const Transition &rTrans, const Type &rAttr)
StateSet::Iterator StatesBegin(void) const
StateSet::Iterator InitStatesBegin(void) const
virtual bool Valid(void) const
const TransSet & TransRel(void) const
bool SetTransition(Idx x1, Idx ev, Idx x2)
const StateSet & MarkedStates(void) const
void ClearInitStates(void)
void WriteStates(TokenWriter &rTw) const
static const StateSet & StatesVoid(void)
const EventSet & Alphabet(void) const
void XReadStateSet(TokenReader &rTr, StateSet &rStateSet, const std::string &rLabel="") const
std::string TransRelToString(void) const
virtual void DDotWrite(const std::string &rFileName) const
static void StateNamesEnabledDefault(bool flag)
const AttributeVoid * pGlobalPrototype
std::string MarkedStatesToString(void) const
bool InitStatesEmpty(void) const
std::string StatesToString(void) const
EventSet ActiveEventSet(Idx x1) const
virtual ~vGenerator(void)
void DelEvents(const EventSet &rEvents)
const StateSet & InitStates(void) const
const SymbolTable & StateSymbolTable(void) const
TransSet::Iterator TransRelBegin(void) const
void ClrTransition(Idx x1, Idx ev, Idx x2)
EventSet * NewEventSetp(void) const
EventSet NewEventSet(void) const
SymbolTable * EventSymbolTablep(void) const
void WriteAlphabet(void) const
virtual vGenerator * NewCpy(void) const
AttributeVoid * mpGlobalAttribute
Idx StateIndex(const std::string &rName) const
virtual void ClearEventAttributes(void)
void InjectState(Idx index)
static const AttributeVoid & GlobalVoid(void)
virtual void EventAttribute(Idx index, const Type &rAttr)
void SetMinStateIndexMap(void) const
virtual void StateAttribute(Idx index, const Type &rAttr)
StateSet::Iterator FindInitState(Idx index) const
void ReadAlphabet(TokenReader &rTr)
void ClrTransitions(Idx x1, Idx ev)
virtual void RestrictStates(const StateSet &rStates)
EventSet::Iterator FindEvent(Idx index) const
Idx InitStatesSize(void) const
virtual vGenerator & CopyWithoutAttributes(const vGenerator &rGen)
virtual vGenerator & Move(Type &rGen)
static bool msReindexOnWriteDefault
virtual void ClearTransAttributes(void)
bool IsAccessible(void) const
void ReadStates(TokenReader &rTr)
void InsEvents(const EventSet &events)
void ClrMarkedState(Idx index)
void InjectStates(const StateSet &rNewStates)
static SymbolTable * GlobalEventSymbolTablep(void)
virtual AttributeVoid * GlobalAttributep(void)
bool EventRename(Idx event, const std::string &rNewName)
virtual void GlobalAttribute(const Type &rAttr)
virtual AttributeVoid * TransAttributep(const Transition &rTrans)
EventSet::Iterator AlphabetBegin(void) const
SymbolTable mStateSymbolTable
void WriteStateSet(const StateSet &rStateSet) const
virtual void DeleteCore(void)
SymbolTable * mpEventSymbolTable
StateSet TransRelStates(void) const
static const EventSet & AlphabetVoid(void)
virtual void DoWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
StateSet BlockingStates(void) const
bool IsComplete(void) const
bool MarkedStatesEmpty(void) const
StateSet::Iterator FindMarkedState(Idx index) const
virtual AttributeVoid * EventAttributep(Idx index)
const std::map< Idx, Idx > & MinStateIndexMap(void) const
void DWriteStateSet(TokenWriter &rTw, const StateSet &rStateSet) const
Idx MaxStateIndex(void) const
void ClrStateName(Idx index)
virtual vGenerator * New(void) const
void ClearMarkedStates(void)
virtual void UpdateCore(void)
virtual void ClearStateAttributes(void)
bool ExistsTransition(const std::string &rX1, const std::string &rEv, const std::string &rX2) const
void EnforceStateNames(const std::string &rTemplate)
void InjectMarkedStates(const StateSet &rNewMarkedStates)
virtual void ClearGlobalAttribute(void)
virtual void DoDWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
Idx MarkedStatesSize(void) const
void SetInitState(Idx index)
virtual void DoSWrite(TokenWriter &rTw) const
void InsStates(const StateSet &rStates)
virtual void GlobalAttributeTry(const Type &rAttr)
void ClearStateNames(void)
TransSet ActiveTransSet(Idx x1) const
void WriteTransRel(void) const
void XWriteStateSet(TokenWriter &rTw, const StateSet &rStateSet, const std::string &rLabel="") const
void InsMarkedStates(const StateSet &rStates)
bool TransRelEmpty(void) const
StateSet TrimSet(void) const
std::string InitStatesToString(void) const
StateSet AccessibleSet(void) const
Idx EventIndex(const std::string &rName) const
bool ExistsState(Idx index) const
virtual const AttributeVoid & GlobalAttribute(void) const
virtual AttributeVoid * StateAttributep(Idx index)
virtual void ClrTransAttribute(const Transition &rTrans)
bool IsCoaccessible(void) const
void ConfigureAttributeTypes(const AttributeVoid *pNewGlobalPrototype, const StateSet *pNewStatesPrototype, const EventSet *pNewAlphabetPrototype, const TransSet *pNewTransRelPrototype)
StateSet::Iterator MarkedStatesBegin(void) const
virtual void DoRead(TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
const TransSet * pTransRelPrototype
void XWriteTransRel(TokenWriter &rTw) const
bool DelEventFromAlphabet(Idx index)
void InjectTransition(const Transition &rTrans)
StateSet::Iterator FindState(Idx index) const
std::string StateSetToString(const StateSet &rStateSet) const
std::string UniqueEventName(const std::string &rName) const
void DoMove(vGenerator &rSrc)
virtual void RestrictAlphabet(const EventSet &rNewalphabet)
std::string TStr(const Transition &rTrans) const
bool DelStateFromStates(Idx index)
static bool msStateNamesEnabledDefault
std::string StateName(Idx index) const
virtual void DotWrite(const std::string &rFileName) const
void DoCopy(const vGenerator &rSrc)
void XReadTransRel(TokenReader &rTr)
virtual void XDotWrite(const std::string &rFileName) const
StateSet::Iterator StatesEnd(void) const
void ClrInitState(Idx index)
void DelStates(const StateSet &rDelStates)
TransSet::Iterator TransRelEnd(void) const
Idx SuccessorState(Idx x1, Idx ev) const
bool IsDeterministic(void) const
bool ExistsEvent(Idx index) const
std::string EStr(Idx index) const
std::map< Idx, Idx > mMinStateIndexMap
StateSet TerminalStates(void) const
StateSet::Iterator MarkedStatesEnd(void) const
void InjectTransRel(const TransSet &rNewtransrel)
void SetMarkedState(Idx index)
Transition TransitionByNames(const std::string &rX1, const std::string &rEv, const std::string &rX2) const
Idx InitState(void) const
std::string StateSetToText(const StateSet &rStateSet) const
void ReadStateSet(TokenReader &rTr, const std::string &rLabel, StateSet &rStateSet) const
bool ReindexOnWrite(void) const
virtual void EventAttributes(const EventSet &rEventSet)
void InsInitStates(const StateSet &rStates)
void InjectInitStates(const StateSet &rNewInitStates)
bool StateNamesEnabled(void) const
virtual vGenerator & Copy(const Type &rSrc)
std::string TransRelToText(void) const
StateSet::Iterator InitStatesEnd(void) const
virtual void NewCore(void)
void SetDefaultStateNames(void)
void GraphWrite(const std::string &rFileName, const std::string &rOutFormat="", const std::string &rDotExec="dot") const
static const TransSet & TransRelVoid(void)
virtual void ClrStateAttribute(Idx index)
Idx TransRelSize(void) const
virtual void Version(const std::string &rVersion, vGenerator &rResGen) const
EventSet UsedEvents(void) const
EventSet UnusedEvents(void) const
virtual const Type * Cast(const Type *pOther) const
void ClearMinStateIndexMap(void) const
std::string EventName(Idx index) const
const StateSet * pStatesPrototype
EventSet::Iterator AlphabetEnd(void) const
std::string StatesToText(void) const
virtual void ClearAttributes(void)
virtual void DoXWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
StateSet CoaccessibleSet(void) const
void MinimizeAlphabet(void)
vGenerator & operator=(const vGenerator &rOtherGen)
Idx AlphabetSize(void) const
SymbolTable * mpStateSymbolTable
virtual void ClrEventAttribute(Idx index)
bool ExistsInitState(Idx index) const
std::string SStr(Idx index) const
bool ExistsMarkedState(Idx index) const
TransSet::Iterator FindTransition(const std::string &rX1, const std::string &rEv, const std::string &rX2) const
std::string AlphabetToString(void) const
std::string UniqueStateName(const std::string &rName) const
void ReadTransRel(const std::string &rFileName)
void DWriteTransRel(TokenWriter &rTw) const
const StateSet & States(void) const
void InjectAlphabet(const EventSet &rNewalphabet)
StateSet SuccessorStates(Idx x1) const
bool AlphabetEmpty(void) const
virtual const AttributeVoid * AttributeType(void) const
virtual TBaseSet & CopyWithoutAttributes(const TBaseSet &rSourceSet)
void SetDifference(const TBaseSet< T, Cmp > &rSetA, const TBaseSet< T, Cmp > &rSetB, TBaseSet< T, Cmp > &rRes)
bool Exists(const T &rElem) const
virtual void Attributes(const TBaseSet &rOtherSet)
TTransSet< TransSort::X1EvX2 > TransSet
Iterator Find(const T &rElem) const
Idx AttributesSize(void) const
TTransSet< TransSort::X1X2Ev > TransSetX1X2Ev
virtual void RestrictSet(const TBaseSet &rOtherSet)
virtual void InsertSet(const TBaseSet &rOtherSet)
virtual AttributeVoid * Attributep(const T &rElem)
Iterator Begin(void) const
virtual const AttributeVoid & Attribute(const T &rElem) const
virtual bool Erase(const T &rElem)
void SetUnion(const TBaseSet< T, Cmp > &rSetA, const TBaseSet< T, Cmp > &rSetB, TBaseSet< T, Cmp > &rRes)
void SetIntersection(const TBaseSet< T, Cmp > &rSetA, const TBaseSet< T, Cmp > &rSetB, TBaseSet< T, Cmp > &rRes)
virtual void EraseSet(const TBaseSet &rOtherSet)
void ClearAttributes(void)
virtual void ClrAttribute(const T &rElem)
bool IsComplete(const vGenerator &rGen)
void Trim(vGenerator &rGen)
void Complete(vGenerator &rGen)
bool IsAccessible(const vGenerator &rGen)
bool IsTrim(const vGenerator &rGen)
void MarkAllStates(vGenerator &rGen)
bool IsCoaccessible(const vGenerator &rGen)
void AlphabetExtract(const vGenerator &rGen, EventSet &rRes)
void Accessible(vGenerator &rGen)
void Coaccessible(vGenerator &rGen)
bool IsDeterministic(const vGenerator &rGen)
AutoRegisterType< GeneratorVector > gRtiGeneratorVector("GeneratorVector")
AutoRegisterType< Generator > gRtiGenerator("Generator")
Idx ToIdx(const std::string &rString)
void ApplyRelabelMap(const RelabelMap &rMap, const vGenerator &rGen, vGenerator &rRes)
void ProcessDot(const std::string &rDotFile, const std::string &rOutFile, const std::string &rOutFormat, const std::string &rDotExec)
std::string CreateTempFile(void)
bool FileDelete(const std::string &rFilename)
std::string ToStringInteger(Int number)
libFAUDES 2.34d
--- 2026.03.11
--- c++ api documentaion by doxygen
|