package coq

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module SummarySource

This module registers the declaration of global tables, which will be kept in synchronization during the various backtracks of the system.

Sourcetype 'a summary_declaration = {
  1. freeze_function : marshallable:bool -> 'a;
    (*

    freeze_function true is for marshalling to disk. * e.g. lazy must be forced

    *)
  2. unfreeze_function : 'a -> unit;
  3. init_function : unit -> unit;
}

Types of global Coq states. The 'a type should be pure and marshallable by the standard OCaml marshalling function.

For tables registered during the launch of coqtop, the init_function will be run only once, during an init_summaries done at the end of coqtop initialization. For tables registered later (for instance during a plugin dynlink), init_function is used when unfreezing an earlier frozen state that doesn't contain any value for this table.

Beware: for tables registered dynamically after the initialization of Coq, their init functions may not be run immediately. It is hence the responsibility of plugins to initialize themselves properly.

Sourceval declare_summary : string -> 'a summary_declaration -> unit
Sourcemodule Dyn : Dyn.S

We provide safe projection from the summary to the types stored in it.

Sourceval declare_summary_tag : string -> 'a summary_declaration -> 'a Dyn.tag

All-in-one reference declaration + summary registration. It behaves just as OCaml's standard ref function, except that a declare_summary is done, with name as string. The init_function restores the reference to its initial value. The freeze_function can be overridden

Sourceval ref : ?freeze:(marshallable:bool -> 'a -> 'a) -> name:string -> 'a -> 'a ref
Sourceval ref_tag : ?freeze:(marshallable:bool -> 'a -> 'a) -> name:string -> 'a -> 'a ref * 'a Dyn.tag
Sourcemodule Local : sig ... end
Sourceval declare_ml_modules_summary : (string * string option) list summary_declaration -> unit

Special summary for ML modules. This summary entry is special because its unfreeze may load ML code and hence add summary entries. Thus is has to be recognizable, and handled properly.

For global tables registered statically before the end of coqtop launch, the following empty init_function could be used.

Sourceval nop : unit -> unit

The type frozen is a snapshot of the states of all the registered tables of the system.

Sourcetype frozen
Sourceval empty_frozen : frozen
Sourceval freeze_summaries : marshallable:bool -> frozen
Sourceval unfreeze_summaries : ?partial:bool -> frozen -> unit
Sourceval init_summaries : unit -> unit

Typed projection of the summary. Experimental API, use with CARE

Sourceval modify_summary : frozen -> 'a Dyn.tag -> 'a -> frozen
Sourceval project_from_summary : frozen -> 'a Dyn.tag -> 'a
Sourceval remove_from_summary : frozen -> 'a Dyn.tag -> frozen
Sourceval dump : unit -> (int * string) list

Debug

OCaml

Innovation. Community. Security.