]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/library/coercDb.mli
librarian.ml: now the read_only .moo's are managed "correctly" (i.e. better than...
[helm.git] / helm / software / components / library / coercDb.mli
index 9e8bf5e9c03066cf219921ac66baaed7a96918d5..130987df84ae8badbe70efcdb1209e46c74ad570 100644 (file)
  *)
 
 
- (** THIS MODULE SHOULD BE USED ONLY BY CoercGraph/CicCoercion/librarySync
-  * 
-  *   and may be merged with CicCoercion...
-  *  
-  * **)
+type coerc_carr = private 
+  | Uri of UriManager.uri (* const, mutind, mutconstr *)
+  | Sort of Cic.sort (* Prop, Set, Type *) 
+  | Fun of int
+  | Dead
+;;
+  
+val eq_carr: ?exact:bool -> coerc_carr -> coerc_carr -> bool
+val string_of_carr: coerc_carr -> string
 
-
-  (** XXX WARNING: non-reentrant *)
-type coerc_carr = Uri of UriManager.uri | Sort of Cic.sort | Term of Cic.term
-exception EqCarrNotImplemented of string Lazy.t
-exception EqCarrOnNonMetaClosed
-val eq_carr: coerc_carr -> coerc_carr -> bool
-val coerc_carr_of_term: Cic.term -> coerc_carr
-val name_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) list
+    (coerc_carr * coerc_carr * (UriManager.uri * int * int) list) list
+
+type coerc_db
+val dump: unit -> coerc_db
+val restore: coerc_db -> unit
 
-val add_coercion:
-  coerc_carr * coerc_carr * UriManager.uri -> 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 -> 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 list 
+  (coerc_carr * coerc_carr -> bool) -> (UriManager.uri * int) list 
     
-val is_a_coercion: UriManager.uri -> bool
-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