|
|
Go to the documentation of this file.
70 mpStateSymbolTable(&mStateSymbolTable),
71 mpEventSymbolTable(GlobalEventSymbolTablep()),
73 mStateNamesEnabled(msStateNamesEnabledDefault),
74 mReindexOnWrite(msReindexOnWriteDefault),
81 pAlphabetPrototype(&AlphabetVoid()),
82 pStatesPrototype(&StatesVoid()),
83 pTransRelPrototype(&TransRelVoid()),
84 pGlobalPrototype(&GlobalVoid())
87 FD_DG( "vGenerator(" << this << ")::vGenerator()");
105 mpStateSymbolTable(&mStateSymbolTable),
106 mpEventSymbolTable(GlobalEventSymbolTablep()),
108 mStateNamesEnabled(msStateNamesEnabledDefault),
109 mReindexOnWrite(msReindexOnWriteDefault),
114 mpGlobalAttribute(0),
116 pAlphabetPrototype(&AlphabetVoid()),
117 pStatesPrototype(&StatesVoid()),
118 pTransRelPrototype(&TransRelVoid()),
119 pGlobalPrototype(&GlobalVoid())
122 FD_DG( "vGenerator(" << this << ")::vGenerator(" << &rOtherGen << ")");
139 mpStateSymbolTable(&mStateSymbolTable),
140 mpEventSymbolTable(GlobalEventSymbolTablep()),
142 mStateNamesEnabled(msStateNamesEnabledDefault),
143 mReindexOnWrite(msReindexOnWriteDefault),
148 mpGlobalAttribute(0),
150 pAlphabetPrototype(&AlphabetVoid()),
151 pStatesPrototype(&StatesVoid()),
152 pTransRelPrototype(&TransRelVoid()),
153 pGlobalPrototype(&GlobalVoid())
156 FD_DG( "vGenerator(" << this << ")::vGenerator(" << rFileName << ")");
170 Read(rFileName, "Generator");
177 FD_DG( "vGenerator(" << this << ")::New()");
189 FD_DG( "vGenerator(" << this << ")::Copy()");
197 return dynamic_cast< const vGenerator* > (pOther);
211 const TransSet* pNewTransRelPrototype) {
212 FD_DG( "vGenerator(" << this << ")::ConfigureAtributes(..)");
217 FD_DG( "vGenerator(" << this << ")::ConfigureAtributes(): done");
264 FD_DG( "vGenerator(" << this << ")::DoAssign(" << &rGen << ")");
266 if(&rGen== this) return;
284#ifdef FAUDES_DEBUG_CODE
286 FD_DG( "vGenerator()::Copy(): invalid generator");
291 FD_DG( "vGenerator(" << this << ")::DoAssign(" << &rGen << "): done");
296 FD_DG( "vGenerator(" << this << ")::Assign([type] " << &rSrc << ")");
298 if(&rSrc== this) return * this;
312 FD_DG( "vGenerator(" << this << ")::Assign(" << &rGen << ")");
329#ifdef FAUDES_DEBUG_CODE
331 FD_DG( "vGenerator()::Copy(): invalid generator");
342 FD_DG( "vGenerator(" << this << ")::Move(" << &rGen << ")");
349 if( typeid(*pt)!= typeid(*opt)) tmm= true;
352 if( typeid(*pt)!= typeid(*opt)) tmm= true;
355 if( typeid(*pt)!= typeid(*opt)) tmm= true;
358 if( typeid(*pt)!= typeid(*opt)) tmm= true;
361 FD_DG( "vGenerator(" << this << ")::Move(" << &rGen << "): using std copy");
402 FD_DG( "vGenerator(" << this << ")::operator = " << &rOtherGen);
403 FD_DG( "vGenerator(" << this << ")::operator = types " << typeid(*this).name() << " <= " << typeid(rOtherGen).name());
409 FD_DG( "vGenerator(" << this << ")::Version(" << version << ")");
410 std::ostringstream o;
417 FD_DG( "vGenerator(" << this << ")::Version(" << rVersion << ")");
420 std::stringstream errstr;
421 errstr << "Destination must not match source.";
422 throw Exception( "vGenerator::Version(string)", errstr.str(), 96);
427 EventSet::Iterator eit;
428 StateSet::Iterator lit;
429 TransSet::Iterator tit;
430 std::map<Idx,Idx> eventoldnewmap;
435 eventoldnewmap[*eit] = newevent;
461 FD_DG( "vGenerator(" << this << ")::Version(" << rPattern << ", " << rReplacement << ", ...)");
464 std::stringstream errstr;
465 errstr << "Destination must not match source.";
466 throw Exception( "vGenerator::Version(string,string)", errstr.str(), 96);
469 if(rPattern.empty()) {
474 if(rPattern==rReplacement) {
482 EventSet::Iterator eit;
483 StateSet::Iterator lit;
484 TransSet::Iterator tit;
485 std::map<Idx,Idx> eventoldnewmap;
487 std::string newstring;
488 std::string::size_type pos = 0;
489 int patternlength=rPattern.size();
490 int replacementlength=rReplacement.size();
495 while( (pos = newstring.find(rPattern, pos)) != std::string::npos ) {
496 newstring.replace(pos, patternlength, rReplacement);
498 pos=pos+replacementlength;
501 eventoldnewmap[*eit] = newevent;
507 while( (pos = newstring.find(rPattern, pos)) != std::string::npos ) {
508 newstring.replace(pos, patternlength, rReplacement);
509 pos=pos+replacementlength;
511 rResGen. Name(newstring);
535 FD_DG( "vGenerator(" << this << ")::Valid()");
542 TransSet::Iterator tit;
543 StateSet::Iterator lit;
560 NameSet::Iterator eit;
580 FD_DG( "vGenerator(" << this << ")::Clear()");
588 FD_DG( "vGenerator(" << this << ")::Clear(): done");
672 FD_DG( "vGenerator::ClearMinStateIndexMap()");
686 FD_DG( "vGenerator::SetMinStateIndexMap()");
691 StateSet::Iterator it;
729#ifdef FAUDES_DEBUG_CONTAINER
730 std::map<Idx,Idx>::const_iterator _it;
732 FD_DC( "vGenerator::MinStateIndexMap: " << _it->first
733 << " <-- " << SStr(_it->second));
741 std::map<Idx,Idx>::const_iterator minit;
744 return minit->second;
765 StateSet::Iterator sit;
783 TransSet::Iterator tit;
842 FD_DG( "vGenerator(" << this << ")::EventName("
843 << index << ",\"" << rName << "\")");
846 std::stringstream errstr;
847 errstr << "event \"" << index << "\" not found in generator \""
849 throw Exception( "vGenerator::EventName(name)", errstr.str(), 89);
857 std::string name=rName;
858 if(name== "") name= "ev";
866 FD_DG( "vGenerator(" << this << ")::EventRename(" << EStr(event) << ", " << rNewName << ")");
869 std::stringstream errstr;
870 errstr << "event \"" << event << "\" not found in generator \""
872 throw Exception( "vGenerator::EventReame(name)", errstr.str(), 89);
880 if(newidx==event) return true;
888 if(tit-> Ev!=event) {++tit; continue;}
895 for(tit=newtrans-> Begin(); tit!=newtrans-> End(); tit++) {
904 FD_DG( "vGenerator(" << this << ")::EventRename(" << EStr(event) << ", " << rNewName << "):OK");
952 FD_DG( "vGenerator(" << this << ")::StateName("
953 << index << ",\"" << rName << "\")");
956 std::stringstream errstr;
957 errstr << "state name \"" << rName << "\" not found in generator \""
959 throw Exception( "vGenerator::StateName(name)", errstr.str(), 90);
968 FD_DG( "vGenerator(" << this << ")::ClearStateNames()");
975 FD_DG( "Generator(" << this << ")::ClrStateName(\"" << index << "\")");
978 std::stringstream errstr;
979 errstr << "state \"" << index << "\" not found in generator \""
981 throw Exception( "vGenerator::ClrStateName(name)", errstr.str(), 90);
989 FD_DG( "vGenerator(" << this << ")::ClrStateName(\"" << rName << "\")");
1013 FD_DG( "vGenerator(" << this << ")::SetDefaultStateNames()");
1015 StateSet::Iterator it;
1025 FD_DG( "vGenerator(" << this << ")::EnforceStateNames(temp)");
1026 StateSet::Iterator it;
1037 std::string name=rName;
1038 if(name== "") name= "st";
1105 const std::string& rX1, const std::string& rEv, const std::string& rX2) const
1122 const std::string& rX1, const std::string& rEv, const std::string& rX2) const
1168 FD_DG( "vGenerator::InjectAlphabet() " << rNewAlphabet. ToString());
1169#ifdef FAUDES_CHECKED
1171 std::stringstream errstr;
1172 errstr << "symboltable mismatch aka not implemented" << std::endl;
1173 throw Exception( "vGenerator::InjectAlphabet", errstr.str(), 88);
1182 FD_DG( "vGenerator::RestrictAlphabet() " << rNewAlphabet. ToString());
1183#ifdef FAUDES_CHECKED
1185 std::stringstream errstr;
1186 errstr << "symboltable mismatch aka not implemented" << std::endl;
1187 throw Exception( "vGenerator::RestrictAlphabet", errstr.str(), 88);
1196 FD_DG( "vGenerator(" << this << ")::InsEvent(" << index << ")");
1202 FD_DG( "vGenerator(" << this << ")::InsEvent(\"" << rName << "\")");
1213 FD_DG( "vGenerator(" << this << ")::DelEvent(" << index << ")");
1220 FD_DG( "vGenerator(" << this << ")::DelEvent(\"" << rName << "\")");
1228 FD_DG( "vGenerator(" << this << ")::DelEvents(\""
1230 EventSet::Iterator it;
1231 for (it = rEvents. Begin(); it != rEvents. End(); ++it) {
1238 FD_DG( "vGenerator(" << this << ")::DelEventFromAlphabet("
1245 FD_DG( "vGenerator(" << this << ")::InsState()");
1251 FD_DG( "vGenerator(" << this << ")::InsState(" << index << ")");
1257 FD_DG( "vGenerator(" << this << ")::InsState(\"" << rName << "\")");
1270 FD_DG( "vGenerator(" << this << ")::InjectState(\"" << SStr(index) << "\")");
1276 FD_DG( "vGenerator(" << this << ")::InjectStates(" << rNewStates. ToString() << ")");
1285 FD_DG( "vGenerator(" << this << ")::InsInitState()");
1294 FD_DG( "vGenerator(" << this << ")::InsInitState(\"" << rName << "\")");
1316 FD_DG( "vGenerator(" << this << ")::InsMarkedState()");
1332 FD_DG( "vGenerator(" << this << ")::InsMarkedState(\"" << rName << "\")");
1348 FD_DG( "vGenerator(" << this << ")::DelState(" << index << ")");
1363 FD_DG( "vGenerator(" << this << ")::DelState(\"" << rName << "\")");
1366#ifdef FAUDES_CHECKED
1368 std::stringstream errstr;
1369 errstr << "state name \"" << rName << "\" not found in generator \""
1371 throw Exception( "vGenerator::DelState(name)", errstr.str(), 90);
1379 FD_DG( "vGenerator(" << this << ")::DelStates("
1381 StateSet::Iterator cit;
1382 StateSet::Iterator cit_end;
1384 for (cit = rDelStates. Begin(); cit != rDelStates. End(); ++cit) {
1397 FD_DG( "vGenerator(" << this << ")::DelStateFromStates(" << index << ")");
1404 FD_DG( "vGenerator(" << this << ")::DelState(" << *pos << ")");
1410 FD_DG( "vGenerator(" << this << ")::RestrictStates("
1413 StateSet::Iterator cit;
1414 StateSet::Iterator cit_end;
1430 FD_DG( "vGenerator(" << this << ")::SetInitState(" << index << ")");
1431#ifdef FAUDES_CHECKED
1433 std::stringstream errstr;
1434 errstr << "vGenerator::SetMarkedState: index " << index
1435 << " not in stateset";
1436 throw Exception( "vGenerator::SetInitState(..)", errstr.str(), 91);
1444 FD_DG( "vGenerator(" << this << ")::SetInitState(\"" << rName << "\")");
1446#ifdef FAUDES_CHECKED
1448 std::stringstream errstr;
1449 errstr << "State name \"" << rName << "\" not known in Generator";
1450 throw Exception( "vGenerator::SetInitState(..)", errstr.str(), 90);
1458 FD_DG( "vGenerator(" << this << ")::InjectInitStates("
1459 << rNewInitStates. ToString() << ")");
1466 FD_DG( "vGenerator(" << this << ")::ClrInitState(" << index << ")");
1467#ifdef FAUDES_CHECKED
1469 std::stringstream errstr;
1470 errstr << "vGenerator::SetMarkedState: index " << index
1471 << " not in stateset";
1472 throw Exception( "vGenerator::ClrInitState(..)", errstr.str(), 91);
1480 FD_DG( "vGenerator(" << this << ")::ClrInitState(\"" << rName << "\")");
1482#ifdef FAUDES_CHECKED
1484 std::stringstream errstr;
1485 errstr << "State name \"" << rName << "\" not known in Generator";
1486 throw Exception( "vGenerator::ClrInitState(..)", errstr.str(), 90);
1494 FD_DG( "vGenerator(" << this << ")::ClrInitState(" << *pos << ")");
1505 FD_DG( "vGenerator(" << this << ")::SetMarkedState(" << index << ")");
1506#ifdef FAUDES_CHECKED
1508 std::stringstream errstr;
1509 errstr << "vGenerator::SetMarkedState: index " << index
1510 << " not in stateset";
1511 throw Exception( "vGenerator::SetMarkedState(..)", errstr.str(), 91);
1519 FD_DG( "vGenerator(" << this << ")::SetMarkedState(\"" << rName << "\")");
1521#ifdef FAUDES_CHECKED
1523 std::stringstream errstr;
1524 errstr << "State name \"" << rName << "\" not known in Generator";
1525 throw Exception( "vGenerator::SetMarkedState(..)", errstr.str(), 90);
1533 FD_DG( "vGenerator(" << this << ")::InjectMarkedStates("
1534 << rNewMarkedStates. ToString() << ")");
1541 FD_DG( "vGenerator(" << this << ")::ClrMarkedState(" << index << ")");
1542#ifdef FAUDES_CHECKED
1544 std::stringstream errstr;
1545 errstr << "vGenerator::ClrMarkedState: index " << index
1546 << " not in stateset";
1547 throw Exception( "vGenerator::ClrMarkedState(..)", errstr.str(), 91);
1555 FD_DG( "vGenerator(" << this << ")::ClrMarkedState(\"" << rName << "\")");
1557#ifdef FAUDES_CHECKED
1559 std::stringstream errstr;
1560 errstr << "State name \"" << rName << "\" not known in Generator";
1561 throw Exception( "vGenerator::ClrMarkedState(..)", errstr.str(), 90);
1569 FD_DG( "vGenerator(" << this << ")::ClrMarkedState(" << *pos << ")");
1580 FD_DG( "vGenerator::InjectTransition(" << TStr(rTrans) << ")");
1586 FD_DG( "vGenerator::InjectTransRel(...)");
1593 FD_DG( "vGenerator(" << this << ")::SetTransition(\""
1594 << rX1 << "\", \"" << rEv << "\", \"" << rX2 << "\")");
1597#ifdef FAUDES_CHECKED
1599 FD_ERR( "vGenerator::SetTransition: state " << rX1
1600 << " not in stateset");
1601 std::stringstream errstr;
1602 errstr << "State name " << rX1 << " not found in Generator";
1603 throw Exception( "vGenerator::SetTransition(..)", errstr.str(), 90);
1606 FD_ERR( "vGenerator::SetTransition: event " << rEv << " not in alphabet");
1607 std::stringstream errstr;
1608 errstr << "Event name " << rEv << " not found in event domain of Generator";
1609 throw Exception( "vGenerator::SetTransition(..)", errstr.str(), 95);
1612 FD_ERR( "vGenerator::SetTransition: state " << rX2 << " not in stateset");
1613 std::stringstream errstr;
1614 errstr << "State name " << rX2 << " not found in Generator";
1615 throw Exception( "vGenerator::SetTransition(..)", errstr.str(), 90);
1629 FD_DG( "vGenerator(" << this << ")::SetTransition(" << rTransition. X1 << ","
1630 << rTransition. Ev << "," << rTransition. X2 << ")");
1631#ifdef FAUDES_CHECKED
1633 std::stringstream errstr;
1634 errstr << "vGenerator::SetTransition: state " << SStr(rTransition. X1)
1635 << " not in stateset";
1636 throw Exception( "vGenerator::SetTransition(..)", errstr.str(), 95);
1639 std::stringstream errstr;
1640 errstr << "vGenerator::SetTransition: event " << EStr(rTransition. Ev)
1641 << " not in alphabet ";
1642 throw Exception( "vGenerator::SetTransition(..)", errstr.str(), 95);
1645 std::stringstream errstr;
1646 errstr << "vGenerator::SetTransition: state " << SStr(rTransition. X2)
1647 << " not in stateset";
1648 throw Exception( "vGenerator::SetTransition(..)", errstr.str(), 95);
1658 FD_DG( "vGenerator(" << this << ")::ClrTransition("
1659 << x1 << "," << ev << "," << x2 << ")");
1665 FD_DG( "vGenerator(" << this << ")::ClrTransition(" << TStr(rTransition) << ")");
1671 FD_DG( "vGenerator(" << this << ")::ClrTransition(" << TStr(*it)<< ")" );
1677 FD_DG( "vGenerator(" << this << ")::ClrTransition("
1678 << x1 << "," << ev << ")");
1684 FD_DG( "vGenerator(" << this << ")::ClrTransition("
1691 FD_DG( "vGenerator(" << this << ")::TransAttribute("
1692 << TStr(rTrans) << ",\"" << rAttr. ToString() << "\")");
1720 FD_DG( "vGenerator(" << this << ")::EventAttribute("
1728 FD_DG( "vGenerator(" << this << ")::EventAttributes("
1735 FD_DG( "vGenerator(" << this << ")::ClrEventAttribute(\"" << EStr(index) << "\")");
1741 FD_DG( "vGenerator(" << this << ")::StateAttribute("
1748 FD_DG( "vGenerator(" << this << ")::ClrStateAttribute(\"" << index << "\")");
1844 FD_DG( "vGenerator(" << this << ")::GlobalAttribute("
1849 std::stringstream errstr;
1850 errstr << "cannot cast global attribute " << rAttr. ToString() << " for generator " << Name();
1851 throw Exception( "vGenerator::GlobalAttribute", errstr.str(), 63);
1856 FD_DG( "vGenerator(" << this << ")::GlobalAttributeTry("
1863 FD_DG( "vGenerator(" << this << ")::GlobalAttribute()");
1869 FD_DG( "vGenerator(" << this << ")::GlobalAttributep()");
1900 const std::string& rX1, const std::string& rEv, const std::string& rX2) const {
1922 TransSet::Iterator it;
1937 TransSet::Iterator it;
1947 TransSet::Iterator it;
1957 TransSet::Iterator it;
1980 if(it==it_end) return 0;
1982#ifdef FAUDES_CHECKED
1985 std::stringstream errstr;
1986 errstr << "successor state does not exist uniquely" << std::endl;
1987 throw Exception( "vGenerator::SuccessorState", errstr.str(), 92);
1997 std::stack<Idx> todo;
1998 StateSet::Iterator sit;
2003 TransSet::Iterator tit;
2004 TransSet::Iterator tit_end;
2006 while(!todo.empty()) {
2011 if(accessibleset. Exists(x1)) continue;
2013 accessibleset. Insert(x1);
2017 for(; tit != tit_end; ++tit)
2022 accessibleset. Name( "AccessibleSet");
2023 return accessibleset;
2033 FD_DF( "vGenerator::accessible: generator is accessible");
2036 FD_DF( "vGenerator::accessible: generator is accessible but empty");
2043 FD_DF( "vGenerator::accessible: generator is accessible");
2046 FD_DF( "vGenerator::accessible: generator is not accessible");
2056 StateSet::Iterator sit;
2057 std::stack<Idx> todo;
2065 while(!todo.empty()) {
2070 if(coaccessibleset. Exists(x2)) continue;
2072 coaccessibleset. Insert(x2);
2076 for(; tit != tit_end; ++tit)
2081 coaccessibleset. Name( "CoaccessibleSet");
2082 return coaccessibleset;
2092 FD_DF( "vGenerator::coaccessible: generator is coaccessible");
2095 FD_DF( "vGenerator::coaccessible: generator is not coaccessible");
2102 FD_DF( "vGenerator::coaccessible: generator is coaccessible");
2105 FD_DF( "vGenerator::coaccessible: generator is not coaccessible");
2111 FD_DF( "vGenerator::trimset: trim states: "
2114 res. Name( "TrimSet");
2125 if(accessiblebool && coaccessiblebool) {
2126 FD_DF( "vGenerator::Trim(): generator is nontrivial");
2129 FD_DF( "vGenerator::Trim(): generator is trivial");
2139 FD_DF( "vGenerator::IsTrim(): result " << res);
2146 FD_DF( "vGenerator::BlockingSet: blocking states: "
2158 StateSet::Iterator sit=rStates. Begin();
2159 StateSet::Iterator sit_end=rStates. End();
2160 for(;sit!=sit_end;sit++){
2163 if(tit==tit_end) break;
2166 return sit==sit_end;
2174 std::stack<Idx> todo;
2177 while(tit!=tit_end){
2178 if(!rSigmaO. Exists(tit-> Ev)) { ++tit; continue; }
2187 while(!todo.empty()) {
2192 if(good. Exists(x2)) continue;
2198 for(; tit != tit_end; ++tit)
2199 if(tit->X1 != x2) todo.push(tit->X1);
2201 FD_DG( "IsComplete(" << Name() << "): done");
2221 StateSet::Iterator sit_end = States(). End();
2223 for(; sit!=sit_end; ++sit) {
2224 if(termset. Exists(*sit)) continue;
2227 for (; tit != tit_end; ++tit) {
2228 if(!termset. Exists(tit-> X2)) break;
2259 while(tit!=tit_end) {
2260 if(!rSigmaO. Exists(tit-> Ev)) { ++tit; continue; }
2261 if(!domain. Exists(tit-> X2)) { ++tit; continue; }
2268 StateSet::Iterator sit;
2269 std::stack<Idx> todo;
2270 for(sit = target. Begin(); sit != target. End(); ++sit)
2272 while(!todo.empty()) {
2277 if(good. Exists(x2)) continue;
2283 for(; tit != tit_end; ++tit)
2284 if(tit->X1 != x2) todo.push(tit->X1);
2288 if(domain <= good) break;
2291 domain = domain * good;
2306 FD_DG( "Generator::TerminalStates(" << Name() << ")");
2312 StateSet::Iterator sit=rStates. Begin();
2313 StateSet::Iterator sit_end=rStates. End();
2314 for(;sit!=sit_end;sit++){
2317 if(tit==tit_end) res. Insert(*sit);
2320 res. Name( "TerminalStates");
2336 FD_DG( "vGenerator::IsDeterministic: more than one initial state");
2341 TransSet::Iterator it1;
2342 TransSet::Iterator it2;
2344 if ((it1-> X1 == it2-> X1) && (it1-> Ev == it2-> Ev)) {
2345 FD_DG( "IsDeterministic(): at least one state "
2346 << "contains more than on transition with same event: "
2390 std::string label=rLabel;
2392 if(label== "") label= "Generator";
2393 FD_DG( "vGenerator(" << this << ")::DoWrite(): section " << label);
2425 std::string label=rLabel;
2426 if(label== "") label= "Generator";
2427 FD_DG( "vGenerator(" << this << ")::DoDWrite(): section " << label);
2455 std::string label=rLabel;
2457 if(label== "") label= "Generator";
2462 FD_DG( "vGenerator(" << this << ")::DoXWrite(..): section " << btag. StringValue() << " #" << Size());
2534 std::map<Idx,Idx> reversemap;
2535 std::map<Idx,Idx>::const_iterator minit;
2536 StateSet::Iterator sit;
2540 for(minit = reversemap.begin(); minit != reversemap.end(); ++minit) {
2542 std::map<Idx,Idx>::const_iterator conit=minit;
2543 Idx start = conit->first;
2545 for(; conit != reversemap.end(); ++conit) {
2546 if( StateName(conit->second) != "") break;
2548 if(conit->first != start+anoncount) break;
2555 rTw << start+anoncount-1;
2560 if(minit == reversemap.end()) break;
2562 std::string statename = StateName(minit->second);
2563 if (statename != "") rTw << statename;
2564 else rTw << minit->first;
2575 StateSet::Iterator sit;
2578 StateSet::Iterator conit=sit;
2584 if(*conit != start+anoncount) break;
2591 rTw << start+anoncount-1;
2598 std::string statename = StateName(*sit);
2599 if((statename != "") && symexpl) {
2601 } else if(statename != "") {
2619 std::string label=rLabel;
2620 if(label.empty()) label=rStateSet. Name();
2629 std::map<Idx,Idx> reversemap;
2630 std::map<Idx,Idx>::const_iterator minit;
2631 StateSet::Iterator sit;
2632 for (sit = rStateSet. Begin(); sit != rStateSet. End(); ++sit)
2635 for(minit = reversemap.begin(); minit != reversemap.end(); ++minit) {
2637 std::map<Idx,Idx>::const_iterator conit=minit;
2638 Idx start = conit->first;
2640 for(; conit != reversemap.end(); ++conit) {
2641 if( StateName(conit->second) != "") break;
2643 if(conit->first != start+anoncount) break;
2650 rTw << start+anoncount-1;
2655 if(minit == reversemap.end()) break;
2657 std::string statename = StateName(minit->second);
2658 if (statename != "") rTw << statename;
2659 else rTw << minit->first;
2669 StateSet::Iterator sit;
2670 for(sit = rStateSet. Begin(); sit != rStateSet. End(); ++sit) {
2672 StateSet::Iterator conit=sit;
2675 for(; conit != rStateSet. End(); ++conit) {
2678 if(*conit != start+anoncount) break;
2685 rTw << start+anoncount-1;
2690 if(sit == rStateSet. End()) break;
2692 std::string statename = StateName(*sit);
2693 if (statename != "") rTw << statename;
2708 StateSet::Iterator sit;
2709 for(sit = rStateSet. Begin(); sit != rStateSet. End(); ++sit) {
2721 std::string label=rLabel;
2722 if(label== "") label=rStateSet. Name();
2723 if(label== "") label= "StateSet";
2728 std::map<Idx,Idx> reversemap;
2729 std::map<Idx,Idx>::const_iterator minit;
2730 StateSet::Iterator sit;
2731 for (sit = rStateSet. Begin(); sit != rStateSet. End(); ++sit) {
2735 for(minit = reversemap.begin(); minit != reversemap.end(); ++minit) {
2737 std::map<Idx,Idx>::const_iterator conit=minit;
2738 Idx start = conit->first;
2740 for(; conit != reversemap.end(); ++conit) {
2741 if( StateName(conit->second) != "") break;
2745 if(conit->first != start+anoncount) break;
2758 if(minit == reversemap.end() )
2762 std::string statename = StateName(minit->second);
2763 Idx index=minit->first;
2827 TransSet::Iterator tit;
2828 int oldcolumns = rTw. Columns();
2838 if (smalltransrel) {
2854 if (smalltransrel) {
2875 TransSet::Iterator tit;
2876 int oldcolumns = rTw. Columns();
2882 std::ostringstream ox1;
2886 ox1 << x1name << "#" << x1;
2892 std::ostringstream oev;
2895 oev << evname << "#" << ev;
2898 std::ostringstream ox2;
2902 ox2 << x2name << "#" << x2;
2917 TransSet::Iterator tit;
2950 rTw. WriteEnd( "TransitionRelation");
2971 FD_DG( "vGenerator(" << this << ")::DotWrite(" << rFileName << ")");
2975 StateSet::Iterator lit;
2981 if(!xname.empty()) circles= false;
2983 if(xname.length()>2) circles= false;
2989 std::ofstream stream;
2990 stream.exceptions(std::ios::badbit|std::ios::failbit);
2991 stream.open(rFileName.c_str());
2992 stream << "// dot output generated by libFAUDES vGenerator" << std::endl;
2993 stream << "digraph \"" << Name() << "\" {" << std::endl;
2994 stream << " rankdir=LR" << std::endl;
2996 stream << " node [shape=circle];" << std::endl;
2998 stream << " node [shape=rectangle, style=rounded];" << std::endl;
2999 stream << std::endl;
3001 stream << " // initial states" << std::endl;
3006 stream << " dot_dummyinit_" << i << " [shape=none, label=\"\", width=\"0.0\", height=\"0.0\" ];" << std::endl;
3007 stream << " dot_dummyinit_" << i << " -> \"" << xname << "\";" << std::endl;
3010 stream << std::endl;
3012 stream << " // mstates" << std::endl;
3017 stream << " \"" << xname << "\" [shape=doublecircle];" << std::endl;
3020 "<<TABLE BORDER=\"0\"><TR><TD>" +
3022 "</TD><TD WIDTH=\"2\"></TD><TD BGCOLOR=\"black\" BORDER=\"0\" WIDTH=\"8\"></TD></TR></TABLE>>";
3023 stream << " \"" << xname << "\" [ label=" << xlabel << "];" << std::endl;
3026 stream << std::endl;
3028 stream << " // rest of stateset" << std::endl;
3033 stream << " \"" << xname << "\";" << std::endl;
3036 stream << std::endl;
3038 stream << " // transition relation" << std::endl;
3040 for(tit = trx1x2ev. Begin(); tit != trx1x2ev. End();) {
3042 if(!elabel.empty()) elabel = elabel + ", ";
3043 if(elabel.length()>9) elabel = elabel + "\n";
3050 if(tit==trx1x2ev. End())
3053 flush=((tit->X1 != x1) || (tit->X2 != x2));
3060 stream << " \"" << x1name << "\" -> \"" << x2name
3061 << "\" [label=\"" << elabel << "\"];" << std::endl;
3065 stream << "}" << std::endl;
3068 catch (std::ios::failure&) {
3070 "Exception opening/writing dotfile \""+rFileName+ "\"", 2);
3077 FD_DG( "vGenerator(" << this << ")::DDotWrite(" << rFileName << ")");
3078 StateSet::Iterator lit;
3079 TransSet::Iterator tit;
3081 std::ofstream stream;
3082 stream.exceptions(std::ios::badbit|std::ios::failbit);
3083 stream.open(rFileName.c_str());
3084 stream << "digraph \"" << Name() << "\" {" << std::endl;
3085 stream << " rankdir=LR" << std::endl;
3086 stream << " node [shape=circle];" << std::endl;
3087 stream << std::endl;
3088 stream << " // istates" << std::endl;
3091 stream << " dot_dummyinit_" << i << " [shape=none, label=\"\" ];" << std::endl;
3092 stream << " dot_dummyinit_" << i << " -> \""
3093 << SStr(*lit) << "\";" << std::endl;
3096 stream << std::endl;
3097 stream << " // mstates" << std::endl;
3099 stream << " \"" << SStr(*lit) << "\" [shape=doublecircle];" << std::endl;
3101 stream << std::endl;
3102 stream << " // rest of stateset" << std::endl;
3106 stream << " \"" << SStr(*lit) << "\";" << std::endl;
3109 stream << std::endl;
3110 stream << " // transition relation" << std::endl;
3112 stream << " \"" << SStr(tit-> X1)
3113 << "\" -> \"" << SStr(tit-> X2)
3114 << "\" [label=\"" << EventName(tit-> Ev) << "\"];" << std::endl;
3116 stream << "}" << std::endl;
3119 catch (std::ios::failure&) {
3120 throw Exception( "vGenerator::DDotWrite",
3121 "Exception opening/writing dotfile \""+rFileName+ "\"", 2);
3128 FD_DG( "vGenerator(" << this << ")::XDotWrite(" << rFileName << ")");
3129 StateSet::Iterator lit;
3130 TransSet::Iterator tit;
3132 std::ofstream stream;
3133 stream.exceptions(std::ios::badbit|std::ios::failbit);
3134 stream.open(rFileName.c_str());
3135 stream << "digraph \"___" << Name() << "___\" {" << std::endl;
3136 stream << " rankdir=LR" << std::endl;
3137 stream << " node [shape=circle];" << std::endl;
3138 stream << std::endl;
3139 stream << " // stateset" << std::endl;
3141 stream << " \"s" << *lit << "\";" << std::endl;
3144 stream << " \"s" << *lit << "\";" << std::endl;
3149 stream << " \"s" << *lit << "\";" << std::endl;
3151 stream << std::endl;
3152 stream << " // transition relation" << std::endl;
3154 stream << " \"s" << tit-> X1
3155 << "\" -> \"s" << tit-> X2
3156 << "\" [label=\"e" << tit-> Ev << "\" " << "polyline" << "];" << std::endl;
3158 stream << "}" << std::endl;
3161 catch (std::ios::failure&) {
3162 throw Exception( "vGenerator::XDotWrite",
3163 "Exception opening/writing dotfile \""+rFileName+ "\"", 2);
3170 std::string label=rLabel;
3171 if(label== "") label= "Generator";
3172 FD_DG( "vGenerator(" << this << ")::DoRead(): file " << rTr. FileName() << " section " << label);
3178 int seclev=rTr. Level();
3187 FD_DG( "vGenerator(" << this << ")::DoRead(): relaxed native header")
3188 std::string name= "Generator";
3200 FD_DG( "vGenerator(" << this << ")::DoRead(): relaxed native core")
3208 FD_DG( "vGenerator(" << this << ")::DoRead(): " << token. Str());
3219 FD_DG( "vGenerator(" << this << ")::DoRead(): native extra items")
3223 if(token. IsBegin( "InitStates"))
3230 if(token. IsBegin( "MarkedStates"))
3239 if(native) xml= false;
3242 FD_DG( "vGenerator(" << this << ")::DoRead(): xml")
3244 std::string name= "generator";
3263 FD_DG( "vGenerator(" << this << ")::DoRead(): done");
3268 FD_DG( "vGenerator(" << this << ")::ReadAlphabet(\""
3281 FD_DG( "vGenerator(" << this << ")::ReadStates(\"" << rTr. FileName() << "\")");
3284 std::string label= "";
3288 if(label== "") return;
3290 FD_DG( "vGenerator(" << this << ")::ReadStates(..): attribute type " << typeid(*attrp).name());
3301 while(!rTr. Eos(label)) {
3308 FD_DG( "vGenerator(" << this << ")::ReadStates(\"" << rTr. FileName() << "\"): by index " << index);
3311 std::stringstream errstr;
3312 errstr << "Token " << token. IntegerValue() << " appears twice in stateset"
3314 throw Exception( "vGenerator::ReadStates", errstr.str(), 80);
3317 attrp-> Read(rTr, "", this);
3333 std::size_t pos= statename.find_first_of( '#');
3334 if(pos==std::string::npos) symimpl= true;
3335 if(pos!=std::string::npos) symexpl= true;
3336 if(pos!=std::string::npos && pos < statename.size()-1) {
3337 std::string suffix=statename.substr(pos+1);
3338 index= ToIdx(suffix);
3339 statename=statename.substr(0,pos);
3340 FD_DG( "vGenerator(" << this << ")::ReadStates(\"" << rTr. FileName() << "\"): extracted suffix from " << token. StringValue() << ": " << statename << " idx " << index);
3345 std::stringstream errstr;
3346 errstr << "State " << statename << "(idx " << index << ") appears twice in stateset"
3348 throw Exception( "vGenerator::ReadStates", errstr.str(), 80);
3351 attrp-> Read(rTr, "", this);
3362 if(token. IsBegin( "Consecutive")) {
3364 Token token1,token2;
3367 FD_DG( "vGenerator(" << this << ")::ReadStates(\"" << rTr. FileName() << "\"): consecutive range");
3370 std::stringstream errstr;
3371 errstr << "Invalid range of consecutive states" << rTr. FileLine();
3372 throw Exception( "vGenerator::ReadStates", errstr.str(), 80);
3377 std::stringstream errstr;
3378 errstr << "Index " << index << " appears twice in stateset"
3380 throw Exception( "vGenerator::ReadStates", errstr.str(), 80);
3390 std::stringstream errstr;
3391 errstr << "Invalid token" << rTr. FileLine();
3392 throw Exception( "vGenerator::ReadStates", errstr.str(), 80);
3396 if(symimpl && symexpl) {
3398 std::stringstream errstr;
3399 errstr << "StateSet with inconsitent explicit symboltable" << rTr. FileLine();
3400 throw Exception( "vGenerator::ReadStates", errstr.str(), 80);
3404 FD_DG( "vGenerator(" << this << ")::ReadStates(\"" << rTr. FileName() << "\"): done");
3410 FD_DG( "vGenerator(" << this << ")::ReadStateSet(\"" << rLabel<< "\")");
3414 FD_DG( "vGenerator(" << this << ")::ReadStateSet(..): attribute type " << typeid(*attrp).name());
3418 rStateSet. Name(rLabel);
3420 while(!rTr. Eos(rLabel)) {
3430 std::stringstream errstr;
3431 errstr << "Token " << token. IntegerValue() << " not in generator stateset"
3433 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3436 attrp-> Read(rTr, "", this);
3450 std::size_t pos= statename.find_first_of( '#');
3451 if(pos!=std::string::npos) {
3453 std::stringstream errstr;
3454 errstr << "invalid symbolic name: " << token. StringValue()
3455 << " (no suffix allowed in external state sets)" << rTr. FileLine();
3456 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3461 std::stringstream errstr;
3462 errstr << "Symbolic name " << token. StringValue() << " not in stateset"
3464 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3467 attrp-> Read(rTr, "", this);
3479 std::string name= "";
3485 FD_DG( "vGenerator::ReadStateSet(): got idx " << index << " " << name);
3493 std::stringstream errstr;
3494 errstr << "Cannot figure index for state token " << token. Str() << rTr. FileLine();
3495 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3498 if(rStateSet. Exists(index)) {
3500 std::stringstream errstr;
3501 errstr << "Doublet state from token " << token. Str() << rTr. FileLine();
3502 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3512 if(!rTr. Eos( "State")) {
3513 FD_DG( "vGenerator(" << this << ")::ReadStates(\"" << rTr. FileName() << "\"): attribute ?");
3514 attrp-> Read(rTr, "", this);
3528 Token token1,token2;
3543 std::stringstream errstr;
3544 errstr << "Invalid range of consecutive states" << rTr. FileLine();
3545 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3551 if(idx1==0 || idx2 < idx1) {
3553 std::stringstream errstr;
3554 errstr << "Invalid range of consecutive states" << rTr. FileLine();
3555 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3558 FD_DG( "vGenerator(" << this << ")::ReadStateSet(\"" << rTr. FileName() << "\"): consecutive range " << idx1 << " to " << idx2);
3559 for( Idx index = idx1; index <= idx2; ++index) {
3562 std::stringstream errstr;
3563 errstr << "range not in generator stateset" << rTr. FileLine();
3564 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 80);
3580 std::stringstream errstr;
3581 errstr << "Section " << rLabel << ": Invalid token" << rTr. FileLine() << ": " << token. Str();
3582 throw Exception( "vGenerator::ReadStateSet", errstr.str(), 50);
3591 FD_DG( "vGenerator(" << this << ")::XReadStateSet(\"" << rLabel<< "\")");
3593 FD_DG( "vGenerator(" << this << ")::ReadStateSet(..): attribute type " << typeid(*attrp).name());
3597 std::string label=rLabel;
3598 if(label== "") label=rStateSet. Name();
3599 if(label== "") label= "StateSet";
3608 while(!rTr. Eos(label)) {
3612 if(sttag. IsBegin( "Consecutive")) {
3621 if(idx1==0 || idx2 < idx1) {
3623 std::stringstream errstr;
3624 errstr << "Invalid range of consecutive states" << rTr. FileLine();
3625 throw Exception( "vGenerator::XReadStates", errstr.str(), 80);
3627 FD_DG( "vGenerator(" << this << ")::XReadStates(\"" << rTr. FileName() << "\"): consecutive range " << idx1 << " to " << idx2);
3628 for( Idx index = idx1; index <= idx2; ++index) {
3629 if(rStateSet. Exists(index)) {
3631 std::stringstream errstr;
3632 errstr << "Doublet state index " << index << " " << rTr. FileLine();
3633 throw Exception( "vGenerator::XReadStates", errstr.str(), 80);
3648 std::string name= "";
3654 FD_DG( "vGenerator::XReadStateSet(): got idx " << index << " " << name);
3662 std::stringstream errstr;
3663 errstr << "Cannot figure index for state token " << sttag. Str() << rTr. FileLine();
3664 throw Exception( "vGenerator::XReadStateSet", errstr.str(), 80);
3667 if(rStateSet. Exists(index)) {
3669 std::stringstream errstr;
3670 errstr << "Doublet state from token " << sttag. Str() << rTr. FileLine();
3671 throw Exception( "vGenerator::XReadStateSet", errstr.str(), 80);
3681 while(!rTr. Eos( "State")) {
3705 FD_DG( "vGenerator(" << this << ")::XReadStates(\"" << rTr. FileName() << "\"): attribute ?");
3706 attrp-> Read(rTr, "", this);
3717 FD_DG( "vGenerator(" << this << ")::XReadStates(\"" << rTr. FileName() << "\"): done");
3724 FD_DG( "vGenerator(" << this << ")::ReadTransRel(\"" << rTr. FileName() << "\")");
3726 FD_DG( "vGenerator(" << this << ")::ReadTransRel(..): attribute type " << typeid(*attrp).name());
3729 std::string label= "";
3732 if(token. IsBegin( "TransRel")) label= "TransRel";
3733 if(token. IsBegin( "T")) label= "T";
3735 std::stringstream errstr;
3736 errstr << "Reading TransRel failed in " << rTr. FileLine() << ": no valid begin token";
3737 throw Exception( "vGenerator::ReadTransRel", errstr.str(), 50);
3748 while(!rTr. Eos(label)) {
3756 Idx x1 = 0, ev = 0, x2 = 0;
3787 attrp-> Read(rTr, "", this);
3794 std::stringstream errstr;
3796 throw Exception( "vGenerator::ReadTransRel", errstr.str(), 85);
3799 std::stringstream errstr;
3801 throw Exception( "vGenerator::ReadTransRel", errstr.str(), 85);
3804 std::stringstream errstr;
3806 throw Exception( "vGenerator::ReadTransRel", errstr.str(), 85);
3819 std::stringstream errstr;
3820 errstr << "Reading TransRel failed in " << rTr. FileLine() << " " << oex. What();
3821 throw Exception( "vGenerator::ReadTransRel", errstr.str(), 50);
3828 FD_DG( "vGenerator(" << this << ")::ReadTransRel(\"" << rTr. FileName() << "\"): done");
3837 FD_DG( "vGenerator(" << this << ")::XReadTransRel()");
3839 FD_DG( "vGenerator(" << this << ")::ReadTransRel(..): attribute type " << typeid(*attrp).name());
3845 rTr. ReadBegin( "TransitionRelation",btag);
3847 while(!rTr. Eos( "TransitionRelation")) {
3851 if(!trtag. IsBegin( "Transition")) {
3880 if(x1==0 || x2==0 || ev==0) {
3882 std::stringstream errstr;
3883 errstr << "Invalid transition at token " << trtag. Str() << rTr. FileLine();
3884 throw Exception( "vGenerator::XReadTransRel", errstr.str(), 80);
3889 std::stringstream errstr;
3890 errstr << "Doublet transition at token " << trtag. Str() << rTr. FileLine();
3891 throw Exception( "vGenerator::XReadTransRel", errstr.str(), 80);
3896 std::stringstream errstr;
3897 errstr << "Invalid state x1 " << x1 << " " << rTr. FileLine();
3898 throw Exception( "vGenerator::XReadTransRel", errstr.str(), 80);
3902 std::stringstream errstr;
3903 errstr << "Invalid state x2 " << x2 << " " << rTr. FileLine();
3904 throw Exception( "vGenerator::XReadTransRel", errstr.str(), 80);
3908 std::stringstream errstr;
3909 errstr << "Invalid event " << evname << " " << rTr. FileLine();
3910 throw Exception( "vGenerator::XReadTransRel", errstr.str(), 80);
3917 if(!token. IsEnd( "Transition")) {
3919 attrp-> Read(rTr, "", this);
3925 rTr. ReadEnd( "TransitionRelation");
3928 FD_DG( "vGenerator(" << this << ")::XReadTransRel(\"" << rTr. FileName() << "\"): done");
3952 const std::string& rDotExec) const {
3953 FD_DG( "vGenerator::GraphWrite(...): " << typeid(*this).name());
3957 std::stringstream errstr;
3958 errstr << "Exception opening temp file";
3959 throw Exception( "vGenerator::GraphWrite", errstr.str(), 2);
3966 std::stringstream errstr;
3967 errstr << "Exception writing dot input file";
3968 throw Exception( "vGenerator::GraphWrite", errstr.str(), 2);
3975 std::stringstream errstr;
3976 errstr << "Exception processing dot file";
3977 throw Exception( "vGenerator::GraphWrite", errstr.str(), 3);
4094 if(rGenVec. Size()==0) return;
4108 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
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)
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 void XWrite(const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
virtual Type & Assign(const Type &rSrc)
virtual Type * New(void) const
virtual void DoSWrite(TokenWriter &rTw) const
virtual Type * Copy(void) 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)
virtual void Move(vGenerator &rGen)
const AttributeVoid * pGlobalPrototype
std::string MarkedStatesToString(void) const
virtual vGenerator & Assign(const Type &rSrc)
virtual vGenerator * Copy(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
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)
virtual vGenerator & AssignWithoutAttributes(const vGenerator &rGen)
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
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
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 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
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
void DoAssign(const vGenerator &rSrc)
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 & AssignWithoutAttributes(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)
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.33k
--- 2025.09.16
--- c++ api documentaion by doxygen
|