fact: Fixpoint combine' (A: Type) (c: A -> A -> A) (t1: ptrie A) { struct t1 } := fix combine_aux t2 { struct t2 } := match t1, t2 with | Empty, _ => t2 | _, Empty => t1 | Leaf i x, _ => insert' c i x t2 | _, Leaf i x => insert' (fun a b => c b a) i x t1 | Branch p1 m1 l1 r1, Branch p2 m2 l2 r2 => if elt_eqb p1 p2 && elt_eqb m1 m2 then Branch p1 m1 (combine' c l1 l2) (combine' c r1 r2) else if Key.ltb m1 m2 && Key.match_prefix p2 p1 m1 then if Key.zerobit p2 m1 then Branch p1 m1 (combine' c l1 t2) r1 else Branch p1 m1 l1 (combine' c r1 t2) else if Key.ltb m2 m1 && Key.match_prefix p1 p2 m2 then if Key.zerobit p1 m2 then Branch p2 m2 (combine_aux l2) r2 else Branch p2 m2 l2 (combine_aux r2) else join p1 t1 p2 t2 end.
imports: Lia Cdcl.Coqlib