(* let termty, ugraph = *)
(* CicTypeChecker.type_of_aux' metasenv context term ugraph *)
(* in *)
+ let check = match termty with C.Implicit None -> false | _ -> true in
function
| [] -> None
| candidate::tl ->
let pos, (_, proof, (ty, left, right, o), metas, args) = candidate in
-(* if not (fst (CicReduction.are_convertible *)
-(* ~metasenv context termty ty ugraph)) then ( *)
-(* (\* debug_print (lazy ( *\) *)
-(* (\* Printf.sprintf "CANDIDATE HAS WRONG TYPE: %s required, %s found" *\) *)
-(* (\* (CicPp.pp termty names) (CicPp.pp ty names))); *\) *)
-(* find_matches metasenv context ugraph lift_amount term termty tl *)
-(* ) else *)
+ if check && not (fst (CicReduction.are_convertible
+ ~metasenv context termty ty ugraph)) then (
+(* debug_print (lazy ( *)
+(* Printf.sprintf "CANDIDATE HAS WRONG TYPE: %s required, %s found" *)
+(* (CicPp.pp termty names) (CicPp.pp ty names))); *)
+ find_matches metasenv context ugraph lift_amount term termty tl
+ ) else
let do_match c (* other *) eq_URI =
let subst', metasenv', ugraph' =
let t1 = Unix.gettimeofday () in
;;
-let rec demodulation_aux metasenv context ugraph table lift_amount term =
+let rec demodulation_aux ?(typecheck=false)
+ metasenv context ugraph table lift_amount term =
let module C = Cic in
let module S = CicSubstitution in
let module M = CicMetaSubst in
| C.Meta _ -> None
| term ->
let termty, ugraph =
- C.Implicit None, ugraph
-(* CicTypeChecker.type_of_aux' metasenv context term ugraph *)
+ if typecheck then
+ CicTypeChecker.type_of_aux' metasenv context term ugraph
+ else
+ C.Implicit None, ugraph
in
let res =
find_matches metasenv context ugraph lift_amount term termty candidates
let newmetasenv = List.filter (fun (i, _, _) -> List.mem i m) metas in
!maxmeta, (newproof, newmetasenv, newterm)
in
- let res = demodulation_aux metasenv' context ugraph table 0 term in
+ let res =
+ demodulation_aux ~typecheck:true metasenv' context ugraph table 0 term
+ in
match res with
| Some t ->
let newmeta, newgoal = build_newgoal t in
let newmetasenv = List.filter (fun (i, _, _) -> List.mem i m) metas in
!maxmeta, (newterm, newty, newmetasenv)
in
- let res = demodulation_aux metasenv' context ugraph table 0 termty in
+ let res =
+ demodulation_aux ~typecheck:true metasenv' context ugraph table 0 termty
+ in
match res with
| Some t ->
let newmeta, newthm = build_newtheorem t in