aboutsummaryrefslogtreecommitdiffhomepage
path: root/proofs/proof_type.ml
blob: 3d599cc48530a1daf3656b2f33a1ee2e54aca1bf (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
(***********************************************************************)
(*  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       *)
(***********************************************************************)

(*i $Id$ *)

(*i*)
open Environ
open Evd
open Names
open Libnames
open Term
open Util
open Tacexpr
open Rawterm
open Genarg
(*i*)

(* This module defines the structure of proof tree and the tactic type. So, it
   is used by Proof_tree and Refiner *)

type pf_status =
  | Complete_proof
  | Incomplete_proof

type prim_rule =
  | Intro of identifier
  | Intro_replacing of identifier
  | Cut of bool * identifier * types
  | FixRule of identifier * int * (identifier * int * constr) list
  | Cofix of identifier * (identifier * constr) list
  | Refine of constr
  | Convert_concl of types
  | Convert_hyp of named_declaration
  | Thin of identifier list
  | ThinBody of identifier list
  | Move of bool * identifier * identifier
  | Rename of identifier * identifier


(* Signature useful to define the tactic type *)
type 'a sigma = { 
  it : 'a ; 
  sigma : evar_map }

(*s Proof trees. 
  [ref] = [None] if the goal has still to be proved, 
  and [Some (r,l)] if the rule [r] was applied to the goal
  and gave [l] as subproofs to be completed. 
  if [ref = (Some(Tactic (t,p),l))] then [p] is the proof 
  that the goal can be proven if the goals in [l] are solved. *)
type proof_tree = {
  status : pf_status;
  goal : goal;
  ref : (rule * proof_tree list) option }

and rule =
  | Prim of prim_rule
  | Tactic of tactic_expr * proof_tree
  | Change_evars

and goal = evar_info

and tactic = goal sigma -> (goal list sigma * validation)

and validation = (proof_tree list -> proof_tree)

and tactic_expr =
  (constr,
   Closure.evaluable_global_reference,
   inductive or_metanum,
   identifier)
     Tacexpr.gen_tactic_expr

and atomic_tactic_expr =
  (constr,
   Closure.evaluable_global_reference,
   inductive or_metanum,
   identifier)
     Tacexpr.gen_atomic_tactic_expr

and tactic_arg =
  (constr,
   Closure.evaluable_global_reference,
   inductive or_metanum,
   identifier)
     Tacexpr.gen_tactic_arg

type hyp_location = identifier Tacexpr.raw_hyp_location

type open_generic_argument =
    (constr,raw_tactic_expr) generic_argument
type closed_generic_argument =
    (constr,raw_tactic_expr) generic_argument

type 'a closed_abstract_argument_type =
    ('a,constr,raw_tactic_expr) abstract_argument_type

type declaration_hook = Libnames.strength -> global_reference -> unit