]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_refiner/nCicCoercion.mli
Don't reinvent the wheel.
[helm.git] / helm / software / components / ng_refiner / nCicCoercion.mli
index 73c88005c54e951385d127af692fcae23860bba8..ca65aa953b9edcdf2d6dd28782107d06e3d0cd66 100644 (file)
 
 type db
 
+class status :
+ object ('self)
+  method coerc_db: db
+  method set_coerc_db: db -> 'self
+  method set_coercion_status: <coerc_db: db; ..> -> 'self
+ end
+
+val empty_db: db
+
 (* index (\x.c ?? x ??): A -> B
    index_coercion db c A B \arity_left(c ??x??) \position(x,??x??) 
 *)
 val index_coercion: 
-  db -> NCic.term -> NCic.term -> NCic.term -> int -> int -> db
+  #status as 'status ->
+   NCic.term -> NCic.term -> NCic.term -> int -> int -> 'status
 
   (* gets the old imperative coercion DB (list format) *)
-val index_old_db: CoercDb.coerc_db -> db -> db
-
-val empty_db : db
+val index_old_db: CoercDb.coerc_db -> (#status as 'status) -> 'status
 
 val look_for_coercion:
-    db ->
+    #status ->
     NCic.metasenv -> NCic.substitution -> NCic.context -> 
     (* inferred type, expected type *)
     NCic.term -> NCic.term -> 
       (* enriched metasenv, new term, its type, metavriable to
        * be unified with the old term *)
       (NCic.metasenv * NCic.term * NCic.term * NCic.term) list
+
+(* returns (coercion,arity,arg) *)
+val match_coercion:
+ #status -> metasenv:NCic.metasenv -> subst:NCic.substitution ->
+  context:NCic.context -> NCic.term -> (NCic.term * int * int) option