X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matitaB%2Fcomponents%2Fng_paramodulation%2FnCicBlob.ml;h=59d57a854806aafe016d8a0ab8c56bebd09b1889;hb=9aa2722ff4aa7868ffd14e5a820cd6dc79e2c8a6;hp=14454c58b2b0c571a9fe7d62a0095f32d8a09d7c;hpb=4f3b04e9966484011328d5b0eb358da4416e29b0;p=helm.git diff --git a/matitaB/components/ng_paramodulation/nCicBlob.ml b/matitaB/components/ng_paramodulation/nCicBlob.ml index 14454c58b..59d57a854 100644 --- a/matitaB/components/ng_paramodulation/nCicBlob.ml +++ b/matitaB/components/ng_paramodulation/nCicBlob.ml @@ -84,6 +84,20 @@ with type t = NCic.term and type input = NCic.term = struct ;; + let rec alpha_norm k = function + | NCic.Lambda (_,ty,t) -> + NCic.Lambda("_",alpha_norm k ty,alpha_norm k t) + | NCic.Prod (_,ty,t) -> + NCic.Prod("_",alpha_norm k ty,alpha_norm k t) + | NCic.LetIn (_,ty,t,b) -> + NCic.LetIn("_",alpha_norm k ty,alpha_norm k t,alpha_norm k b) + | NCic.Meta (_,(_,NCic.Irl _)) as t -> t + | NCic.Meta (n,(s,NCic.Ctx tl)) as t -> + let tl' = HExtlib.sharing_map (alpha_norm k) tl in + if tl == tl' then t else NCic.Meta (n,(s,NCic.Ctx tl')) + | t -> NCicUtils.map ~hbr:false (new NCicPp.status None) + (fun _ _ -> ()) () alpha_norm t + (* let compare x y = (* CSC: NCicPp.status is the best I can put here *) (* WR: and I can't guess a user id, so I must put None *) @@ -122,7 +136,7 @@ with type t = NCic.term and type input = NCic.term = struct let res,vars = List.fold_left (fun (r,v) t -> let r1,v1 = embed t in (r1::r),aux [] v v1) ([],[]) l in (Terms.Node (List.rev res)), vars - | t -> Terms.Leaf t, [] + | t -> Terms.Leaf (alpha_norm () t), [] ;; let embed t = fst (embed t) ;;