find_all_matches ~unif_fun
metasenv context ugraph 0 left ty leftc
in
- let rec ok what = function
+ let rec ok what leftorright = function
| [] -> None
| (_, subst, menv, ug, ((pos,equation),_))::tl ->
let _, _, (_, l, r, o), m,_ = Equality.open_equality equation in
unif_fun metasenv m context what' other' ugraph
in
(match Subst.merge_subst_if_possible subst subst' with
- | None -> ok what tl
- | Some s -> Some (s, equation))
+ | None -> ok what leftorright tl
+ | Some s -> Some (s, equation, leftorright))
with
| Inference.MatchingFailure
- | CicUnification.UnificationFailure _ -> ok what tl
+ | CicUnification.UnificationFailure _ -> ok what leftorright tl
in
- match ok right leftr with
+ match ok right Utils.Left leftr with
| Some _ as res -> res
| None ->
let rightr =
find_all_matches ~unif_fun
metasenv context ugraph 0 right ty rightc
in
- ok left rightr
+ ok left Utils.Right rightr
;;
let subsumption x y z =