Debian Codegraph @

tactics/gentactic.ml

raw symbols SCIP
1 (************************************************************************)
2 (* * The Coq Proof Assistant / The Coq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 open Names
12
13 type raw_generic_tactic = Genarg.raw_generic_argument
14
15 type glob_generic_tactic = Genarg.glob_generic_argument
16
17 let of_raw_genarg x = x
18
19 let to_raw_genarg x = x
20
21 let of_glob_genarg x = x
22
23 let print_raw = Pputils.pr_raw_generic
24
25 let print_glob = Pputils.pr_glb_generic
26
27 let subst = Gensubst.generic_substitute
28
29 let intern ?(strict=true) env ?(ltacvars=Id.Set.empty) v =
30 let ist = { (Genintern.empty_glob_sign ~strict env) with ltacvars } in
31 let _, v = Genintern.generic_intern ist v in
32 v
33
34 let interp ?(lfun=Id.Map.empty) v =
35 let open Geninterp in
36 let open Proofview.Notations in
37 Proofview.tclProofInfo[@ocaml.warning"-3"] >>= fun (_name, poly) ->
38 let ist = { lfun; poly; extra = TacStore.empty } in
39 let Genarg.GenArg (Glbwit tag, v) = v in
40 let v = Geninterp.interp tag ist v in
41 Ftactic.run v (fun _ -> Proofview.tclUNIT ())
42
43 let wit_generic_tactic = Genarg.make0 "generic_tactic"
44
45 let () =
46 let mkprint f v = Genprint.PrinterBasic (fun env sigma -> f env sigma v) in
47 Genprint.register_vernac_print0 wit_generic_tactic (mkprint (print_raw ?level:None));