Module AC.
Canonical positive_eqType := EqType positive (EqMixin Pos.eqb_spec).
Inductive syntax := Leaf of positive | Op of syntax & syntax.
Coercion serial := (fix loop (acc : seq positive) (s : syntax) :=
match s with
| Leaf n => n :: acc
| Op s s' => (loop^~ s (loop^~ s' acc))
end) [::].

Lemma serial_Op s1 s2 : Op s1 s2 = s1 ++ s2 :> seq _.