]> matita.cs.unibo.it Git - helm.git/blob - helm/software/components/ng_refiner/nCicCoercion.mli
0f514eef69ba86ed9dd33c245852f9c37f0b6780
[helm.git] / helm / software / components / ng_refiner / nCicCoercion.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: nCicRefiner.mli 9227 2008-11-21 16:00:06Z tassi $ *)
13
14 type db
15
16 class type g_status =
17  object
18   inherit NCicUnifHint.g_status
19   method coerc_db: db
20  end
21
22 class status :
23  object ('self)
24   inherit NCicUnifHint.status
25   inherit g_status
26   method coerc_db: db
27   method set_coerc_db: db -> 'self
28   method set_coercion_status: #g_status -> 'self
29  end
30
31 val empty_db: db
32
33 (* index (\x.c ?? x ??): A -> B
34    index_coercion db c A B \arity_left(c ??x??) \position(x,??x??) 
35 *)
36 val index_coercion: 
37   #status as 'status -> string ->
38    NCic.term -> NCic.term -> NCic.term -> int -> int -> 'status
39
40   (* gets the old imperative coercion DB (list format) *)
41 val index_old_db: CoercDb.coerc_db -> (#status as 'status) -> 'status
42
43 val look_for_coercion:
44     #status ->
45     NCic.metasenv -> NCic.substitution -> NCic.context -> 
46     (* inferred type, expected type *)
47     NCic.term -> NCic.term -> 
48       (* name, enriched metasenv, new term, its type, metavriable to
49        * be unified with the old term *)
50       (string * NCic.metasenv * NCic.term * NCic.term * NCic.term) list
51
52 (* returns (coercion,arity,arg) *)
53 val match_coercion:
54  #status -> metasenv:NCic.metasenv -> subst:NCic.substitution ->
55   context:NCic.context -> NCic.term -> (NCic.term * int * int) option
56
57 val generate_dot_file: #status -> Format.formatter -> unit