fact: Fixpoint xmerge (m1 : t A)(m2 : t B)(i:positive) : t C := match m1 with | Leaf => xmapi (fun k => f k None) m2 i | Node l1 o1 r1 => match m2 with | Leaf => xmapi (fun k o => f k o None) m1 i | Node l2 o2 r2 => Node (xmerge l1 l2 (i~0)) (f (rev i) o1 o2) (xmerge r1 r2 (i~1)) end end.
imports: Coq(Bool PeanoNat BinPos Orders OrdersEx OrdersLists) MMaps(Utils Comparisons Interface)