X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Flibrary%2FcoercDb.mli;h=83e61dbfba2f708097e12e7b04dcef6e6ffda710;hb=84e6cbe962c9a534be48542c098d7bb0d90be9a1;hp=3071aecc4eb724064849f21da4fc8bcc8314d099;hpb=5c1b44dfefa085fbb56e23047652d3650be9d855;p=helm.git diff --git a/helm/software/components/library/coercDb.mli b/helm/software/components/library/coercDb.mli index 3071aecc4..83e61dbfb 100644 --- a/helm/software/components/library/coercDb.mli +++ b/helm/software/components/library/coercDb.mli @@ -24,49 +24,44 @@ *) - (** THIS MODULE SHOULD BE USED ONLY BY CoercGraph/CicCoercion/librarySync - * - * and may be merged with CicCoercion... - * - * **) - - - (** XXX WARNING: non-reentrant *) -type coerc_carr = +type coerc_carr = private | Uri of UriManager.uri (* const, mutind, mutconstr *) | Sort of Cic.sort (* Prop, Set, Type *) - | Term of Cic.term (* nothing supported *) | Fun of int + | Dead ;; -exception EqCarrNotImplemented of string Lazy.t -exception EqCarrOnNonMetaClosed val eq_carr: ?exact:bool -> coerc_carr -> coerc_carr -> bool -val coerc_carr_of_term: Cic.term -> coerc_carr -val name_of_carr: coerc_carr -> string -val uri_of_carr: coerc_carr -> UriManager.uri option +val string_of_carr: coerc_carr -> string + +(* takes a term in whnf ~delta:false and a desired ariety *) +val coerc_carr_of_term: Cic.term -> int -> coerc_carr val to_list: unit -> - (coerc_carr * coerc_carr * (UriManager.uri * int) list) list + (coerc_carr * coerc_carr * (UriManager.uri * int * int) list) list type coerc_db +val empty_coerc_db : coerc_db val dump: unit -> coerc_db val restore: coerc_db -> unit -val add_coercion: - coerc_carr * coerc_carr * UriManager.uri * int -> unit +(* src carr, tgt carr, uri, saturations, coerced position + * invariant: + * if the constant pointed by uri has n argments + * n = coerced position + saturations + FunClass arity + *) -val remove_coercion: - (coerc_carr * coerc_carr * UriManager.uri * int -> bool) -> unit +type saturations = int +type coerced_pos = int +type coercion_entry = + coerc_carr * coerc_carr * UriManager.uri * saturations * coerced_pos +val add_coercion: coercion_entry -> unit +val remove_coercion: (coercion_entry -> bool) -> unit val find_coercion: (coerc_carr * coerc_carr -> bool) -> (UriManager.uri * int) list -val is_a_coercion: UriManager.uri -> bool -val is_a_coercion': Cic.term -> bool -val is_a_coercion_to_funclass: Cic.term -> int option -val get_carr: UriManager.uri -> coerc_carr * coerc_carr - -val term_of_carr: coerc_carr -> Cic.term +val is_a_coercion: Cic.term -> coercion_entry option +val prefer: UriManager.uri -> unit