X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fcic_unification%2FcicMkImplicit.ml;h=1817ac8613873ecd2276fae3da36f156d4afda7e;hb=39d3fb9782dd5580debfb1e53840906f158e7954;hp=6944a4fc210dfe1a68d016dcf513e5f4d9a86d09;hpb=7ea34971b64c60e5440bf2cc42cee560f6a86abe;p=helm.git diff --git a/helm/ocaml/cic_unification/cicMkImplicit.ml b/helm/ocaml/cic_unification/cicMkImplicit.ml index 6944a4fc2..1817ac861 100644 --- a/helm/ocaml/cic_unification/cicMkImplicit.ml +++ b/helm/ocaml/cic_unification/cicMkImplicit.ml @@ -3,7 +3,7 @@ (* returns the identity relocation list, which is the list [1 ; ... ; n] *) (* where n = List.length [canonical_context] *) (*CSC: ma mi basta la lunghezza del contesto canonico!!!*) -let identity_relocation_list_for_metavariable canonical_context = +let identity_relocation_list_for_metavariable ?(start = 1) canonical_context = let canonical_context_length = List.length canonical_context in let rec aux = function @@ -11,7 +11,7 @@ let identity_relocation_list_for_metavariable canonical_context = | (n,None::tl) -> None::(aux ((n+1),tl)) | (n,_::tl) -> (Some (Cic.Rel n))::(aux ((n+1),tl)) in - aux (1,canonical_context) + aux (start,canonical_context) (* Returns the first meta whose number is above the *) (* number of the higher meta. *) @@ -61,10 +61,6 @@ let fresh_subst metasenv context uris = (uri,Cic.Meta(newmeta+2,irl))::l in aux newmeta uris -let mk_implicit' metasenv context = - let (metasenv, index) = mk_implicit metasenv context in - (metasenv, index - 1, index) - let mk_implicit_type metasenv context = let newmeta = new_meta metasenv in let irl = identity_relocation_list_for_metavariable context in @@ -92,9 +88,9 @@ let expand_implicits metasenv context term = let metasenv', l' = do_local_context metasenv context l in metasenv', Cic.Meta (n, l') | Cic.Implicit -> - let (metasenv', type_index, _) = mk_implicit' metasenv context in + let (metasenv', idx) = mk_implicit metasenv context in let irl = identity_relocation_list_for_metavariable context in - metasenv', Cic.Meta (type_index, irl) + metasenv', Cic.Meta (idx, irl) | Cic.Cast (te, ty) -> let metasenv', ty' = aux metasenv context ty in let metasenv'', te' = aux metasenv' context te in @@ -149,7 +145,6 @@ let expand_implicits metasenv context term = (new_metasenv, (name, new_type) :: types)) funs (metasenv, []) in -List.iter (fun (_, t) -> assert (t <> Cic.Implicit)) types; let context' = (List.rev_map (fun (name, t) -> Some (Cic.Name name, Cic.Decl t))