Add canonical_engine().

And use it in `canonical()`.