]> matita.cs.unibo.it Git - helm.git/blob - components/ng_kernel/nCicSubstitution.mli
matita 0.5.1 tagged
[helm.git] / components / ng_kernel / nCicSubstitution.mli
1 (*
2     ||M||  This file is part of HELM, an Hypertextual, Electronic        
3     ||A||  Library of Mathematics, developed at the Computer Science     
4     ||T||  Department, University of Bologna, Italy.                     
5     ||I||                                                                
6     ||T||  HELM is free software; you can redistribute it and/or         
7     ||A||  modify it under the terms of the GNU General Public License   
8     \   /  version 2 or (at your option) any later version.      
9      \ /   This software is distributed as is, NO WARRANTY.     
10       V_______________________________________________________________ *)
11
12 (* $Id$ *)
13
14 (* lift n t                                                              *)
15 (*  lifts [t] of [n]                                                     *)
16 (*  [from] default 1, lifts only indexes >= [from]                       *)
17 (*  NOTE: the opposite function (delift_rels) is defined in CicMetaSubst *)
18 (*  since it needs to restrict the metavariables in case of failure      *)
19 val lift : ?from:int -> int -> NCic.term -> NCic.term
20
21 (* subst t1 t2                                                          *)
22 (*  substitutes [t1] for [Rel 1] in [t2]                                *)
23 (*  if avoid_beta_redexes is true (default: false) no new beta redexes  *)
24 (*  are generated. WARNING: the substitution can diverge when t2 is not *)
25 (*  well typed and avoid_beta_redexes is true.                          *)
26 val subst : ?avoid_beta_redexes:bool -> NCic.term -> NCic.term -> NCic.term
27
28 (* psubst [avoid] [delift] [lift_args] [t] [map_arg] [args]              
29  *  [avoid] : do not leave newly created beta-redexes, default false
30  *  [delift] : perform delifting
31  *  [t] : term to fill in
32  *  [lift_args] : lift argument after map_arg is applied
33  *  [args] : stuff to substitute
34  *  [map_arg] : map the argument to obtain a term
35  *    the function is ReductionStrategy.from_env_for_unwind when psubst is
36  *    used to implement nCicReduction.unwind'                              *)
37 val psubst : 
38   ?avoid_beta_redexes:bool ->  
39   ('a -> NCic.term) -> 'a list -> NCic.term -> 
40     NCic.term
41
42 (* subst_meta (n, Ctx [t_1 ; ... ; t_n]) t                                  *)
43 (*  returns the term [t] where [Rel i] is substituted with [t_i] lifted by n *)
44 (*  [t_i] is lifted as usual when it crosses an abstraction                  *)
45 (* subst_meta (n, Irl _) t -> lift n t                                        *)
46 val subst_meta : NCic.local_context -> NCic.term -> NCic.term
47