68 mpStateSymbolTable(&mStateSymbolTable),
69 mpEventSymbolTable(GlobalEventSymbolTablep()),
71 mStateNamesEnabled(msStateNamesEnabledDefault),
72 mReindexOnWrite(msReindexOnWriteDefault),
79 pAlphabetPrototype(&AlphabetVoid()),
80 pStatesPrototype(&StatesVoid()),
81 pTransRelPrototype(&TransRelVoid()),
82 pGlobalPrototype(&GlobalVoid())
85 FD_DG(
"vGenerator(" <<
this <<
")::vGenerator()");
101 mpStateSymbolTable(&mStateSymbolTable),
102 mpEventSymbolTable(GlobalEventSymbolTablep()),
104 mStateNamesEnabled(msStateNamesEnabledDefault),
105 mReindexOnWrite(msReindexOnWriteDefault),
110 mpGlobalAttribute(0),
112 pAlphabetPrototype(&AlphabetVoid()),
113 pStatesPrototype(&StatesVoid()),
114 pTransRelPrototype(&TransRelVoid()),
115 pGlobalPrototype(&GlobalVoid())
118 FD_DG(
"vGenerator(" <<
this <<
")::vGenerator(" << &rOtherGen <<
")");
131 mMyName(
"Generator"),
133 mpStateSymbolTable(&mStateSymbolTable),
134 mpEventSymbolTable(GlobalEventSymbolTablep()),
136 mStateNamesEnabled(msStateNamesEnabledDefault),
137 mReindexOnWrite(msReindexOnWriteDefault),
142 mpGlobalAttribute(0),
144 pAlphabetPrototype(&AlphabetVoid()),
145 pStatesPrototype(&StatesVoid()),
146 pTransRelPrototype(&TransRelVoid()),
147 pGlobalPrototype(&GlobalVoid())
150 FD_DG(
"vGenerator(" <<
this <<
")::vGenerator(" << rFileName <<
")");
162 Read(rFileName,
"Generator");
169 FD_DG(
"vGenerator(" <<
this <<
")::New()");
181 FD_DG(
"vGenerator(" <<
this <<
")::Copy()");
189 return dynamic_cast< const vGenerator*
> (pOther);
203 const TransSet* pNewTransRelPrototype) {
204 FD_DG(
"vGenerator(" <<
this <<
")::ConfigureAtributes(..)");
209 FD_DG(
"vGenerator(" <<
this <<
")::ConfigureAtributes(): done");
256 FD_DG(
"vGenerator(" <<
this <<
")::DoAssign(" << &rGen <<
")");
258 if(&rGen==
this)
return;
276 #ifdef FAUDES_DEBUG_CODE
278 FD_DG(
"vGenerator()::Copy(): invalid generator");
283 FD_DG(
"vGenerator(" <<
this <<
")::DoAssign(" << &rGen <<
"): done");
288 FD_DG(
"vGenerator(" <<
this <<
")::Assign([type] " << &rSrc <<
")");
290 if(&rSrc==
this)
return *
this;
304 FD_DG(
"vGenerator(" <<
this <<
")::Assign(" << &rGen <<
")");
321 #ifdef FAUDES_DEBUG_CODE
323 FD_DG(
"vGenerator()::Copy(): invalid generator");
334 FD_DG(
"vGenerator(" <<
this <<
")::Move(" << &rGen <<
")");
341 if(
typeid(*pt)!=
typeid(*opt)) tmm=
true;
344 if(
typeid(*pt)!=
typeid(*opt)) tmm=
true;
347 if(
typeid(*pt)!=
typeid(*opt)) tmm=
true;
350 if(
typeid(*pt)!=
typeid(*opt)) tmm=
true;
353 FD_DG(
"vGenerator(" <<
this <<
")::Move(" << &rGen <<
"): using std copy");
394 FD_DG(
"vGenerator(" <<
this <<
")::operator = " << &rOtherGen);
395 FD_DG(
"vGenerator(" <<
this <<
")::operator = types " <<
typeid(*this).name() <<
" <= " <<
typeid(rOtherGen).name());
401 FD_DG(
"vGenerator(" <<
this <<
")::Version(" << version <<
")");
402 std::ostringstream o;
409 FD_DG(
"vGenerator(" <<
this <<
")::Version(" << rVersion <<
")");
412 std::stringstream errstr;
413 errstr <<
"Destination must not match source.";
414 throw Exception(
"vGenerator::Version(string)", errstr.str(), 96);
419 EventSet::Iterator eit;
420 StateSet::Iterator lit;
422 std::map<Idx,Idx> eventoldnewmap;
427 eventoldnewmap[*eit] = newevent;
453 FD_DG(
"vGenerator(" <<
this <<
")::Version(" << rPattern <<
", " << rReplacement <<
", ...)");
456 std::stringstream errstr;
457 errstr <<
"Destination must not match source.";
458 throw Exception(
"vGenerator::Version(string,string)", errstr.str(), 96);
461 if(rPattern.empty()) {
466 if(rPattern==rReplacement) {
474 EventSet::Iterator eit;
475 StateSet::Iterator lit;
477 std::map<Idx,Idx> eventoldnewmap;
479 std::string newstring;
480 std::string::size_type pos = 0;
481 int patternlength=rPattern.size();
482 int replacementlength=rReplacement.size();
487 while( (pos = newstring.find(rPattern, pos)) != std::string::npos ) {
488 newstring.replace(pos, patternlength, rReplacement);
490 pos=pos+replacementlength;
493 eventoldnewmap[*eit] = newevent;
499 while( (pos = newstring.find(rPattern, pos)) != std::string::npos ) {
500 newstring.replace(pos, patternlength, rReplacement);
501 pos=pos+replacementlength;
503 rResGen.
Name(newstring);
527 FD_DV(
"vGenerator(" <<
this <<
")::Name(\"" << rName <<
"\")");
538 FD_DG(
"vGenerator(" <<
this <<
")::Valid()");
546 StateSet::Iterator lit;
563 NameSet::Iterator eit;
583 FD_DG(
"vGenerator(" <<
this <<
")::Clear()");
591 FD_DG(
"vGenerator(" <<
this <<
")::Clear(): done");
675 FD_DG(
"vGenerator::ClearMinStateIndexMap()");
689 FD_DG(
"vGenerator::SetMinStateIndexMap()");
694 StateSet::Iterator it;
732 #ifdef FAUDES_DEBUG_CONTAINER
733 std::map<Idx,Idx>::const_iterator _it;
735 FD_DC(
"vGenerator::MinStateIndexMap: " << _it->first
736 <<
" <-- " <<
SStr(_it->second));
744 std::map<Idx,Idx>::const_iterator minit;
747 return minit->second;
768 StateSet::Iterator sit;
845 FD_DG(
"vGenerator(" <<
this <<
")::EventName("
846 << index <<
",\"" << rName <<
"\")");
847 #ifdef FAUDES_CHECKED
849 std::stringstream errstr;
850 errstr <<
"event \"" << index <<
"\" not found in generator \""
852 throw Exception(
"vGenerator::EventName(name)", errstr.str(), 89);
860 std::string name=rName;
861 if(name==
"") name=
"ev";
869 FD_DG(
"vGenerator(" <<
this <<
")::EventRename(" <<
EStr(event) <<
", " << rNewName <<
")");
870 #ifdef FAUDES_CHECKED
872 std::stringstream errstr;
873 errstr <<
"event \"" <<
event <<
"\" not found in generator \""
875 throw Exception(
"vGenerator::EventReame(name)", errstr.str(), 89);
883 if(newidx==event)
return true;
891 if(tit->Ev!=event) {++tit;
continue;}
898 for(tit=newtrans->
Begin(); tit!=newtrans->
End(); tit++) {
907 FD_DG(
"vGenerator(" <<
this <<
")::EventRename(" <<
EStr(event) <<
", " << rNewName <<
"):OK");
955 FD_DG(
"vGenerator(" <<
this <<
")::StateName("
956 << index <<
",\"" << rName <<
"\")");
957 #ifdef FAUDES_CHECKED
959 std::stringstream errstr;
960 errstr <<
"state name \"" << rName <<
"\" not found in generator \""
962 throw Exception(
"vGenerator::StateName(name)", errstr.str(), 90);
971 FD_DG(
"vGenerator(" <<
this <<
")::ClearStateNames()");
978 FD_DG(
"Generator(" <<
this <<
")::ClrStateName(\"" << index <<
"\")");
979 #ifdef FAUDES_CHECKED
981 std::stringstream errstr;
982 errstr <<
"state \"" << index <<
"\" not found in generator \""
984 throw Exception(
"vGenerator::ClrStateName(name)", errstr.str(), 90);
992 FD_DG(
"vGenerator(" <<
this <<
")::ClrStateName(\"" << rName <<
"\")");
1016 FD_DG(
"vGenerator(" <<
this <<
")::SetDefaultStateNames()");
1018 StateSet::Iterator it;
1028 FD_DG(
"vGenerator(" <<
this <<
")::EnforceStateNames(temp)");
1029 StateSet::Iterator it;
1040 std::string name=rName;
1041 if(name==
"") name=
"st";
1108 const std::string& rX1,
const std::string& rEv,
const std::string& rX2)
const
1125 const std::string& rX1,
const std::string& rEv,
const std::string& rX2)
const
1171 FD_DG(
"vGenerator::InjectAlphabet() " << rNewAlphabet.
ToString());
1172 #ifdef FAUDES_CHECKED
1174 std::stringstream errstr;
1175 errstr <<
"symboltable mismatch aka not implemented" << std::endl;
1176 throw Exception(
"vGenerator::InjectAlphabet", errstr.str(), 88);
1185 FD_DG(
"vGenerator::RestrictAlphabet() " << rNewAlphabet.
ToString());
1186 #ifdef FAUDES_CHECKED
1188 std::stringstream errstr;
1189 errstr <<
"symboltable mismatch aka not implemented" << std::endl;
1190 throw Exception(
"vGenerator::RestrictAlphabet", errstr.str(), 88);
1199 FD_DG(
"vGenerator(" <<
this <<
")::InsEvent(" << index <<
")");
1205 FD_DG(
"vGenerator(" <<
this <<
")::InsEvent(\"" << rName <<
"\")");
1216 FD_DG(
"vGenerator(" <<
this <<
")::DelEvent(" << index <<
")");
1223 FD_DG(
"vGenerator(" <<
this <<
")::DelEvent(\"" << rName <<
"\")");
1231 FD_DG(
"vGenerator(" <<
this <<
")::DelEvents(\""
1233 EventSet::Iterator it;
1234 for (it = rEvents.
Begin(); it != rEvents.
End(); ++it) {
1241 FD_DG(
"vGenerator(" <<
this <<
")::DelEventFromAlphabet("
1248 FD_DG(
"vGenerator(" <<
this <<
")::InsState()");
1254 FD_DG(
"vGenerator(" <<
this <<
")::InsState(" << index <<
")");
1260 FD_DG(
"vGenerator(" <<
this <<
")::InsState(\"" << rName <<
"\")");
1273 FD_DG(
"vGenerator(" <<
this <<
")::InjectState(\"" <<
SStr(index) <<
"\")");
1279 FD_DG(
"vGenerator(" <<
this <<
")::InjectStates(" << rNewStates.
ToString() <<
")");
1288 FD_DG(
"vGenerator(" <<
this <<
")::InsInitState()");
1297 FD_DG(
"vGenerator(" <<
this <<
")::InsInitState(\"" << rName <<
"\")");
1319 FD_DG(
"vGenerator(" <<
this <<
")::InsMarkedState()");
1335 FD_DG(
"vGenerator(" <<
this <<
")::InsMarkedState(\"" << rName <<
"\")");
1351 FD_DG(
"vGenerator(" <<
this <<
")::DelState(" << index <<
")");
1366 FD_DG(
"vGenerator(" <<
this <<
")::DelState(\"" << rName <<
"\")");
1369 #ifdef FAUDES_CHECKED
1371 std::stringstream errstr;
1372 errstr <<
"state name \"" << rName <<
"\" not found in generator \""
1374 throw Exception(
"vGenerator::DelState(name)", errstr.str(), 90);
1382 FD_DG(
"vGenerator(" <<
this <<
")::DelStates("
1384 StateSet::Iterator cit;
1385 StateSet::Iterator cit_end;
1387 for (cit = rDelStates.
Begin(); cit != rDelStates.
End(); ++cit) {
1400 FD_DG(
"vGenerator(" <<
this <<
")::DelStateFromStates(" << index <<
")");
1407 FD_DG(
"vGenerator(" <<
this <<
")::DelState(" << *pos <<
")");
1413 FD_DG(
"vGenerator(" <<
this <<
")::RestrictStates("
1416 StateSet::Iterator cit;
1417 StateSet::Iterator cit_end;
1433 FD_DG(
"vGenerator(" <<
this <<
")::SetInitState(" << index <<
")");
1434 #ifdef FAUDES_CHECKED
1436 std::stringstream errstr;
1437 errstr <<
"vGenerator::SetMarkedState: index " << index
1438 <<
" not in stateset";
1439 throw Exception(
"vGenerator::SetInitState(..)", errstr.str(), 91);
1447 FD_DG(
"vGenerator(" <<
this <<
")::SetInitState(\"" << rName <<
"\")");
1449 #ifdef FAUDES_CHECKED
1451 std::stringstream errstr;
1452 errstr <<
"State name \"" << rName <<
"\" not known in Generator";
1453 throw Exception(
"vGenerator::SetInitState(..)", errstr.str(), 90);
1461 FD_DG(
"vGenerator(" <<
this <<
")::InjectInitStates("
1462 << rNewInitStates.
ToString() <<
")");
1469 FD_DG(
"vGenerator(" <<
this <<
")::ClrInitState(" << index <<
")");
1470 #ifdef FAUDES_CHECKED
1472 std::stringstream errstr;
1473 errstr <<
"vGenerator::SetMarkedState: index " << index
1474 <<
" not in stateset";
1475 throw Exception(
"vGenerator::ClrInitState(..)", errstr.str(), 91);
1483 FD_DG(
"vGenerator(" <<
this <<
")::ClrInitState(\"" << rName <<
"\")");
1485 #ifdef FAUDES_CHECKED
1487 std::stringstream errstr;
1488 errstr <<
"State name \"" << rName <<
"\" not known in Generator";
1489 throw Exception(
"vGenerator::ClrInitState(..)", errstr.str(), 90);
1497 FD_DG(
"vGenerator(" <<
this <<
")::ClrInitState(" << *pos <<
")");
1508 FD_DG(
"vGenerator(" <<
this <<
")::SetMarkedState(" << index <<
")");
1509 #ifdef FAUDES_CHECKED
1511 std::stringstream errstr;
1512 errstr <<
"vGenerator::SetMarkedState: index " << index
1513 <<
" not in stateset";
1514 throw Exception(
"vGenerator::SetMarkedState(..)", errstr.str(), 91);
1522 FD_DG(
"vGenerator(" <<
this <<
")::SetMarkedState(\"" << rName <<
"\")");
1524 #ifdef FAUDES_CHECKED
1526 std::stringstream errstr;
1527 errstr <<
"State name \"" << rName <<
"\" not known in Generator";
1528 throw Exception(
"vGenerator::SetMarkedState(..)", errstr.str(), 90);
1536 FD_DG(
"vGenerator(" <<
this <<
")::InjectMarkedStates("
1537 << rNewMarkedStates.
ToString() <<
")");
1544 FD_DG(
"vGenerator(" <<
this <<
")::ClrMarkedState(" << index <<
")");
1545 #ifdef FAUDES_CHECKED
1547 std::stringstream errstr;
1548 errstr <<
"vGenerator::ClrMarkedState: index " << index
1549 <<
" not in stateset";
1550 throw Exception(
"vGenerator::ClrMarkedState(..)", errstr.str(), 91);
1558 FD_DG(
"vGenerator(" <<
this <<
")::ClrMarkedState(\"" << rName <<
"\")");
1560 #ifdef FAUDES_CHECKED
1562 std::stringstream errstr;
1563 errstr <<
"State name \"" << rName <<
"\" not known in Generator";
1564 throw Exception(
"vGenerator::ClrMarkedState(..)", errstr.str(), 90);
1572 FD_DG(
"vGenerator(" <<
this <<
")::ClrMarkedState(" << *pos <<
")");
1583 FD_DG(
"vGenerator::InjectTransition(" <<
TStr(rTrans) <<
")");
1589 FD_DG(
"vGenerator::InjectTransRel(...)");
1596 FD_DG(
"vGenerator(" <<
this <<
")::SetTransition(\""
1597 << rX1 <<
"\", \"" << rEv <<
"\", \"" << rX2 <<
"\")");
1600 #ifdef FAUDES_CHECKED
1602 FD_ERR(
"vGenerator::SetTransition: state " << rX1
1603 <<
" not in stateset");
1604 std::stringstream errstr;
1605 errstr <<
"State name " << rX1 <<
" not found in Generator";
1606 throw Exception(
"vGenerator::SetTransition(..)", errstr.str(), 90);
1609 FD_ERR(
"vGenerator::SetTransition: event " << rEv <<
" not in alphabet");
1610 std::stringstream errstr;
1611 errstr <<
"Event name " << rEv <<
" not found in event domain of Generator";
1612 throw Exception(
"vGenerator::SetTransition(..)", errstr.str(), 95);
1615 FD_ERR(
"vGenerator::SetTransition: state " << rX2 <<
" not in stateset");
1616 std::stringstream errstr;
1617 errstr <<
"State name " << rX2 <<
" not found in Generator";
1618 throw Exception(
"vGenerator::SetTransition(..)", errstr.str(), 90);
1632 FD_DG(
"vGenerator(" <<
this <<
")::SetTransition(" << rTransition.
X1 <<
","
1633 << rTransition.
Ev <<
"," << rTransition.
X2 <<
")");
1634 #ifdef FAUDES_CHECKED
1636 std::stringstream errstr;
1637 errstr <<
"vGenerator::SetTransition: state " <<
SStr(rTransition.
X1)
1638 <<
" not in stateset";
1639 throw Exception(
"vGenerator::SetTransition(..)", errstr.str(), 95);
1642 std::stringstream errstr;
1643 errstr <<
"vGenerator::SetTransition: event " <<
EStr(rTransition.
Ev)
1644 <<
" not in alphabet ";
1645 throw Exception(
"vGenerator::SetTransition(..)", errstr.str(), 95);
1648 std::stringstream errstr;
1649 errstr <<
"vGenerator::SetTransition: state " <<
SStr(rTransition.
X2)
1650 <<
" not in stateset";
1651 throw Exception(
"vGenerator::SetTransition(..)", errstr.str(), 95);
1661 FD_DG(
"vGenerator(" <<
this <<
")::ClrTransition("
1662 << x1 <<
"," << ev <<
"," << x2 <<
")");
1668 FD_DG(
"vGenerator(" <<
this <<
")::ClrTransition(" <<
TStr(rTransition) <<
")");
1674 FD_DG(
"vGenerator(" <<
this <<
")::ClrTransition(" <<
TStr(*it)<<
")" );
1680 FD_DG(
"vGenerator(" <<
this <<
")::ClrTransition("
1681 << x1 <<
"," << ev <<
")");
1687 FD_DG(
"vGenerator(" <<
this <<
")::ClrTransition("
1694 FD_DG(
"vGenerator(" <<
this <<
")::TransAttribute("
1695 <<
TStr(rTrans) <<
",\"" << rAttr.
ToString() <<
"\")");
1723 FD_DG(
"vGenerator(" <<
this <<
")::EventAttribute("
1731 FD_DG(
"vGenerator(" <<
this <<
")::EventAttributes("
1738 FD_DG(
"vGenerator(" <<
this <<
")::ClrEventAttribute(\"" <<
EStr(index) <<
"\")");
1744 FD_DG(
"vGenerator(" <<
this <<
")::StateAttribute("
1751 FD_DG(
"vGenerator(" <<
this <<
")::ClrStateAttribute(\"" << index <<
"\")");
1847 FD_DG(
"vGenerator(" <<
this <<
")::GlobalAttribute("
1852 std::stringstream errstr;
1853 errstr <<
"cannot cast global attribute " << rAttr.
ToString() <<
" for generator " <<
Name();
1854 throw Exception(
"vGenerator::GlobalAttribute", errstr.str(), 63);
1859 FD_DG(
"vGenerator(" <<
this <<
")::GlobalAttributeTry("
1866 FD_DG(
"vGenerator(" <<
this <<
")::GlobalAttribute()");
1872 FD_DG(
"vGenerator(" <<
this <<
")::GlobalAttributep()");
1903 const std::string& rX1,
const std::string& rEv,
const std::string& rX2)
const {
1927 resultset.
Insert(it->Ev);
1983 if(it==it_end)
return 0;
1985 #ifdef FAUDES_CHECKED
1988 std::stringstream errstr;
1989 errstr <<
"successor state does not exist uniquely" << std::endl;
1990 throw Exception(
"vGenerator::SuccessorState", errstr.str(), 92);
2000 std::stack<Idx> todo;
2001 StateSet::Iterator sit;
2009 while(!todo.empty()) {
2014 if(accessibleset.
Exists(x1))
continue;
2016 accessibleset.
Insert(x1);
2020 for(; tit != tit_end; ++tit)
2025 accessibleset.
Name(
"AccessibleSet");
2026 return accessibleset;
2036 FD_DF(
"vGenerator::accessible: generator is accessible");
2039 FD_DF(
"vGenerator::accessible: generator is accessible but empty");
2046 FD_DF(
"vGenerator::accessible: generator is accessible");
2049 FD_DF(
"vGenerator::accessible: generator is not accessible");
2059 StateSet::Iterator sit;
2060 std::stack<Idx> todo;
2068 while(!todo.empty()) {
2073 if(coaccessibleset.
Exists(x2))
continue;
2075 coaccessibleset.
Insert(x2);
2079 for(; tit != tit_end; ++tit)
2084 coaccessibleset.
Name(
"CoaccessibleSet");
2085 return coaccessibleset;
2095 FD_DF(
"vGenerator::coaccessible: generator is coaccessible");
2098 FD_DF(
"vGenerator::coaccessible: generator is not coaccessible");
2105 FD_DF(
"vGenerator::coaccessible: generator is coaccessible");
2108 FD_DF(
"vGenerator::coaccessible: generator is not coaccessible");
2114 FD_DF(
"vGenerator::trimset: trim states: "
2117 res.
Name(
"TrimSet");
2128 if(accessiblebool && coaccessiblebool) {
2129 FD_DF(
"vGenerator::Trim(): generator is nontrivial");
2132 FD_DF(
"vGenerator::Trim(): generator is trivial");
2142 FD_DF(
"vGenerator::IsTrim(): result " << res);
2149 FD_DF(
"vGenerator::BlockingSet: blocking states: "
2161 StateSet::Iterator sit=rStates.
Begin();
2162 StateSet::Iterator sit_end=rStates.
End();
2163 for(;sit!=sit_end;sit++){
2166 if(tit==tit_end)
break;
2169 return sit==sit_end;
2177 std::stack<Idx> todo;
2180 while(tit!=tit_end){
2181 if(!rSigmaO.
Exists(tit->Ev)) { ++tit;
continue; }
2190 while(!todo.empty()) {
2195 if(good.
Exists(x2))
continue;
2201 for(; tit != tit_end; ++tit)
2202 if(tit->X1 != x2) todo.push(tit->X1);
2204 FD_DG(
"IsComplete(" <<
Name() <<
"): done");
2224 StateSet::Iterator sit_end =
States().
End();
2226 for(; sit!=sit_end; ++sit) {
2227 if(termset.
Exists(*sit))
continue;
2230 for (; tit != tit_end; ++tit) {
2231 if(!termset.
Exists(tit->X2))
break;
2262 while(tit!=tit_end) {
2263 if(!rSigmaO.
Exists(tit->Ev)) { ++tit;
continue; }
2264 if(!domain.
Exists(tit->X2)) { ++tit;
continue; }
2271 StateSet::Iterator sit;
2272 std::stack<Idx> todo;
2273 for(sit = target.
Begin(); sit != target.
End(); ++sit)
2275 while(!todo.empty()) {
2280 if(good.
Exists(x2))
continue;
2286 for(; tit != tit_end; ++tit)
2287 if(tit->X1 != x2) todo.push(tit->X1);
2291 if(domain <= good)
break;
2294 domain = domain * good;
2309 FD_DG(
"Generator::TerminalStates(" <<
Name() <<
")");
2315 StateSet::Iterator sit=rStates.
Begin();
2316 StateSet::Iterator sit_end=rStates.
End();
2317 for(;sit!=sit_end;sit++){
2320 if(tit==tit_end) res.
Insert(*sit);
2323 res.
Name(
"TerminalStates");
2360 FD_DF(
"vGenerator::IsOmegaTrim(): result " << res);
2370 FD_DG(
"vGenerator::IsDeterministic: more than one initial state");
2378 if ((it1->X1 == it2->X1) && (it1->Ev == it2->Ev)) {
2379 FD_DG(
"IsDeterministic(): at least one state "
2380 <<
"contains more than on transition with same event: "
2424 std::string label=rLabel;
2425 if(label==
"") label=
"Generator";
2426 FD_DG(
"vGenerator(" <<
this <<
")::DoWrite(): section " << label);
2456 std::string label=rLabel;
2457 if(label==
"") label=
"Generator";
2458 FD_DG(
"vGenerator(" <<
this <<
")::DoDWrite(): section " << label);
2486 std::string label=rLabel;
2488 if(label==
"") label=
"Generator";
2495 FD_DG(
"vGenerator(" <<
this <<
")::DoXWrite(..): section " << btag.
StringValue() <<
" #" <<
Size());
2567 std::map<Idx,Idx> reversemap;
2568 std::map<Idx,Idx>::const_iterator minit;
2569 StateSet::Iterator sit;
2573 for(minit = reversemap.begin(); minit != reversemap.end(); ++minit) {
2575 std::map<Idx,Idx>::const_iterator conit=minit;
2576 Idx start = conit->first;
2578 for(; conit != reversemap.end(); ++conit) {
2579 if(
StateName(conit->second) !=
"")
break;
2581 if(conit->first != start+anoncount)
break;
2588 rTw << start+anoncount-1;
2593 if(minit == reversemap.end())
break;
2595 std::string statename =
StateName(minit->second);
2596 if (statename !=
"") rTw << statename;
2597 else rTw << minit->first;
2608 StateSet::Iterator sit;
2611 StateSet::Iterator conit=sit;
2617 if(*conit != start+anoncount)
break;
2624 rTw << start+anoncount-1;
2631 std::string statename =
StateName(*sit);
2632 if((statename !=
"") && symexpl) {
2634 }
else if(statename !=
"") {
2659 std::map<Idx,Idx> reversemap;
2660 std::map<Idx,Idx>::const_iterator minit;
2661 StateSet::Iterator sit;
2662 for (sit = rStateSet.
Begin(); sit != rStateSet.
End(); ++sit)
2665 for(minit = reversemap.begin(); minit != reversemap.end(); ++minit) {
2667 std::map<Idx,Idx>::const_iterator conit=minit;
2668 Idx start = conit->first;
2670 for(; conit != reversemap.end(); ++conit) {
2671 if(
StateName(conit->second) !=
"")
break;
2673 if(conit->first != start+anoncount)
break;
2680 rTw << start+anoncount-1;
2685 if(minit == reversemap.end())
break;
2687 std::string statename =
StateName(minit->second);
2688 if (statename !=
"") rTw << statename;
2689 else rTw << minit->first;
2699 StateSet::Iterator sit;
2700 for(sit = rStateSet.
Begin(); sit != rStateSet.
End(); ++sit) {
2702 StateSet::Iterator conit=sit;
2705 for(; conit != rStateSet.
End(); ++conit) {
2708 if(*conit != start+anoncount)
break;
2715 rTw << start+anoncount-1;
2720 if(sit == rStateSet.
End())
break;
2722 std::string statename =
StateName(*sit);
2723 if (statename !=
"") rTw << statename;
2738 StateSet::Iterator sit;
2739 for(sit = rStateSet.
Begin(); sit != rStateSet.
End(); ++sit) {
2751 std::string label=rLabel;
2752 if(label==
"") label=rStateSet.
Name();
2753 if(label==
"") label=
"StateSet";
2758 std::map<Idx,Idx> reversemap;
2759 std::map<Idx,Idx>::const_iterator minit;
2760 StateSet::Iterator sit;
2761 for (sit = rStateSet.
Begin(); sit != rStateSet.
End(); ++sit) {
2765 for(minit = reversemap.begin(); minit != reversemap.end(); ++minit) {
2767 std::map<Idx,Idx>::const_iterator conit=minit;
2768 Idx start = conit->first;
2770 for(; conit != reversemap.end(); ++conit) {
2771 if(
StateName(conit->second) !=
"")
break;
2775 if(conit->first != start+anoncount)
break;
2788 if(minit == reversemap.end() )
2792 std::string statename =
StateName(minit->second);
2793 Idx index=minit->first;
2858 int oldcolumns = rTw.
Columns();
2868 if (smalltransrel) {
2869 std::string x1name =
StateName(tit->X1);
2884 if (smalltransrel) {
2885 std::string x2name =
StateName(tit->X2);
2906 int oldcolumns = rTw.
Columns();
2912 std::ostringstream ox1;
2916 ox1 << x1name <<
"[" << x1 <<
"]";
2922 std::ostringstream oev;
2925 oev << evname <<
"[" << ev <<
"]";
2928 std::ostringstream ox2;
2932 ox2 << x2name <<
"[" << x2 <<
"]";
2980 rTw.
WriteEnd(
"TransitionRelation");
3001 FD_DG(
"vGenerator(" <<
this <<
")::DotWrite(" << rFileName <<
")");
3004 StateSet::Iterator lit;
3007 std::ofstream stream;
3008 stream.exceptions(std::ios::badbit|std::ios::failbit);
3009 stream.open(rFileName.c_str());
3010 stream <<
"// dot output generated by libFAUDES vGenerator" << std::endl;
3011 stream <<
"digraph \"" <<
Name() <<
"\" {" << std::endl;
3012 stream <<
" rankdir=LR" << std::endl;
3013 stream <<
" node [shape=circle];" << std::endl;
3014 stream << std::endl;
3015 stream <<
" // initial states" << std::endl;
3020 stream <<
" dot_dummyinit_" << i <<
" [shape=none, label=\"\", width=\"0.0\", height=\"0.0\" ];" << std::endl;
3021 stream <<
" dot_dummyinit_" << i <<
" -> \"" << xname <<
"\";" << std::endl;
3024 stream << std::endl;
3025 stream <<
" // mstates" << std::endl;
3029 stream <<
" \"" << xname <<
"\" [shape=doublecircle];" << std::endl;
3031 stream << std::endl;
3032 stream <<
" // rest of stateset" << std::endl;
3037 stream <<
" \"" << xname <<
"\";" << std::endl;
3040 stream << std::endl;
3041 stream <<
" // transition relation" << std::endl;
3047 stream <<
" \"" << x1name <<
"\" -> \"" << x2name
3048 <<
"\" [label=\"" <<
EventName(tit->Ev) <<
"\"];" << std::endl;
3050 stream <<
"}" << std::endl;
3053 catch (std::ios::failure&) {
3055 "Exception opening/writing dotfile \""+rFileName+
"\"", 2);
3062 FD_DG(
"vGenerator(" <<
this <<
")::DDotWrite(" << rFileName <<
")");
3063 StateSet::Iterator lit;
3066 std::ofstream stream;
3067 stream.exceptions(std::ios::badbit|std::ios::failbit);
3068 stream.open(rFileName.c_str());
3069 stream <<
"digraph \"" <<
Name() <<
"\" {" << std::endl;
3070 stream <<
" rankdir=LR" << std::endl;
3071 stream <<
" node [shape=circle];" << std::endl;
3072 stream << std::endl;
3073 stream <<
" // istates" << std::endl;
3076 stream <<
" dot_dummyinit_" << i <<
" [shape=none, label=\"\" ];" << std::endl;
3077 stream <<
" dot_dummyinit_" << i <<
" -> \""
3078 <<
SStr(*lit) <<
"\";" << std::endl;
3081 stream << std::endl;
3082 stream <<
" // mstates" << std::endl;
3084 stream <<
" \"" <<
SStr(*lit) <<
"\" [shape=doublecircle];" << std::endl;
3086 stream << std::endl;
3087 stream <<
" // rest of stateset" << std::endl;
3091 stream <<
" \"" <<
SStr(*lit) <<
"\";" << std::endl;
3094 stream << std::endl;
3095 stream <<
" // transition relation" << std::endl;
3097 stream <<
" \"" <<
SStr(tit->X1)
3098 <<
"\" -> \"" <<
SStr(tit->X2)
3099 <<
"\" [label=\"" <<
EventName(tit->Ev) <<
"\"];" << std::endl;
3101 stream <<
"}" << std::endl;
3104 catch (std::ios::failure&) {
3105 throw Exception(
"vGenerator::DDotWrite",
3106 "Exception opening/writing dotfile \""+rFileName+
"\"", 2);
3113 FD_DG(
"vGenerator(" <<
this <<
")::XDotWrite(" << rFileName <<
")");
3114 StateSet::Iterator lit;
3117 std::ofstream stream;
3118 stream.exceptions(std::ios::badbit|std::ios::failbit);
3119 stream.open(rFileName.c_str());
3120 stream <<
"digraph \"___" <<
Name() <<
"___\" {" << std::endl;
3121 stream <<
" rankdir=LR" << std::endl;
3122 stream <<
" node [shape=circle];" << std::endl;
3123 stream << std::endl;
3124 stream <<
" // stateset" << std::endl;
3126 stream <<
" \"s" << *lit <<
"\";" << std::endl;
3129 stream <<
" \"s" << *lit <<
"\";" << std::endl;
3134 stream <<
" \"s" << *lit <<
"\";" << std::endl;
3136 stream << std::endl;
3137 stream <<
" // transition relation" << std::endl;
3139 stream <<
" \"s" << tit->X1
3140 <<
"\" -> \"s" << tit->X2
3141 <<
"\" [label=\"e" << tit->Ev <<
"\" " <<
"polyline" <<
"];" << std::endl;
3143 stream <<
"}" << std::endl;
3146 catch (std::ios::failure&) {
3147 throw Exception(
"vGenerator::XDotWrite",
3148 "Exception opening/writing dotfile \""+rFileName+
"\"", 2);
3155 std::string label=rLabel;
3156 if(label==
"") label=
"Generator";
3157 FD_DG(
"vGenerator(" <<
this <<
")::DoRead(): file " << rTr.
FileName() <<
" section " << label);
3163 int seclev=rTr.
Level();
3172 std::string name=
"generator";
3204 if(token.
IsBegin(
"InitStates"))
3210 if(token.
IsBegin(
"MarkedStates"))
3218 if(native) xml=
false;
3222 std::string name=
"generator";
3241 FD_DG(
"vGenerator(" <<
this <<
")::DoRead(): done");
3246 FD_DG(
"vGenerator(" <<
this <<
")::ReadAlphabet(\""
3258 FD_DG(
"vGenerator(" <<
this <<
")::ReadStates(\"" << rTr.
FileName() <<
"\")");
3261 std::string label=
"";
3265 if(label==
"")
return;
3267 FD_DG(
"vGenerator(" <<
this <<
")::ReadStates(..): attribute type " <<
typeid(*attrp).name());
3278 while(!rTr.
Eos(label)) {
3285 FD_DG(
"vGenerator(" <<
this <<
")::ReadStates(\"" << rTr.
FileName() <<
"\"): by index " << index);
3288 std::stringstream errstr;
3289 errstr <<
"Token " << token.
IntegerValue() <<
" appears twice in stateset"
3291 throw Exception(
"vGenerator::ReadStates", errstr.str(), 80);
3294 attrp->
Read(rTr,
"",
this);
3310 std::size_t pos= statename.find_first_of(
'#');
3311 if(pos==std::string::npos) symimpl=
true;
3312 if(pos!=std::string::npos) symexpl=
true;
3313 if(pos!=std::string::npos && pos < statename.size()-1) {
3314 std::string suffix=statename.substr(pos+1);
3315 index=
ToIdx(suffix);
3316 statename=statename.substr(0,pos);
3317 FD_DG(
"vGenerator(" <<
this <<
")::ReadStates(\"" << rTr.
FileName() <<
"\"): extracted suffix from " << token.
StringValue() <<
": " << statename <<
" idx " << index);
3322 std::stringstream errstr;
3323 errstr <<
"State " << statename <<
"(idx " << index <<
") appears twice in stateset"
3325 throw Exception(
"vGenerator::ReadStates", errstr.str(), 80);
3328 attrp->
Read(rTr,
"",
this);
3339 if(token.
IsBegin(
"Consecutive")) {
3341 Token token1,token2;
3344 FD_DG(
"vGenerator(" <<
this <<
")::ReadStates(\"" << rTr.
FileName() <<
"\"): consecutive range");
3347 std::stringstream errstr;
3348 errstr <<
"Invalid range of consecutive states" << rTr.
FileLine();
3349 throw Exception(
"vGenerator::ReadStates", errstr.str(), 80);
3354 std::stringstream errstr;
3355 errstr <<
"Index " << index <<
" appears twice in stateset"
3357 throw Exception(
"vGenerator::ReadStates", errstr.str(), 80);
3367 std::stringstream errstr;
3368 errstr <<
"Invalid token" << rTr.
FileLine();
3369 throw Exception(
"vGenerator::ReadStates", errstr.str(), 80);
3373 if(symimpl && symexpl) {
3375 std::stringstream errstr;
3376 errstr <<
"StateSet with inconsitent explicit symboltable" << rTr.
FileLine();
3377 throw Exception(
"vGenerator::ReadStates", errstr.str(), 80);
3381 FD_DG(
"vGenerator(" <<
this <<
")::ReadStates(\"" << rTr.
FileName() <<
"\"): done");
3387 FD_DG(
"vGenerator(" <<
this <<
")::ReadStateSet(\"" << rLabel<<
"\")");
3391 FD_DG(
"vGenerator(" <<
this <<
")::ReadStateSet(..): attribute type " <<
typeid(*attrp).name());
3395 rStateSet.
Name(rLabel);
3397 while(!rTr.
Eos(rLabel)) {
3406 std::stringstream errstr;
3407 errstr <<
"Token " << token.
IntegerValue() <<
" not in stateset"
3409 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 80);
3412 attrp->
Read(rTr,
"",
this);
3425 std::size_t pos= statename.find_first_of(
'#');
3426 if(pos!=std::string::npos) {
3428 std::stringstream errstr;
3429 errstr <<
"invalid symbolic name: " << token.
StringValue()
3430 <<
" (no suffix allowed in external state sets)" << rTr.
FileLine();
3431 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 80);
3436 std::stringstream errstr;
3437 errstr <<
"Symbolic name " << token.
StringValue() <<
" not in stateset"
3439 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 80);
3442 attrp->
Read(rTr,
"",
this);
3453 Token token1,token2;
3458 std::stringstream errstr;
3459 errstr <<
"Invalid range of consecutive states" << rTr.
FileLine();
3460 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 80);
3464 std::stringstream errstr;
3465 errstr <<
"Token " << token.
IntegerValue() <<
" not in stateset"
3467 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 80);
3476 std::stringstream errstr;
3477 errstr <<
"Invalid token" << rTr.
FileLine();
3478 throw Exception(
"vGenerator::ReadStateSet", errstr.str(), 50);
3487 FD_DG(
"vGenerator(" <<
this <<
")::XReadStateSet(\"" << rLabel<<
"\")");
3489 FD_DG(
"vGenerator(" <<
this <<
")::ReadStateSet(..): attribute type " <<
typeid(*attrp).name());
3493 std::string label=rLabel;
3494 if(label==
"") label=rStateSet.
Name();
3495 if(label==
"") label=
"StateSet";
3504 while(!rTr.
Eos(label)) {
3508 if(sttag.
IsBegin(
"Consecutive")) {
3517 if(idx1==0 || idx2 < idx1) {
3519 std::stringstream errstr;
3520 errstr <<
"Invalid range of consecutive states" << rTr.
FileLine();
3521 throw Exception(
"vGenerator::XReadStates", errstr.str(), 80);
3523 FD_DG(
"vGenerator(" <<
this <<
")::XReadStates(\"" << rTr.
FileName() <<
"\"): consecutive range " << idx1 <<
" to " << idx2);
3524 for(
Idx index = idx1; index <= idx2; ++index) {
3525 if(rStateSet.
Exists(index)) {
3527 std::stringstream errstr;
3528 errstr <<
"Doublet state index " << index <<
" " << rTr.
FileLine();
3529 throw Exception(
"vGenerator::XReadStates", errstr.str(), 80);
3544 std::string name=
"";
3550 FD_DG(
"vGenerator::XReadStateSet(): got idx " << index <<
" " << name);
3558 std::stringstream errstr;
3559 errstr <<
"Cannot figure index for state token " << sttag.
Str() << rTr.
FileLine();
3560 throw Exception(
"vGenerator::XReadStateSet", errstr.str(), 80);
3563 if(rStateSet.
Exists(index)) {
3565 std::stringstream errstr;
3566 errstr <<
"Doublet state from token " << sttag.
Str() << rTr.
FileLine();
3567 throw Exception(
"vGenerator::XReadStateSet", errstr.str(), 80);
3577 while(!rTr.
Eos(
"State")) {
3601 FD_DG(
"vGenerator(" <<
this <<
")::XReadStates(\"" << rTr.
FileName() <<
"\"): attribute ?");
3602 attrp->
Read(rTr,
"",
this);
3613 FD_DG(
"vGenerator(" <<
this <<
")::XReadStates(\"" << rTr.
FileName() <<
"\"): done");
3620 FD_DG(
"vGenerator(" <<
this <<
")::ReadTransRel(\"" << rTr.
FileName() <<
"\")");
3622 FD_DG(
"vGenerator(" <<
this <<
")::ReadTransRel(..): attribute type " <<
typeid(*attrp).name());
3625 std::string label=
"";
3628 if(token.
IsBegin(
"TransRel")) label=
"TransRel";
3629 if(token.
IsBegin(
"T")) label=
"T";
3631 std::stringstream errstr;
3632 errstr <<
"Reading TransRel failed in " << rTr.
FileLine() <<
": no valid begin token";
3633 throw Exception(
"vGenerator::ReadTransRel", errstr.str(), 50);
3644 while(!rTr.
Eos(label)) {
3652 Idx x1 = 0, ev = 0, x2 = 0;
3683 attrp->
Read(rTr,
"",
this);
3690 std::stringstream errstr;
3692 throw Exception(
"vGenerator::ReadTransRel", errstr.str(), 85);
3695 std::stringstream errstr;
3697 throw Exception(
"vGenerator::ReadTransRel", errstr.str(), 85);
3700 std::stringstream errstr;
3702 throw Exception(
"vGenerator::ReadTransRel", errstr.str(), 85);
3715 std::stringstream errstr;
3716 errstr <<
"Reading TransRel failed in " << rTr.
FileLine() << oex.
What();
3717 throw Exception(
"vGenerator::ReadTransRel", errstr.str(), 50);
3724 FD_DG(
"vGenerator(" <<
this <<
")::ReadTransRel(\"" << rTr.
FileName() <<
"\"): done");
3733 FD_DG(
"vGenerator(" <<
this <<
")::XReadTransRel()");
3735 FD_DG(
"vGenerator(" <<
this <<
")::ReadTransRel(..): attribute type " <<
typeid(*attrp).name());
3741 rTr.
ReadBegin(
"TransitionRelation",btag);
3743 while(!rTr.
Eos(
"TransitionRelation")) {
3747 if(!trtag.
IsBegin(
"Transition")) {
3776 if(x1==0 || x2==0 || ev==0) {
3778 std::stringstream errstr;
3779 errstr <<
"Invalid transition at token " << trtag.
Str() << rTr.
FileLine();
3780 throw Exception(
"vGenerator::XReadTransRel", errstr.str(), 80);
3785 std::stringstream errstr;
3786 errstr <<
"Doublet transition at token " << trtag.
Str() << rTr.
FileLine();
3787 throw Exception(
"vGenerator::XReadTransRel", errstr.str(), 80);
3792 std::stringstream errstr;
3793 errstr <<
"Invalid state x1 " << x1 <<
" " << rTr.
FileLine();
3794 throw Exception(
"vGenerator::XReadTransRel", errstr.str(), 80);
3798 std::stringstream errstr;
3799 errstr <<
"Invalid state x2 " << x2 <<
" " << rTr.
FileLine();
3800 throw Exception(
"vGenerator::XReadTransRel", errstr.str(), 80);
3804 std::stringstream errstr;
3805 errstr <<
"Invalid event " << evname <<
" " << rTr.
FileLine();
3806 throw Exception(
"vGenerator::XReadTransRel", errstr.str(), 80);
3813 if(!token.
IsEnd(
"Transition")) {
3815 attrp->
Read(rTr,
"",
this);
3821 rTr.
ReadEnd(
"TransitionRelation");
3824 FD_DG(
"vGenerator(" <<
this <<
")::XReadTransRel(\"" << rTr.
FileName() <<
"\"): done");
3848 const std::string& rDotExec)
const {
3849 FD_DG(
"vGenerator::GraphWrite(...): " <<
typeid(*this).name());
3853 std::stringstream errstr;
3854 errstr <<
"Exception opening temp file";
3855 throw Exception(
"vGenerator::GraphWrite", errstr.str(), 2);
3862 std::stringstream errstr;
3863 errstr <<
"Exception writing dot input file";
3864 throw Exception(
"vGenerator::GraphWrite", errstr.str(), 2);
3871 std::stringstream errstr;
3872 errstr <<
"Exception processing dot file";
3873 throw Exception(
"vGenerator::GraphWrite", errstr.str(), 3);
4005 if(rGenVec.
Size()==0)
return;
4019 if(rGenVec.
Size()==0)
return;
#define FAUDES_OBJCOUNT_DEC(type)
#define FAUDES_OBJCOUNT_INC(type)
virtual bool IsDefault(void) const
static void Skip(TokenReader &rTr)
virtual const char * What() 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
virtual const std::string & TypeName(void) 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)
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
bool IsOmegaTrim(void) 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
const std::string & Name(void) const
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 Name(const std::string &rName)
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::X2EvX1 > TransSetX2EvX1
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
TTransSet< TransSort::X2X1Ev > TransSetX2X1Ev
virtual const AttributeVoid & Attribute(const T &rElem) const
virtual bool Erase(const T &rElem)
const std::string & Name(void) const
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 OmegaTrim(vGenerator &rGen)
void Complete(vGenerator &rGen)
bool IsOmegaTrim(const 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)