File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -633,6 +633,26 @@ let conv_fun f flags on_types =
633633 | TypeUnification -> typefn
634634 | TermUnification -> termfn
635635
636+ let infer_conv_noticing_evars ~pb ~ts env sigma t1 t2 =
637+ let has_evar = ref false in
638+ let evar_expand ev =
639+ let v = existential_expand_value0 sigma ev in
640+ let () = match v with
641+ | CClosure. EvarUndefined _ -> has_evar := true
642+ | CClosure. EvarDefined _ -> ()
643+ in
644+ v
645+ in
646+ let evar_handler = { (Evd. evar_handler sigma) with evar_expand } in
647+ let conv = { genconv = fun pb ~l2r sigma -> Conversion. generic_conv pb ~l2r ~evars: evar_handler } in
648+ match infer_conv_gen conv ~catch_incon: false ~pb ~ts env sigma t1 t2 with
649+ | Some sigma -> Some (Success sigma)
650+ | None ->
651+ if ! has_evar then None
652+ else Some (UnifFailure (sigma, ConversionFailed (env,t1,t2)))
653+ | exception UGraph. UniverseInconsistency e ->
654+ if ! has_evar then None
655+ else Some (UnifFailure (sigma, UnifUnivInconsistency e))
636656
637657let rec evar_conv_x flags env evd pbty term1 term2 =
638658 let t = Random. int 1073741823 in
You can’t perform that action at this time.
0 commit comments