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;
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;
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()");
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;
842 FD_DG(
"vGenerator(" <<
this <<
")::EventName("
843 << index <<
",\"" << rName <<
"\")");
844 #ifdef FAUDES_CHECKED
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 <<
")");
867 #ifdef FAUDES_CHECKED
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 <<
"\")");
954 #ifdef FAUDES_CHECKED
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 <<
"\")");
976 #ifdef FAUDES_CHECKED
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 {
1924 resultset.
Insert(it->Ev);
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;
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");
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;
2391 if(label==
"") label=
"Generator";
2392 FD_DG(
"vGenerator(" <<
this <<
")::DoWrite(): section " << label);
2422 std::string label=rLabel;
2423 if(label==
"") label=
"Generator";
2424 FD_DG(
"vGenerator(" <<
this <<
")::DoDWrite(): section " << label);
2452 std::string label=rLabel;
2454 if(label==
"") label=
"Generator";
2461 FD_DG(
"vGenerator(" <<
this <<
")::DoXWrite(..): section " << btag.
StringValue() <<
" #" <<
Size());
2533 std::map<Idx,Idx> reversemap;
2534 std::map<Idx,Idx>::const_iterator minit;
2535 StateSet::Iterator sit;
2539 for(minit = reversemap.begin(); minit != reversemap.end(); ++minit) {
2541 std::map<Idx,Idx>::const_iterator conit=minit;
2542 Idx start = conit->first;
2544 for(; conit != reversemap.end(); ++conit) {
2545 if(
StateName(conit->second) !=
"")
break;
2547 if(conit->first != start+anoncount)
break;
2554 rTw << start+anoncount-1;
2559 if(minit == reversemap.end())
break;
2561 std::string statename =
StateName(minit->second);
2562 if (statename !=
"") rTw << statename;
2563 else rTw << minit->first;
2574 StateSet::Iterator sit;
2577 StateSet::Iterator conit=sit;
2583 if(*conit != start+anoncount)
break;
2590 rTw << start+anoncount-1;
2597 std::string statename =
StateName(*sit);
2598 if((statename !=
"") && symexpl) {
2600 }
else if(statename !=
"") {
2618 std::string label=rLabel;
2619 if(label.empty()) label=rStateSet.
Name();
2628 std::map<Idx,Idx> reversemap;
2629 std::map<Idx,Idx>::const_iterator minit;
2630 StateSet::Iterator sit;
2631 for (sit = rStateSet.
Begin(); sit != rStateSet.
End(); ++sit)
2634 for(minit = reversemap.begin(); minit != reversemap.end(); ++minit) {
2636 std::map<Idx,Idx>::const_iterator conit=minit;
2637 Idx start = conit->first;
2639 for(; conit != reversemap.end(); ++conit) {
2640 if(
StateName(conit->second) !=
"")
break;
2642 if(conit->first != start+anoncount)
break;
2649 rTw << start+anoncount-1;
2654 if(minit == reversemap.end())
break;
2656 std::string statename =
StateName(minit->second);
2657 if (statename !=
"") rTw << statename;
2658 else rTw << minit->first;
2668 StateSet::Iterator sit;
2669 for(sit = rStateSet.
Begin(); sit != rStateSet.
End(); ++sit) {
2671 StateSet::Iterator conit=sit;
2674 for(; conit != rStateSet.
End(); ++conit) {
2677 if(*conit != start+anoncount)
break;
2684 rTw << start+anoncount-1;
2689 if(sit == rStateSet.
End())
break;
2691 std::string statename =
StateName(*sit);
2692 if (statename !=
"") rTw << statename;
2707 StateSet::Iterator sit;
2708 for(sit = rStateSet.
Begin(); sit != rStateSet.
End(); ++sit) {
2720 std::string label=rLabel;
2721 if(label==
"") label=rStateSet.
Name();
2722 if(label==
"") label=
"StateSet";
2727 std::map<Idx,Idx> reversemap;
2728 std::map<Idx,Idx>::const_iterator minit;
2729 StateSet::Iterator sit;
2730 for (sit = rStateSet.
Begin(); sit != rStateSet.
End(); ++sit) {
2734 for(minit = reversemap.begin(); minit != reversemap.end(); ++minit) {
2736 std::map<Idx,Idx>::const_iterator conit=minit;
2737 Idx start = conit->first;
2739 for(; conit != reversemap.end(); ++conit) {
2740 if(
StateName(conit->second) !=
"")
break;
2744 if(conit->first != start+anoncount)
break;
2757 if(minit == reversemap.end() )
2761 std::string statename =
StateName(minit->second);
2762 Idx index=minit->first;
2827 int oldcolumns = rTw.
Columns();
2837 if (smalltransrel) {
2838 std::string x1name =
StateName(tit->X1);
2853 if (smalltransrel) {
2854 std::string x2name =
StateName(tit->X2);
2875 int oldcolumns = rTw.
Columns();
2881 std::ostringstream ox1;
2885 ox1 << x1name <<
"[" << x1 <<
"]";
2891 std::ostringstream oev;
2894 oev << evname <<
"[" << ev <<
"]";
2897 std::ostringstream ox2;
2901 ox2 << x2name <<
"[" << x2 <<
"]";
2949 rTw.
WriteEnd(
"TransitionRelation");
2970 FD_DG(
"vGenerator(" <<
this <<
")::DotWrite(" << rFileName <<
")");
2973 StateSet::Iterator lit;
2976 std::ofstream stream;
2977 stream.exceptions(std::ios::badbit|std::ios::failbit);
2978 stream.open(rFileName.c_str());
2979 stream <<
"// dot output generated by libFAUDES vGenerator" << std::endl;
2980 stream <<
"digraph \"" <<
Name() <<
"\" {" << std::endl;
2981 stream <<
" rankdir=LR" << std::endl;
2982 stream <<
" node [shape=circle];" << std::endl;
2983 stream << std::endl;
2984 stream <<
" // initial states" << std::endl;
2989 stream <<
" dot_dummyinit_" << i <<
" [shape=none, label=\"\", width=\"0.0\", height=\"0.0\" ];" << std::endl;
2990 stream <<
" dot_dummyinit_" << i <<
" -> \"" << xname <<
"\";" << std::endl;
2993 stream << std::endl;
2994 stream <<
" // mstates" << std::endl;
2998 stream <<
" \"" << xname <<
"\" [shape=doublecircle];" << std::endl;
3000 stream << std::endl;
3001 stream <<
" // rest of stateset" << std::endl;
3006 stream <<
" \"" << xname <<
"\";" << std::endl;
3009 stream << std::endl;
3010 stream <<
" // transition relation" << std::endl;
3016 stream <<
" \"" << x1name <<
"\" -> \"" << x2name
3017 <<
"\" [label=\"" <<
EventName(tit->Ev) <<
"\"];" << std::endl;
3019 stream <<
"}" << std::endl;
3022 catch (std::ios::failure&) {
3024 "Exception opening/writing dotfile \""+rFileName+
"\"", 2);
3031 FD_DG(
"vGenerator(" <<
this <<
")::DDotWrite(" << rFileName <<
")");
3032 StateSet::Iterator lit;
3035 std::ofstream stream;
3036 stream.exceptions(std::ios::badbit|std::ios::failbit);
3037 stream.open(rFileName.c_str());
3038 stream <<
"digraph \"" <<
Name() <<
"\" {" << std::endl;
3039 stream <<
" rankdir=LR" << std::endl;
3040 stream <<
" node [shape=circle];" << std::endl;
3041 stream << std::endl;
3042 stream <<
" // istates" << std::endl;
3045 stream <<
" dot_dummyinit_" << i <<
" [shape=none, label=\"\" ];" << std::endl;
3046 stream <<
" dot_dummyinit_" << i <<
" -> \""
3047 <<
SStr(*lit) <<
"\";" << std::endl;
3050 stream << std::endl;
3051 stream <<
" // mstates" << std::endl;
3053 stream <<
" \"" <<
SStr(*lit) <<
"\" [shape=doublecircle];" << std::endl;
3055 stream << std::endl;
3056 stream <<
" // rest of stateset" << std::endl;
3060 stream <<
" \"" <<
SStr(*lit) <<
"\";" << std::endl;
3063 stream << std::endl;
3064 stream <<
" // transition relation" << std::endl;
3066 stream <<
" \"" <<
SStr(tit->X1)
3067 <<
"\" -> \"" <<
SStr(tit->X2)
3068 <<
"\" [label=\"" <<
EventName(tit->Ev) <<
"\"];" << std::endl;
3070 stream <<
"}" << std::endl;
3073 catch (std::ios::failure&) {
3074 throw Exception(
"vGenerator::DDotWrite",
3075 "Exception opening/writing dotfile \""+rFileName+
"\"", 2);
3082 FD_DG(
"vGenerator(" <<
this <<
")::XDotWrite(" << rFileName <<
")");
3083 StateSet::Iterator lit;
3086 std::ofstream stream;
3087 stream.exceptions(std::ios::badbit|std::ios::failbit);
3088 stream.open(rFileName.c_str());
3089 stream <<
"digraph \"___" <<
Name() <<
"___\" {" << std::endl;
3090 stream <<
" rankdir=LR" << std::endl;
3091 stream <<
" node [shape=circle];" << std::endl;
3092 stream << std::endl;
3093 stream <<
" // stateset" << std::endl;
3095 stream <<
" \"s" << *lit <<
"\";" << std::endl;
3098 stream <<
" \"s" << *lit <<
"\";" << std::endl;
3103 stream <<
" \"s" << *lit <<
"\";" << std::endl;
3105 stream << std::endl;
3106 stream <<
" // transition relation" << std::endl;
3108 stream <<
" \"s" << tit->X1
3109 <<
"\" -> \"s" << tit->X2
3110 <<
"\" [label=\"e" << tit->Ev <<
"\" " <<
"polyline" <<
"];" << std::endl;
3112 stream <<
"}" << std::endl;
3115 catch (std::ios::failure&) {
3116 throw Exception(
"vGenerator::XDotWrite",
3117 "Exception opening/writing dotfile \""+rFileName+
"\"", 2);
3124 std::string label=rLabel;
3125 if(label==
"") label=
"Generator";
3126 FD_DG(
"vGenerator(" <<
this <<
")::DoRead(): file " << rTr.
FileName() <<
" section " << label);
3132 int seclev=rTr.
Level();
3140 FD_DG(
"vGenerator(" <<
this <<
")::DoRead(): relaxed native header")
3141 std::string name=
"Generator";
3153 FD_DG(
"vGenerator(" <<
this <<
")::DoRead(): relaxed native core")
3161 FD_DG(
"vGenerator(" <<
this <<
")::DoRead(): " << token.
Str());
3172 FD_DG(
"vGenerator(" <<
this <<
")::DoRead(): native extra items")
3176 if(token.
IsBegin(
"InitStates"))
3183 if(token.
IsBegin(
"MarkedStates"))
3192 if(native) xml=
false;
3195 FD_DG(
"vGenerator(" <<
this <<
")::DoRead(): xml")
3197 std::string name=
"generator";
3216 FD_DG(
"vGenerator(" <<
this <<
")::DoRead(): done");
3221 FD_DG(
"vGenerator(" <<
this <<
")::ReadAlphabet(\""
3234 FD_DG(
"vGenerator(" <<
this <<
")::ReadStates(\"" << rTr.
FileName() <<
"\")");
3237 std::string label=
"";
3241 if(label==
"")
return;
3243 FD_DG(
"vGenerator(" <<
this <<
")::ReadStates(..): attribute type " <<
typeid(*attrp).name());
3254 while(!rTr.
Eos(label)) {
3261 FD_DG(
"vGenerator(" <<
this <<
")::ReadStates(\"" << rTr.
FileName() <<
"\"): by index " << index);
3264 std::stringstream errstr;
3265 errstr <<
"Token " << token.
IntegerValue() <<
" appears twice in stateset"
3267 throw Exception(
"vGenerator::ReadStates", errstr.str(), 80);
3270 attrp->
Read(rTr,
"",
this);
3286 std::size_t pos= statename.find_first_of(
'#');
3287 if(pos==std::string::npos) symimpl=
true;
3288 if(pos!=std::string::npos) symexpl=
true;
3289 if(pos!=std::string::npos && pos < statename.size()-1) {
3290 std::string suffix=statename.substr(pos+1);
3291 index=
ToIdx(suffix);
3292 statename=statename.substr(0,pos);
3293 FD_DG(
"vGenerator(" <<
this <<
")::ReadStates(\"" << rTr.
FileName() <<
"\"): extracted suffix from " << token.
StringValue() <<
": " << statename <<
" idx " << index);
3298 std::stringstream errstr;
3299 errstr <<
"State " << statename <<
"(idx " << index <<
") appears twice in stateset"
3301 throw Exception(
"vGenerator::ReadStates", errstr.str(), 80);
3304 attrp->
Read(rTr,
"",
this);
3315 if(token.
IsBegin(
"Consecutive")) {
3317 Token token1,token2;
3320 FD_DG(
"vGenerator(" <<
this <<
")::ReadStates(\"" << rTr.
FileName() <<
"\"): consecutive range");
3323 std::stringstream errstr;
3324 errstr <<
"Invalid range of consecutive states" << rTr.
FileLine();
3325 throw Exception(
"vGenerator::ReadStates", errstr.str(), 80);
3330 std::stringstream errstr;
3331 errstr <<
"Index " << index <<
" appears twice in stateset"
3333 throw Exception(
"vGenerator::ReadStates", errstr.str(), 80);
3343 std::stringstream errstr;
3344 errstr <<
"Invalid token" << rTr.
FileLine();
3345 throw Exception(
"vGenerator::ReadStates", errstr.str(), 80);
3349 if(symimpl && symexpl) {
3351 std::stringstream errstr;
3352 errstr <<
"StateSet with inconsitent explicit symboltable" << rTr.
FileLine();
3353 throw Exception(
"vGenerator::ReadStates", errstr.str(), 80);
3357 FD_DG(
"vGenerator(" <<
this <<
")::ReadStates(\"" << rTr.
FileName() <<
"\"): done");
3363 FD_DG(
"vGenerator(" <<
this <<
")::ReadStateSet(\"" << rLabel<<
"\")");
3367 FD_DG(
"vGenerator(" <<
this <<
")::ReadStateSet(..): attribute type " <<
typeid(*attrp).name());
3371 rStateSet.
Name(rLabel);
3373 while(!rTr.
Eos(rLabel)) {
3383 std::stringstream errstr;
3384 errstr <<
"Token " << token.
IntegerValue() <<
" not in generator stateset"
3386 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 80);
3389 attrp->
Read(rTr,
"",
this);
3403 std::size_t pos= statename.find_first_of(
'#');
3404 if(pos!=std::string::npos) {
3406 std::stringstream errstr;
3407 errstr <<
"invalid symbolic name: " << token.
StringValue()
3408 <<
" (no suffix allowed in external state sets)" << rTr.
FileLine();
3409 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 80);
3414 std::stringstream errstr;
3415 errstr <<
"Symbolic name " << token.
StringValue() <<
" not in stateset"
3417 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 80);
3420 attrp->
Read(rTr,
"",
this);
3432 std::string name=
"";
3438 FD_DG(
"vGenerator::ReadStateSet(): got idx " << index <<
" " << name);
3446 std::stringstream errstr;
3447 errstr <<
"Cannot figure index for state token " << token.
Str() << rTr.
FileLine();
3448 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 80);
3451 if(rStateSet.
Exists(index)) {
3453 std::stringstream errstr;
3454 errstr <<
"Doublet state from token " << token.
Str() << rTr.
FileLine();
3455 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 80);
3465 if(!rTr.
Eos(
"State")) {
3466 FD_DG(
"vGenerator(" <<
this <<
")::ReadStates(\"" << rTr.
FileName() <<
"\"): attribute ?");
3467 attrp->
Read(rTr,
"",
this);
3481 Token token1,token2;
3496 std::stringstream errstr;
3497 errstr <<
"Invalid range of consecutive states" << rTr.
FileLine();
3498 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 80);
3504 if(idx1==0 || idx2 < idx1) {
3506 std::stringstream errstr;
3507 errstr <<
"Invalid range of consecutive states" << rTr.
FileLine();
3508 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 80);
3511 FD_DG(
"vGenerator(" <<
this <<
")::ReadStateSet(\"" << rTr.
FileName() <<
"\"): consecutive range " << idx1 <<
" to " << idx2);
3512 for(
Idx index = idx1; index <= idx2; ++index) {
3515 std::stringstream errstr;
3516 errstr <<
"range not in generator stateset" << rTr.
FileLine();
3517 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 80);
3533 std::stringstream errstr;
3534 errstr <<
"Section " << rLabel <<
": Invalid token" << rTr.
FileLine() <<
": " << token.
Str();
3535 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 50);
3544 FD_DG(
"vGenerator(" <<
this <<
")::XReadStateSet(\"" << rLabel<<
"\")");
3546 FD_DG(
"vGenerator(" <<
this <<
")::ReadStateSet(..): attribute type " <<
typeid(*attrp).name());
3550 std::string label=rLabel;
3551 if(label==
"") label=rStateSet.
Name();
3552 if(label==
"") label=
"StateSet";
3561 while(!rTr.
Eos(label)) {
3565 if(sttag.
IsBegin(
"Consecutive")) {
3574 if(idx1==0 || idx2 < idx1) {
3576 std::stringstream errstr;
3577 errstr <<
"Invalid range of consecutive states" << rTr.
FileLine();
3578 throw Exception(
"vGenerator::XReadStates", errstr.str(), 80);
3580 FD_DG(
"vGenerator(" <<
this <<
")::XReadStates(\"" << rTr.
FileName() <<
"\"): consecutive range " << idx1 <<
" to " << idx2);
3581 for(
Idx index = idx1; index <= idx2; ++index) {
3582 if(rStateSet.
Exists(index)) {
3584 std::stringstream errstr;
3585 errstr <<
"Doublet state index " << index <<
" " << rTr.
FileLine();
3586 throw Exception(
"vGenerator::XReadStates", errstr.str(), 80);
3601 std::string name=
"";
3607 FD_DG(
"vGenerator::XReadStateSet(): got idx " << index <<
" " << name);
3615 std::stringstream errstr;
3616 errstr <<
"Cannot figure index for state token " << sttag.
Str() << rTr.
FileLine();
3617 throw Exception(
"vGenerator::XReadStateSet", errstr.str(), 80);
3620 if(rStateSet.
Exists(index)) {
3622 std::stringstream errstr;
3623 errstr <<
"Doublet state from token " << sttag.
Str() << rTr.
FileLine();
3624 throw Exception(
"vGenerator::XReadStateSet", errstr.str(), 80);
3634 while(!rTr.
Eos(
"State")) {
3658 FD_DG(
"vGenerator(" <<
this <<
")::XReadStates(\"" << rTr.
FileName() <<
"\"): attribute ?");
3659 attrp->
Read(rTr,
"",
this);
3670 FD_DG(
"vGenerator(" <<
this <<
")::XReadStates(\"" << rTr.
FileName() <<
"\"): done");
3677 FD_DG(
"vGenerator(" <<
this <<
")::ReadTransRel(\"" << rTr.
FileName() <<
"\")");
3679 FD_DG(
"vGenerator(" <<
this <<
")::ReadTransRel(..): attribute type " <<
typeid(*attrp).name());
3682 std::string label=
"";
3685 if(token.
IsBegin(
"TransRel")) label=
"TransRel";
3686 if(token.
IsBegin(
"T")) label=
"T";
3688 std::stringstream errstr;
3689 errstr <<
"Reading TransRel failed in " << rTr.
FileLine() <<
": no valid begin token";
3690 throw Exception(
"vGenerator::ReadTransRel", errstr.str(), 50);
3701 while(!rTr.
Eos(label)) {
3709 Idx x1 = 0, ev = 0, x2 = 0;
3740 attrp->
Read(rTr,
"",
this);
3747 std::stringstream errstr;
3749 throw Exception(
"vGenerator::ReadTransRel", errstr.str(), 85);
3752 std::stringstream errstr;
3754 throw Exception(
"vGenerator::ReadTransRel", errstr.str(), 85);
3757 std::stringstream errstr;
3759 throw Exception(
"vGenerator::ReadTransRel", errstr.str(), 85);
3772 std::stringstream errstr;
3773 errstr <<
"Reading TransRel failed in " << rTr.
FileLine() <<
" " << oex.
What();
3774 throw Exception(
"vGenerator::ReadTransRel", errstr.str(), 50);
3781 FD_DG(
"vGenerator(" <<
this <<
")::ReadTransRel(\"" << rTr.
FileName() <<
"\"): done");
3790 FD_DG(
"vGenerator(" <<
this <<
")::XReadTransRel()");
3792 FD_DG(
"vGenerator(" <<
this <<
")::ReadTransRel(..): attribute type " <<
typeid(*attrp).name());
3798 rTr.
ReadBegin(
"TransitionRelation",btag);
3800 while(!rTr.
Eos(
"TransitionRelation")) {
3804 if(!trtag.
IsBegin(
"Transition")) {
3833 if(x1==0 || x2==0 || ev==0) {
3835 std::stringstream errstr;
3836 errstr <<
"Invalid transition at token " << trtag.
Str() << rTr.
FileLine();
3837 throw Exception(
"vGenerator::XReadTransRel", errstr.str(), 80);
3842 std::stringstream errstr;
3843 errstr <<
"Doublet transition at token " << trtag.
Str() << rTr.
FileLine();
3844 throw Exception(
"vGenerator::XReadTransRel", errstr.str(), 80);
3849 std::stringstream errstr;
3850 errstr <<
"Invalid state x1 " << x1 <<
" " << rTr.
FileLine();
3851 throw Exception(
"vGenerator::XReadTransRel", errstr.str(), 80);
3855 std::stringstream errstr;
3856 errstr <<
"Invalid state x2 " << x2 <<
" " << rTr.
FileLine();
3857 throw Exception(
"vGenerator::XReadTransRel", errstr.str(), 80);
3861 std::stringstream errstr;
3862 errstr <<
"Invalid event " << evname <<
" " << rTr.
FileLine();
3863 throw Exception(
"vGenerator::XReadTransRel", errstr.str(), 80);
3870 if(!token.
IsEnd(
"Transition")) {
3872 attrp->
Read(rTr,
"",
this);
3878 rTr.
ReadEnd(
"TransitionRelation");
3881 FD_DG(
"vGenerator(" <<
this <<
")::XReadTransRel(\"" << rTr.
FileName() <<
"\"): done");
3905 const std::string& rDotExec)
const {
3906 FD_DG(
"vGenerator::GraphWrite(...): " <<
typeid(*this).name());
3910 std::stringstream errstr;
3911 errstr <<
"Exception opening temp file";
3912 throw Exception(
"vGenerator::GraphWrite", errstr.str(), 2);
3919 std::stringstream errstr;
3920 errstr <<
"Exception writing dot input file";
3921 throw Exception(
"vGenerator::GraphWrite", errstr.str(), 2);
3928 std::stringstream errstr;
3929 errstr <<
"Exception processing dot file";
3930 throw Exception(
"vGenerator::GraphWrite", errstr.str(), 3);
4047 if(rGenVec.
Size()==0)
return;
4061 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
Type & operator=(const Type &rSrc)
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)
TBaseSet< Transition, TransSort::X1EvX2 >::Iterator Iterator
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
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)
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 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)