aboutsummaryrefslogtreecommitdiffhomepage
path: root/library/decl_kinds.ml
blob: 10ae3d79b39b5970fc66683e7ee321cedda129ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
(***********************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team    *)
(* <O___,, *        INRIA-Rocquencourt  &  LRI-CNRS-Orsay              *)
(*   \VV/  *************************************************************)
(*    //   *      This file is distributed under the terms of the      *)
(*         *       GNU Lesser General Public License Version 2.1       *)
(***********************************************************************)

(* $Id$ *)

(* Informal mathematical status of declarations *)

(* Kinds used at parsing time *)

type theorem_kind =
  | Theorem
  | Lemma
  | Fact
  | Remark

type definitionkind =
  | LDefinition
  | GDefinition
  | LCoercion
  | GCoercion
  | LSubClass
  | GSubClass
  | SCanonical

type locality_flag = (*bool (* local = true; global = false *)*)
  | Local
  | Global

type strength = locality_flag (* For compatibility *)

type type_as_formula_kind = Definitional | Logical

(* [assumption_kind] 

                |  Local      | Global
   ------------------------------------
   Definitional |  Variable   | Parameter
   Logical      |  Hypothesis | Axiom
*)
type assumption_kind = locality_flag * type_as_formula_kind

type definition_kind = locality_flag

(* Kinds used in proofs *)

type global_goal_kind =
  | DefinitionBody
  | Proof of theorem_kind

type goal_kind =
  | IsGlobal of global_goal_kind
  | IsLocal

(* Kinds used in library *)

type local_theorem_kind = LocalStatement

type 'a mathematical_kind =
  | IsAssumption of type_as_formula_kind
  | IsDefinition
  | IsProof of 'a

type global_kind = theorem_kind mathematical_kind
type local_kind = local_theorem_kind mathematical_kind

(* Utils *)

let theorem_kind_of_goal_kind = function
  | DefinitionBody -> IsDefinition
  | Proof s -> IsProof s