package coq-core
Install
Dune Dependency
Authors
Maintainers
Sources
md5=13d2793fc6413aac5168822313e4864e
sha512=ec8379df34ba6e72bcf0218c66fef248b0e4c5c436fb3f2d7dd83a2c5f349dd0874a67484fcf9c0df3e5d5937d7ae2b2a79274725595b4b0065a381f70769b42
doc/ltac2_plugin/Ltac2_plugin/Tac2ffi/index.html
Module Ltac2_plugin.Tac2ffi
Source
Toplevel values
Dynamic semantics
Values are represented in a way similar to OCaml, i.e. they contrast immediate integers (integers, constructors without arguments) and structured blocks (tuples, arrays, constructors with arguments), as well as a few other base cases, namely closures, strings, named constructors, and dynamic type coming from the Coq implementation.
type valexpr =
| ValInt of int
(*Immediate integers
*)| ValBlk of tag * valexpr array
(*Structured blocks
*)| ValStr of Stdlib.Bytes.t
(*Strings
*)| ValCls of closure
(*Closures
*)| ValOpn of Names.KerName.t * valexpr array
(*Open constructors
*)| ValExt : 'a Tac2dyn.Val.tag * 'a -> valexpr
(*Arbitrary data
*)
The closure must not be already annotated
Ltac2 FFI
These functions allow to convert back and forth between OCaml and Ltac2 data representation. The to_*
functions raise an anomaly whenever the data has not expected shape.
Dynamic tags
Toplevel representation of OCaml exceptions. Invariant: no LtacError
should be put into a value with tag val_exn
.
Closures
Given a closure, apply it to some arguments. Handling of argument mismatches is done automatically, i.e. in case of over or under-application.
Composition of to_closure
and apply
Turn a fixed-arity function into a closure. The inner function is guaranteed to be applied to a list whose size is the integer argument.
Exception
Ltac2-defined exceptions seen from OCaml side