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