package lambdapi

  1. Overview
  2. Docs

Translate the parser-level AST to Coq.

There are two modes:

  • raw_coq mode (option -o raw_coq): translation of the AST as it is (lambdapi-calculus is a subset system of coq if we ignore rules)
  • stt_coq mode (option -o stt_coq): translation of the AST as an encoding in simple type theory.

The encoding can be specified through a lambdapi file (option --encoding).

In both modes, a renaming map can be provided to rename some identifiers.

The renaming map can be specified through a lambdapi file (option --renaming).

val log : 'a Lplib.Base.outfmt -> 'a

Symbols necessary to encode STT.

type builtin =
  1. | Set
  2. | Prop
  3. | Arr
  4. | El
  5. | Imp
  6. | All
  7. | Prf
  8. | Eq
  9. | Or
  10. | And
  11. | Ex
  12. | Not
val index_of_builtin : builtin -> int
val nb_builtins : int
val builtin_of_index : int -> builtin
val index_of_name : string -> int option
val name_of_index : int -> string
val builtin : Core.Term.qident array

Set renaming map from file.

val set_renaming : string -> unit

Set symbols whose declarations have to be erased.

module Qid : sig ... end
module QidMap : sig ... end
val map_erased_qid_coq : string QidMap.t ref
val set_erasing : string -> unit

Set encoding.

val map_qid_builtin : builtin QidMap.t ref
val set_encoding : string -> unit
val out : ('a, out_channel, unit) format -> 'a

Basic printing functions. We use Printf for efficiency reasons.

val char : out_channel -> char -> unit
val string : out_channel -> string -> unit
val prefix : string -> (out_channel -> 'a -> 'b) -> out_channel -> 'c -> 'd
val suffix : (out_channel -> 'a -> 'b) -> string -> out_channel -> 'c -> unit
val list : (out_channel -> 'a -> unit) -> string -> out_channel -> 'b list -> unit

Translation of identifiers.

val translate_ident : string -> string
val raw_ident : out_channel -> string -> unit
val ident : out_channel -> string Common.Pos.loc -> unit
val param_id : out_channel -> string Common.Pos.loc option -> unit
val param_ids : out_channel -> string Common.Pos.loc option list -> unit
val raw_path : out_channel -> string list -> unit
val path : out_channel -> string list Common.Pos.loc -> unit
val qident : out_channel -> (string list * string) Common.Pos.loc -> unit

Translation of terms.

val stt : bool ref
val use_implicits : bool ref
val use_notations : bool ref
val paren : out_channel -> Parsing.Syntax.p_term -> unit
val raw_params : out_channel -> Parsing.Syntax.p_params -> unit
val params : out_channel -> Parsing.Syntax.p_params -> unit
val params_list : out_channel -> Parsing.Syntax.p_params list -> unit
val params_list_in_abs : out_channel -> Parsing.Syntax.p_params list -> unit

Translation of commands.

Set Coq required file.

val require : string option ref
val set_requiring : string -> unit
val print : Parsing.Syntax.ast -> unit
OCaml

Innovation. Community. Security.