X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_refiner%2FnCicMetaSubst.mli;h=7bde2c1d6b2c7ea95e1a54ebd0c2d83880bae59f;hb=c22f39a5d5afc0ef55beb221e00e2e6703b13d90;hp=e03180564debb0d880ae0339e2301e43cf51cff7;hpb=c5b3da2ed2b2dafd22cc50edb4ac5f1d402dfa94;p=helm.git diff --git a/helm/software/components/ng_refiner/nCicMetaSubst.mli b/helm/software/components/ng_refiner/nCicMetaSubst.mli index e03180564..7bde2c1d6 100644 --- a/helm/software/components/ng_refiner/nCicMetaSubst.mli +++ b/helm/software/components/ng_refiner/nCicMetaSubst.mli @@ -11,80 +11,55 @@ (* $Id$ *) -(* - exception MetaSubstFailure of string Lazy.t exception Uncertain of string Lazy.t -exception AssertFailure of string Lazy.t -exception DeliftingARelWouldCaptureAFreeVariable;; - -(* The entry (i,t) in a substitution means that *) -(* (META i) have been instantiated with t. *) -(* type substitution = (int * (Cic.context * Cic.term)) list *) - - (** @raise SubstNotFound *) - -(* apply_subst subst t *) -(* applies the substitution [subst] to [t] *) -(* [subst] must be already unwinded *) - -val apply_subst : Cic.substitution -> Cic.term -> Cic.term -val apply_subst_context : Cic.substitution -> Cic.context -> Cic.context -val apply_subst_metasenv: Cic.substitution -> Cic.metasenv -> Cic.metasenv -(*** delifting ***) +(* the index of the last created meta *) +val maxmeta: unit -> int +(* the delift function takes in input a metavariable index, a local_context + * and a term t, and substitutes every subterm t' of t with its position + * (searched up-to unification) in + * the local_context (which is the Rel moved to the canonical context). + * Typically, the list of optional terms is the explicit + * substitution that is applied to a metavariable occurrence and the result of + * the delift function is a term the implicit variable can be substituted with + * to make the term [t] unifiable with the metavariable occurrence. In general, + * the problem is undecidable if we consider equivalence in place of alpha + * convertibility. Our implementation, though, is even weaker than alpha + * convertibility, since it replace the term [tk] if and only if [tk] is a Rel + * (missing all the other cases). Does this matter in practice? + * The metavariable index is the index of the metavariable that must not occur + * in the term (for occur check). + *) val delift : - int -> Cic.substitution -> Cic.context -> Cic.metasenv -> - (Cic.term option) list -> Cic.term -> - Cic.term * Cic.metasenv * Cic.substitution -val restrict : - Cic.substitution -> (int * int) list -> Cic.metasenv -> - Cic.metasenv * Cic.substitution + unify:(NCic.metasenv -> NCic.substitution -> NCic.context -> + NCic.term -> NCic.term -> (NCic.metasenv * NCic.substitution) option) -> + NCic.metasenv -> NCic.substitution -> NCic.context -> + int -> NCic.local_context -> NCic.term -> + (NCic.metasenv * NCic.substitution) * NCic.term -(** delifts the Rels in t of n - * @raise DeliftingARelWouldCaptureAFreeVariable - *) -val delift_rels : - Cic.substitution -> Cic.metasenv -> int -> Cic.term -> - Cic.term * Cic.substitution * Cic.metasenv - -(** {2 Pretty printers} *) -val use_low_level_ppterm_in_context : bool ref -val set_ppterm_in_context : - (metasenv:Cic.metasenv -> Cic.substitution -> Cic.term -> Cic.context -> - string) -> unit +val restrict: + NCic.metasenv -> + NCic.substitution -> + int -> int list -> NCic.metasenv * NCic.substitution * int -val ppsubst_unfolded: metasenv:Cic.metasenv -> Cic.substitution -> string -val ppsubst: metasenv:Cic.metasenv -> Cic.substitution -> string -val ppterm: metasenv:Cic.metasenv -> Cic.substitution -> Cic.term -> string -val ppcontext: - metasenv:Cic.metasenv -> ?sep: string -> Cic.substitution -> Cic.context -> - string -val ppterm_in_name_context: - metasenv:Cic.metasenv -> Cic.substitution -> Cic.term -> - (Cic.name option) list -> string -val ppterm_in_context: - metasenv:Cic.metasenv -> Cic.substitution -> Cic.term -> Cic.context -> string -val ppmetasenv: ?sep: string -> Cic.substitution -> Cic.metasenv -> string +(* bool = true if the type of the new meta is closed *) +val mk_meta: + ?name:string -> + NCic.metasenv -> NCic.context -> + [ `WithType of NCic.term | `Term | `Type | `Sort ] -> + NCic.metasenv * int * NCic.term * NCic.term (* menv,metano,instance,type *) -(** {2 Format-like pretty printers} - * As above with prototypes suitable for toplevel/ocamldebug printers. No - * subsitutions are applied here since such printers are required to be invoked - * with only one argument. - *) +(* returns the resulting type, the metasenv and the arguments *) +val saturate: + ?delta:int -> NCic.metasenv -> NCic.substitution -> + NCic.context -> NCic.term -> int -> + NCic.term * NCic.metasenv * NCic.term list -val fppsubst: Format.formatter -> Cic.substitution -> unit -val fppterm: Format.formatter -> Cic.term -> unit -val fppmetasenv: Format.formatter -> Cic.metasenv -> unit - -(* -(* DEBUG *) -val print_counters: unit -> unit -val reset_counters: unit -> unit -*) +val flexible: NCic.substitution -> NCic.term list -> bool -(* val clean_up_meta : - Cic.substitution -> Cic.metasenv -> Cic.term -> Cic.term -*) -*) +val in_scope_tag : string +val out_scope_tag : int -> string +val is_out_scope_tag : string -> bool +val int_of_out_scope_tag : string -> int