]> matita.cs.unibo.it Git - helm.git/blob - matitaB/components/ng_kernel/nCicSubstitution.mli
9ba2d11fa55bb7e080361647861d35bebff558f1
[helm.git] / matitaB / 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 val lift_from : #NCic.status -> ?no_implicit:bool -> int -> int -> NCic.term -> NCic.term 
15
16 (* lift n t                                                              *)
17 (*  lifts [t] of [n]                                                     *)
18 (*  [from] default 1, lifts only indexes >= [from]                       *)
19 (*  NOTE: the opposite function (delift_rels) is defined in CicMetaSubst *)
20 (*  since it needs to restrict the metavariables in case of failure      *)
21 val lift : #NCic.status -> ?from:int -> ?no_implicit:bool -> int -> NCic.term -> NCic.term
22
23 (* subst t1 t2                                                          *)
24 (*  substitutes [t1] for [Rel 1] in [t2]                                *)
25 (*  if avoid_beta_redexes is true (default: false) no new beta redexes  *)
26 (*  are generated. WARNING: the substitution can diverge when t2 is not *)
27 (*  well typed and avoid_beta_redexes is true.                          *)
28 val subst : 
29   #NCic.status -> ?avoid_beta_redexes:bool -> ?no_implicit:bool -> 
30   NCic.term -> NCic.term -> NCic.term
31
32 (* psubst [avoid] [map_arg] [args] [t]            
33  *  [avoid] : do not leave newly created beta-redexes, default false
34  *  [t] : term to fill in
35  *  [args] : stuff to substitute
36  *  [map_arg] : map the argument to obtain a term
37  *    the function is ReductionStrategy.from_env_for_unwind when psubst is
38  *    used to implement nCicReduction.unwind'                              *)
39 val psubst : 
40   #NCic.status -> ?avoid_beta_redexes:bool -> ?no_implicit:bool ->
41   ('a -> NCic.term) -> 'a list -> NCic.term -> 
42     NCic.term
43
44 (* subst_meta (n, Ctx [t_1 ; ... ; t_n]) t                                  *)
45 (*  returns the term [t] where [Rel i] is substituted with [t_i] lifted by n *)
46 (*  [t_i] is lifted as usual when it crosses an abstraction                  *)
47 (* subst_meta (n, Irl _) t -> lift n t                                        *)
48 val subst_meta : #NCic.status -> NCic.local_context -> NCic.term -> NCic.term
49