Coq packages


Info on some coq packages.


CoqEAL

General

refines

refines: (A -> B -> Type) -> A -> B -> Type
         |              |
         +--------------+
            |
        refinement relation

From here:

Refinement relation:

(* Type of refinement relations *)
R: SpecT -> ImplT -> Type

Transport lemma:

R_op: refines refinement_relation Spec Impl

Example:

Definition tup2seq (n:nat)
  : n.-tuple bool -> seq bool -> Type :=
  fun btup bseq => tval btup = bseq.

(Pseudo-) examples:

Refinement relation for seqmx in CoqEAL

Rseqmx: https://github.com/coq-community/coqeal/blob/1.1.3/refinements/seqmx.v#L298

R ==> S (hrel)

If there are functions R: A -> B and S: A' -> B', then there exists a function (A -> A') -> (B -> B').

Notation for hrespectful R S.

From relscope.

R: A -> B -> Type
S: C -> D -> Type
f: A -> C
g: B -> D

is

R ==> S

which in turn is

hrespectful R S: (A->C) -> (B->D) -> Type :=

fun f g => forall (a:A) (b:B),
    R a b -> S (f a) (g b)

Guesses

R spec impl means

fun_hrel

fun_hrel
     : forall A B : Type, (B -> A) -> A -> B -> Type

Like:

fun_hrel (A:=Spec) (B:=Impl): (Impl -> Spec) -> s -> i -> Type

QuickChick

Coq version of quickcheck

Combinators:

Check choose (0,3).
(* choose (0, 3) : G nat *)

Check List.hd 5 (sample (choose (0,3))).
(* List.hd 5 (sample (choose (0, 3))) : nat *)

Check choose.
(* choose : BinNums.N * BinNums.N -> G BinNums.N *)

Typeclasses:

Links:

Hierarchy builder

General

HB.about isFinite.
(*
HB: isFinite is a factory (from "./fintype.v", line 161)

HB: isFinite operations and axioms are:
    - enum_subdef
    - enumP_subdef

HB: isFinite requires the following mixins:
    - hasDecEq

HB: isFinite provides the following mixins:
    - isFinite
*)

Links:

eta

From structures.v.

Notation "[ 'eta' f ]" := (fun x => f x) : fun_scope (default interpretation)

Core

coqdoc

https://coq.inria.fr/refman/using/tools/coqdoc.html

Sections

(** * Level 1

    H1 size section. *)

(** ** Level 2

    H2 size section. *)

Increase the number of asterisks accordingly.

Verbatim

Enclose between << and >>.

Multi-line

Like,

<<
  let rec fact n =
    if n <= 1 then 1 else n * fact (n-1)
>>

Inline

Like,

caml expression: << fact (n-1) >>

company-coq (emacs)

More packages

Better 'stdlib'

Efforts have been made to augment Coq's stdlib. ʳ.

mathcomp has got a lot of stuff as well.

SAT/SMT interfaces, AI, etc