]> matita.cs.unibo.it Git - helm.git/blob - components/acic_content/content.mli
tagged 0.5.0-rc1
[helm.git] / components / acic_content / content.mli
1 (* Copyright (C) 2000, HELM Team.
2  * 
3  * This file is part of HELM, an Hypertextual, Electronic
4  * Library of Mathematics, developed at the Computer Science
5  * Department, University of Bologna, Italy.
6  * 
7  * HELM is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  * 
12  * HELM is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with HELM; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20  * MA  02111-1307, USA.
21  * 
22  * For details, see the HELM World-Wide-Web page,
23  * http://cs.unibo.it/helm/.
24  *)
25
26 type id = string;;
27 type joint_recursion_kind =
28  [ `Recursive of int list (* decreasing arguments *)
29  | `CoRecursive
30  | `Inductive of int    (* paramsno *)
31  | `CoInductive of int  (* paramsno *)
32  ]
33 ;;
34
35 type var_or_const = Var | Const;;
36
37 type 'term declaration =
38        { dec_name : string option;
39          dec_id : id ;
40          dec_inductive : bool;
41          dec_aref : string;
42          dec_type : 'term 
43        }
44 ;;
45
46 type 'term definition =
47        { def_name : string option;
48          def_id : id ;
49          def_aref : string ;
50          def_term : 'term ;
51          def_type : 'term 
52        }
53 ;;
54
55 type 'term inductive =
56        { inductive_id : id ;
57          inductive_name : string;
58          inductive_kind : bool;
59          inductive_type : 'term;
60          inductive_constructors : 'term declaration list
61        }
62 ;;
63
64 type 'term decl_context_element = 
65        [ `Declaration of 'term declaration
66        | `Hypothesis of 'term declaration
67        ]
68 ;;
69
70 type ('term,'proof) def_context_element = 
71        [ `Proof of 'proof
72        | `Definition of 'term definition
73        ]
74 ;;
75
76 type ('term,'proof) in_joint_context_element =
77        [ `Inductive of 'term inductive
78        | 'term decl_context_element
79        | ('term,'proof) def_context_element
80        ]
81 ;;
82
83 type ('term,'proof) joint =
84        { joint_id : id ;
85          joint_kind : joint_recursion_kind ;
86          joint_defs : ('term,'proof) in_joint_context_element list
87        }
88 ;;
89
90 type ('term,'proof) joint_context_element = 
91        [ `Joint of ('term,'proof) joint ]
92 ;;
93
94 type 'term proof = 
95       { proof_name : string option;
96         proof_id   : id ;
97         proof_context : 'term in_proof_context_element list ;
98         proof_apply_context: 'term proof list;
99         proof_conclude : 'term conclude_item
100       }
101
102 and 'term in_proof_context_element =
103        [ 'term decl_context_element
104        | ('term,'term proof) def_context_element 
105        | ('term,'term proof) joint_context_element
106        ]
107
108 and 'term conclude_item =
109        { conclude_id : id; 
110          conclude_aref : string;
111          conclude_method : string;
112          conclude_args : ('term arg) list ;
113          conclude_conclusion : 'term option 
114        }
115
116 and 'term arg =
117          Aux of string
118        | Premise of premise
119        | Lemma of lemma
120        | Term of bool * 'term (* inferrable, term *)
121        | ArgProof of 'term proof
122        | ArgMethod of string (* ???? *)
123
124 and premise =
125        { premise_id: id;
126          premise_xref : string ;
127          premise_binder : string option;
128          premise_n : int option;
129        }
130
131 and lemma =
132        { lemma_id: id;
133          lemma_name : string;
134          lemma_uri: string
135        }
136 ;;
137  
138 type 'term conjecture = id * int * 'term context * 'term
139
140 and 'term context = 'term hypothesis list
141
142 and 'term hypothesis =
143  ['term decl_context_element | ('term,'term proof) def_context_element ] option
144 ;;
145
146 type 'term in_object_context_element =
147        [ `Decl of var_or_const * 'term decl_context_element
148        | `Def of var_or_const * 'term * ('term,'term proof) def_context_element
149        | ('term,'term proof) joint_context_element
150        ]
151 ;;
152
153 type 'term cobj  = 
154         id *                            (* id *)
155         UriManager.uri list *           (* params *)
156         'term conjecture list option *  (* optional metasenv *) 
157         'term in_object_context_element (* actual object *)
158 ;;