12 #ifndef CPROVER_UTIL_NFA_H
13 #define CPROVER_UTIL_NFA_H
20 #include <unordered_map>
21 #include <unordered_set>
83 for(
const auto label : current.possible_states)
86 const auto it = transition.when.find(input);
87 if(it != transition.when.end())
89 for(
const auto result_state : it->second)
91 new_state.possible_states.insert(result_state);
94 for(
const auto result_state : transition.arbitrary)
96 new_state.possible_states.insert(result_state);
107 out <<
"digraph {\n";
112 out <<
'S' << from <<
" -> S" << to <<
"[label=\"*\"]\n";
116 out <<
'S' << from <<
" -> S" << to <<
u8"[label=\"ε\"]\n";
120 const auto &in = pair.first;
121 const auto &tos = pair.second;
122 for(
const auto to : tos)
124 out <<
'S' << from <<
" -> S" << to <<
"[label=\"(" << in <<
")\"]\n";
134 const auto min_size = std::max(from, to) + 1;
143 std::vector<state_labelt> new_states{};
147 for(
const auto from : state.possible_states)
151 if(!state.contains(to))
153 new_states.push_back(to);
160 std::inserter(state.possible_states, state.possible_states.end()));
161 }
while(!new_states.empty());
168 std::unordered_map<T, std::unordered_set<state_labelt>>
when;
174 #endif // CPROVER_UTIL_NFA_H