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