2
(* File to include to get some Coq facilities under the ocaml toplevel.
3
This file is loaded by include *)
8
#directory "toplevel";;
11
#directory "pretyping";;
14
#directory "tactics";;
15
#directory "translate";;
17
#directory "+camlp4";; (* lazy solution: add both of camlp4/5 so that *)
18
#directory "+camlp5";; (* Gramext is found in top_printers.ml *)
20
#use "top_printers.ml";;
21
#use "vm_printers.ml";;
23
#install_printer (* identifier *) ppid;;
24
#install_printer (* identifier *) ppidset;;
25
#install_printer (* Intset.t *) ppintset;;
26
#install_printer (* label *) pplab;;
27
#install_printer (* mod_self_id *) ppmsid;;
28
#install_printer (* mod_bound_id *) ppmbid;;
29
#install_printer (* dir_path *) ppdir;;
30
#install_printer (* module_path *) ppmp;;
31
#install_printer (* section_path *) ppsp;;
32
#install_printer (* qualid *) ppqualid;;
33
#install_printer (* kernel_name *) ppkn;;
34
#install_printer (* constant *) ppcon;;
35
#install_printer (* cl_index *) ppclindex;;
36
#install_printer (* constr *) print_pure_constr;;
37
#install_printer (* patch *) ppripos;;
38
#install_printer (* values *) ppvalues;;
39
#install_printer (* Idpred.t *) pp_idpred;;
40
#install_printer (* Cpred.t *) pp_cpred;;
41
#install_printer (* transparent_state *) pp_transparent_state;;
42
#install_printer ppzipper;;
43
#install_printer ppstack;;
44
#install_printer ppatom;;
45
#install_printer ppwhd;;
46
#install_printer ppvblock;;
47
#install_printer (* bigint *) ppbigint;;
48
#install_printer (* loc *) pploc;;
49
#install_printer (* substitution *) prsubst;;
75
open Pretyping.Default
76
open Pretyping.Default.Cases
118
open Decl_proof_instr
156
(* Various utilities *)
158
let qid = Libnames.qualid_of_string;;
160
(* parsing of terms *)
162
let parse_constr = Pcoq.parse_string Pcoq.Constr.constr;;
163
let parse_tac = Pcoq.parse_string Pcoq.Tactic.tactic;;
164
let parse_vernac = Pcoq.parse_string Pcoq.Vernac_.vernac;;
166
(* build a term of type rawconstr without type-checking or resolution of
170
Constrintern.intern_constr Evd.empty (Global.env()) (parse_constr s);;
172
(* build a term of type constr with type-checking and resolution of
175
let constr_of_string s =
176
Constrintern.interp_constr Evd.empty (Global.env()) (parse_constr s);;
178
(* get the body of a constant *)
182
let constbody_of_string s =
183
let b = Global.lookup_constant (Nametab.locate_constant (qualid_of_sp (path_of_string s))) in
184
Option.get b.const_body;;
186
(* Get the current goal *)
188
let getgoal x = top_goal_of_pftreestate (Pfedit.get_pftreestate x);;
190
let get_nth_goal n = nth_goal_of_pftreestate n (Pfedit.get_pftreestate ());;
191
let current_goal () = get_nth_goal 1;;
194
Constrintern.interp_constr (project gl) (pf_env gl) (parse_constr s);;