void EncodeCanonical(std::shared_ptr< Node > const &root, std::ostream &out, EncodingContext &ctx)
Append the canonical encoding of the DAG rooted at root to out.
Traversal state for one canonical-encoding pass: the back-reference table.
Definition canonical_encoding.hpp:76
unsigned next_index
The index the next first-encountered node will receive (traversal order).
Definition canonical_encoding.hpp:80
std::map< Node const *, unsigned > seen
First-encounter index of each node visited so far, keyed by object identity.
Definition canonical_encoding.hpp:78