package coq-core
Install
Dune Dependency
Authors
Maintainers
Sources
md5=66e57ea55275903bef74d5bf36fbe0f1
sha512=1a7eac6e2f58724a3f9d68bbb321e4cfe963ba1a5551b9b011db4b3f559c79be433d810ff262593d753770ee41ea68fbd6a60daa1e2319ea00dff64c8851d70b
doc/ltac2_plugin/Ltac2_plugin/Tac2externals/index.html
Module Ltac2_plugin.Tac2externals
Source
Interface for defining external tactics via a high-level spec.
Type ('v,'f) spec
represents a high-level Ltac2 tactic specification. It indicates how to turn a value of type 'f
into an Ltac2 tactic, which may involve converting between OCaml and Ltac2 value representations, and also lifting a pure function to the tactic monad. The type parameter 'v
gives the type of value produced by interpreting the specification.
tac r
is the specification of a tactic (in the tactic monad sense) whose return type is specified (and converted into an Ltac2 value) via r
.
val tac' :
('r -> Tac2val.valexpr) ->
(Tac2val.valexpr Proofview.tactic, 'r Proofview.tactic) spec
tac'
is similar to tac
, but only needs a conversion function.
ret r
is the specification of a pure tactic (i.e., a tactic defined as a pure OCaml value, not needing the tactic monad) whose return type is given by r
(see tac
).
ret'
is similar to ret
, but only needs a conversion function.
val eret :
'r Tac2ffi.repr ->
(Tac2val.valexpr Proofview.tactic, Environ.env -> Evd.evar_map -> 'r) spec
eret
is similar to ret
, but for tactics that can be implemented with a pure OCaml value, provided extra arguments env
and sigma
, computed via tclENV
and tclEVARMAP
.
val eret' :
('r -> Tac2val.valexpr) ->
(Tac2val.valexpr Proofview.tactic, Environ.env -> Evd.evar_map -> 'r) spec
eret'
is similar to eret
, but only needs a conversion function.
gret
is similar to ret
, but for tactics that can be implemented with a pure OCaml value, provided the current goal g
as extra argument. A fatal error is produced when there is not exactly one goal in focus at the point of using an Ltac2 value defined with this specification. Indeed, the value of g
is computed using Goal.enter_one
.
val gret' :
('r -> Tac2val.valexpr) ->
(Tac2val.valexpr Proofview.tactic, Proofview.Goal.t -> 'r) spec
gret'
is similar to gret
, but only needs a conversion function.
r @-> s
extends the specification s
with a closure argument whose type is specified by (and converted from an Ltac2 value via) r
.
val (@-->) :
(Tac2val.valexpr -> 'a) ->
('t, 'f) spec ->
(Tac2val.valexpr -> 't, 'a -> 'f) spec
(@-->)
is similar to (@->)
, but only needs a conversion function.
define tac s f
defines an external tactic tac
by interpreting f
with the specification s
. The Invalid_argument
exception is raised when the given s
does not produce a "pure" tactic, that is, something that can be turned into an Ltac2 value (i.e., a closure, or a pure value).