]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/cic_omdoc/content.ml
ocaml 3.09 transition
[helm.git] / helm / ocaml / cic_omdoc / content.ml
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 (**************************************************************************)
27 (*                                                                        *)
28 (*                           PROJECT HELM                                 *)
29 (*                                                                        *)
30 (*                Andrea Asperti <asperti@cs.unibo.it>                    *)
31 (*                             16/6/2003                                  *)
32 (*                                                                        *)
33 (**************************************************************************)
34
35 type id = string;;
36 type joint_recursion_kind =
37  [ `Recursive of int list
38  | `CoRecursive
39  | `Inductive of int    (* paramsno *)
40  | `CoInductive of int  (* paramsno *)
41  ]
42 ;;
43
44 type var_or_const = Var | Const;;
45
46 type 'term declaration =
47        { dec_name : string option;
48          dec_id : id ;
49          dec_inductive : bool;
50          dec_aref : string;
51          dec_type : 'term 
52        }
53 ;;
54
55 type 'term definition =
56        { def_name : string option;
57          def_id : id ;
58          def_aref : string ;
59          def_term : 'term 
60        }
61 ;;
62
63 type 'term inductive =
64        { inductive_id : id ;
65          inductive_name : string;
66          inductive_kind : bool;
67          inductive_type : 'term;
68          inductive_constructors : 'term declaration list
69        }
70 ;;
71
72 type 'term decl_context_element = 
73        [ `Declaration of 'term declaration
74        | `Hypothesis of 'term declaration
75        ]
76 ;;
77
78 type ('term,'proof) def_context_element = 
79        [ `Proof of 'proof
80        | `Definition of 'term definition
81        ]
82 ;;
83
84 type ('term,'proof) in_joint_context_element =
85        [ `Inductive of 'term inductive
86        | 'term decl_context_element
87        | ('term,'proof) def_context_element
88        ]
89 ;;
90
91 type ('term,'proof) joint =
92        { joint_id : id ;
93          joint_kind : joint_recursion_kind ;
94          joint_defs : ('term,'proof) in_joint_context_element list
95        }
96 ;;
97
98 type ('term,'proof) joint_context_element = 
99        [ `Joint of ('term,'proof) joint ]
100 ;;
101
102 type 'term proof = 
103       { proof_name : string option;
104         proof_id   : id ;
105         proof_context : 'term in_proof_context_element list ;
106         proof_apply_context: 'term proof list;
107         proof_conclude : 'term conclude_item
108       }
109
110 and 'term in_proof_context_element =
111        [ 'term decl_context_element
112        | ('term,'term proof) def_context_element
113        | ('term,'term proof) joint_context_element
114        ]
115
116 and 'term conclude_item =
117        { conclude_id : id; 
118          conclude_aref : string;
119          conclude_method : string;
120          conclude_args : ('term arg) list ;
121          conclude_conclusion : 'term option 
122        }
123
124 and 'term arg =
125          Aux of string
126        | Premise of premise
127        | Lemma of lemma
128        | Term of 'term
129        | ArgProof of 'term proof
130        | ArgMethod of string (* ???? *)
131
132 and premise =
133        { premise_id: id;
134          premise_xref : string ;
135          premise_binder : string option;
136          premise_n : int option;
137        }
138
139 and lemma =
140        { lemma_id: id;
141          lemma_name: string;
142          lemma_uri: string 
143        }
144
145 ;;
146  
147 type 'term conjecture = id * int * 'term context * 'term
148
149 and 'term context = 'term hypothesis list
150
151 and 'term hypothesis =
152  ['term decl_context_element | ('term,'term proof) def_context_element ] option
153 ;;
154
155 type 'term in_object_context_element =
156        [ `Decl of var_or_const * 'term decl_context_element
157        | `Def of var_or_const * 'term * ('term,'term proof) def_context_element
158        | ('term,'term proof) joint_context_element
159        ]
160 ;;
161
162 type 'term cobj  = 
163         id *                            (* id *)
164         UriManager.uri list *           (* params *)
165         'term conjecture list option *  (* optional metasenv *) 
166         'term in_object_context_element (* actual object *)
167 ;;