CicSubstitution.subst_vars exp_named_subst (type_of_variable uri)
| C.Meta (n,l) ->
(* Let's visit all the subterms that will not be visited later *)
CicSubstitution.subst_vars exp_named_subst (type_of_variable uri)
| C.Meta (n,l) ->
(* Let's visit all the subterms that will not be visited later *)
- let (_,canonical_context,_) =
- List.find (function (m,_,_) -> n = m) metasenv
- in
+ let (_,canonical_context,_) = CicUtil.lookup_meta n metasenv in
| _,_ -> assert false (* the term is not well typed!!! *)
) l lifted_canonical_context
in
| _,_ -> assert false (* the term is not well typed!!! *)
) l lifted_canonical_context
in
- let (_,canonical_context,ty) =
- List.find (function (m,_,_) -> n = m) metasenv
- in
+ let (_,canonical_context,ty) = CicUtil.lookup_meta n metasenv in
C.InductiveDefinition (tl,_,parsno) ->
let (_,_,_,cl) = List.nth tl i in (cl,parsno)
| _ ->
C.InductiveDefinition (tl,_,parsno) ->
let (_,_,_,cl) = List.nth tl i in (cl,parsno)
| _ ->
Cic.Constant (_,_,_,params)
| Cic.CurrentProof (_,_,_,_,params)
| Cic.Variable (_,_,_,params)
| Cic.InductiveDefinition (_,params,_) ->
List.map
(function uri ->
Cic.Constant (_,_,_,params)
| Cic.CurrentProof (_,_,_,_,params)
| Cic.Variable (_,_,_,params)
| Cic.InductiveDefinition (_,params,_) ->
List.map
(function uri ->
Cic.Variable (_,None,ty,_) -> uri,ty
| _ -> assert false (* the theorem is well-typed *)
) params
Cic.Variable (_,None,ty,_) -> uri,ty
| _ -> assert false (* the theorem is well-typed *)
) params