lightest: clean up
There are too many types that are vectors of transition_t
. We need something clearer. This routine (which is not documented) is a good example of this issue:
template <Automaton AnyAut>
path_t
path(const AnyAut& aut,
const path_t& path,
state_t_of<Aut> src = Aut::element_type::pre(),
state_t_of<Aut> dst = Aut::element_type::post())
{
path_t res;
for (auto t = path[dst];
t != aut->null_transition();
t = path[aut->src_of(t)])
{
res.emplace_back(t);
if (aut->src_of(t) == src)
break;
}
std::reverse(res.begin(), res.end());
return res;
}
It takes at path_t
, shakes it into a... path_t
! But semantics seems quite different: the incoming one is transition_t indexed (it's really a transition_t -> transition_t map), while the second is merely a list of transition_t
.
I have started to introduce predecessors_t_of
, we should probably introduce more of these aliases, or even new (incompatible) types to avoid this problem. Also note that AnyAut
is not properly propagated to the other arguments. Does it really need to not be automaton_t? If so, document.
More generally, this file (and the others) need more clarity.