Info on some coq packages.
hrel
: heterogeneous relationfun_hrel
: To make a value of refines
??computable_scope
notations with scope key C
.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:
n.-tuple -> Vector.t n -> Type
seqmx
in CoqEALRseqmx
: 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)
R spec impl
means
—
spec_of: impl -> spec -> Type
: type of specification functionsimpl_of: spec -> spec -> Type
: type of implementation functionsfun_hrel
fun_hrel
: forall A B : Type, (B -> A) -> A -> B -> Type
Like:
fun_hrel (A:=Spec) (B:=Impl): (Impl -> Spec) -> s -> i -> Type
Coq version of quickcheck
Show
instance for printing test cases
Combinators:
elems_
: Select from a list of values
elems
notation automatically generates the default value argumentoneOf_
: select from a list of generators
oneOf
freq_
: instruct qc to skew the distribution
nat
-value as associated weightfreq
listOf
: Get a list of random length from a generatorvectorOf
: Get a list of fixed length from a generatorchoose
: select a value from a given rangesample
: sample a generatorCheck 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:
HB.about
HB.check
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)
mixin: operator + properties
isFinite
)structure: carrier + mixin
(Canonical) Structure instance: Zmodule
factory
builder
abbreviation
https://coq.inria.fr/refman/using/tools/coqdoc.html
(** * Level 1
H1 size section. *)
(** ** Level 2
H2 size section. *)
Increase the number of asterisks accordingly.
Enclose between <<
and >>
.
Like,
<<
let rec fact n =
if n <= 1 then 1 else n * fact (n-1)
>>
Like,
caml expression: << fact (n-1) >>
View documentation of a word: C-c C-d
View code outline in a separate buffer: C-c C-, (M-x company-coq-occur)
Fold definition: C-c C-/
Unfold definition: C-c C-\
Make current goal a separate lemma: C-c C-a C-x
Go to definition of identifier if present: M-. (doesn't play well with evil-mode)
Insert a match case line: M-Ret
grep current word in current directory sub-tree: C-c C-&
Show diff of expected and actual types upon error: C-c C-a C-d
Compare with error messages in docs: C-c C-a C-e
Show/unshow definition of a name as an overlay: M-F12:
Show documentation for a term if available: Type its name (at least partially) and do C-h
mathcomp 2.0:
coq-ext-lib: has an hlist implementation
trocq: refinements, proof transfer
coinduction
param
CoRN
CoLoR
paramcoq:
Parametricity
vernacular command.Pretty output/interface:
Efforts have been made to augment Coq's stdlib. ʳ.
mathcomp has got a lot of stuff as well.
tactician enable
: makes ~/.coqrc file that always import tactician.opam install coq-tactician-stdlib
: Optional, recompiles standard library