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