]> matita.cs.unibo.it Git - helm.git/blob - helm/software/components/ng_refiner/nCicMetaSubst.mli
8f03ccb11110fcafb541995214572333e18cc4e5
[helm.git] / helm / software / components / ng_refiner / nCicMetaSubst.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 exception MetaSubstFailure of string Lazy.t
15 exception Uncertain of string Lazy.t
16
17 (*
18 exception AssertFailure of string Lazy.t
19 exception DeliftingARelWouldCaptureAFreeVariable;;
20 val apply_subst : Cic.substitution -> Cic.term -> Cic.term 
21 val apply_subst_context : Cic.substitution -> Cic.context -> Cic.context 
22 val apply_subst_metasenv: Cic.substitution -> Cic.metasenv -> Cic.metasenv 
23
24 (*** delifting ***)
25
26 val restrict :
27   Cic.substitution -> (int * int) list -> Cic.metasenv -> 
28   Cic.metasenv * Cic.substitution 
29 *)
30
31 (* the delift function takes in input a metavariable index, a local_context
32  * and a term t, and substitutes every Rel in t with its position in
33  * the local_context (which is the Rel moved to the canonical context).
34  * Typically, the list of optional terms is the explicit
35  * substitution that is applied to a metavariable occurrence and the result of
36  * the delift function is a term the implicit variable can be substituted with
37  * to make the term [t] unifiable with the metavariable occurrence.  In general,
38  * the problem is undecidable if we consider equivalence in place of alpha
39  * convertibility. Our implementation, though, is even weaker than alpha
40  * convertibility, since it replace the term [tk] if and only if [tk] is a Rel
41  * (missing all the other cases). Does this matter in practice?
42  * The metavariable index is the index of the metavariable that must not occur
43  * in the term (for occur check).
44  *)
45 val delift : 
46   NCic.metasenv -> NCic.substitution -> NCic.context -> 
47   int -> NCic.local_context -> NCic.term ->
48     (NCic.metasenv * NCic.substitution) * NCic.term
49