X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_refiner%2FnCicUnifHint.ml;h=c09e08d3c6b506c4f144d929ce8c273975bb79a5;hb=8de1a75899a83dd31e856804bd448c1bd87d9ab3;hp=3b6d163f4bf5e94d73360ca1181996497ed1f59c;hpb=1eae83d9c648acdea55d333aba67fcc252b54bea;p=helm.git diff --git a/helm/software/components/ng_refiner/nCicUnifHint.ml b/helm/software/components/ng_refiner/nCicUnifHint.ml index 3b6d163f4..c09e08d3c 100644 --- a/helm/software/components/ng_refiner/nCicUnifHint.ml +++ b/helm/software/components/ng_refiner/nCicUnifHint.ml @@ -62,25 +62,20 @@ let index_hint hdb context t1 t2 precedence = let empty_db = DB.empty ;; -let user_db = ref empty_db ;; - -let add_user_provided_hint t precedence = - let u = UriManager.uri_of_string "cic:/foo/bar.con" in +let add_user_provided_hint db t precedence = let c, a, b = let rec aux ctx = function | NCic.Appl l -> (match List.rev l with | b::a::_ -> ctx, a, b | _ -> assert false) - | NCic.Prod (n,s,t) -> - aux ((n, NCic.Decl s) :: ctx) t - | NCic.LetIn (n,ty,t,b) -> - aux ((n, NCic.Def (t,ty)) :: ctx) b + | NCic.Prod (n,s,t) -> aux ((n, NCic.Decl s) :: ctx) t + | NCic.LetIn (n,ty,t,b) -> aux ((n, NCic.Def (t,ty)) :: ctx) b | _ -> assert false in - aux [] (fst (OCic2NCic.convert_term u t)) + aux [] t in - user_db := index_hint !user_db c a b precedence + index_hint db c a b precedence ;; let db () = @@ -137,19 +132,22 @@ let db () = if List.length l > 1 then combine mk_hint l else []) - [] (CoercDb.to_list ()) + [] (CoercDb.to_list (CoercDb.dump ())) in + prerr_endline "MISTERO"; + assert false (* ERA List.fold_left (fun db -> function | (ctx,b1,b2) -> index_hint db ctx b1 b2 0) !user_db (List.flatten hints) +*) ;; let saturate ?(delta=0) metasenv subst context ty goal_arity = assert (goal_arity >= 0); let rec aux metasenv = function | NCic.Prod (name,s,t) as ty -> - let metasenv1, arg,_ = + let metasenv1, _, arg,_ = NCicMetaSubst.mk_meta ~name:name metasenv context (`WithType s) in let t, metasenv1, args, pno = aux metasenv1 (NCicSubstitution.subst arg t) @@ -196,7 +194,8 @@ let look_for_hint hdb metasenv subst context t1 t2 = let rec aux () (m,l as acc) = function | NCic.Meta _ as t -> acc, t | NCic.LetIn (name,ty,bo,t) -> - let m,i,_=NCicMetaSubst.mk_meta ~name m context (`WithType ty)in + let m,_,i,_= + NCicMetaSubst.mk_meta ~name m context (`WithType ty)in let t = NCicSubstitution.subst i t in aux () (m, (i,bo)::l) t | t -> NCicUntrusted.map_term_fold_a (fun _ () -> ()) () aux acc t