Proof Assistant Projects
Collection
Digesting proof assistant libraries for AI ingestion.
•
84 items
•
Updated
•
2
fact
stringlengths 9
2.92k
| type
stringclasses 20
values | library
stringclasses 6
values | imports
listlengths 1
4
| filename
stringclasses 63
values | symbolic_name
stringlengths 1
35
| docstring
stringclasses 1
value |
|---|---|---|---|---|---|---|
option_mul {T : Mul.type} (o1 o2 : option T) : option T := match o1, o2 with | Some n, Some m => Some (mul n m) | _, _ => None end. HB.instance Definition _ (T : Mul.type) := HasMul.Build (option T) option_mul.
|
Definition
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
option_mul
| |
option_square {T : Sq.type} (o : option T) : option T := match o with | Some n => Some (sq n) | None => None end. HB.instance Definition _ (T : Sq.type) := HasSq.Build (option T) option_square. (* Now we mix the two unrelated structures by building Sq out of Mul. *** This breaks Non Forgetful Inheritance *** https://math-comp.github.io/competing-inheritance-paths-in-dependent-type-theory/ *) #[non_forgetful_inheritance] HB.instance Definition _ (T : Mul.type) := HasSq.Build T (fun x => mul x x). (* As we expect we can proved this (by reflexivity) *)
|
Definition
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
option_square
| |
sq_mul (V : Mul.type) (v : V) : sq v = mul v v. Proof. by reflexivity. Qed.
|
Lemma
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
sq_mul
| |
problem (W : Mul.type) (w : option W) : sq w = mul w w. Proof. Fail reflexivity. (* What? It used to work! *) Fail rewrite sq_mul. (* Lemmas don't cross the container either! *) (* Let's investigate *) rewrite /mul/= /sq/=. (* As we expect, we are on the option type. In the LHS it is the Sq built using the NFI instance option_square w = option_mul w w *) rewrite /option_mul/=. rewrite /option_square/sq/=. congr (match w with Some n => _ | None => None end). (* The branches for Some differ, since w is a variable, they don't compare as equal (fun n : W => Some (mul n n)) = (fun n : W => match w with | Some m => Some (mul n m) | None => None end) *) Abort.
|
Lemma
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
problem
| |
option_mul {T : Mul.type} (o1 o2 : option T) : option T := match o1, o2 with | Some n, Some m => Some (mul n m) | _, _ => None end. HB.instance Definition _ (T : Mul.type) := HasMul.Build (option T) option_mul.
|
Definition
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
option_mul
| |
option_square {T : Sq.type} (o : option T) : option T := match o with | Some n => Some (sq n) | None => None end.
|
Definition
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
option_square
| |
option_sq_mul {T : Sq.type} (o : option T) : option_square o = mul o o. Proof. by rewrite /option_square; case: o => [x|//]; rewrite sq_mul. Qed. HB.instance Definition _ (T : Sq.type) := HasSq.Build (option T) option_square option_sq_mul.
|
Lemma
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
option_sq_mul
| |
problem (W : Sq.type) (w : option W) : sq w = mul w w. Proof. by rewrite sq_mul. Qed.
|
Lemma
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
problem
| |
link {xT T : Type} {f : xT -> T} {g : T -> xT} (canfg : forall x, f (g x) = x) := T. (* (link canfg) is convertible to T *) (* We explain HB how to transfer Equality over link *)
|
Definition
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
link
| |
link_eqtest (x y : T) : bool := eqtest (g x) (g y).
|
Definition
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
link_eqtest
| |
link_eqOK (x y : T) : reflect (x = y) (link_eqtest x y). Proof. rewrite /link_eqtest; case: (eqOK (g x) (g y)) => [E|abs]. by constructor; rewrite -[x]canfg -[y]canfg E canfg. by constructor=> /(f_equal g)/abs. Qed. (* (link canfg) is now an Equality instance *) HB.instance Definition link_HasEqDec := HasEqDec.Build (link canfg) link_eqtest link_eqOK.
|
Lemma
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
link_eqOK
| |
link_def : link canfg := f def.
|
Definition
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
link_def
| |
link_all_def x : eqtest x link_def = true. Proof. rewrite /link_def; have /eqOK <- := all_def (g x). by rewrite canfg; case: (eqOK x x). Qed. (* (link canfg) is now a Signleton instance *) HB.instance Definition _ := IsContractible.Build (link canfg) link_def link_all_def.
|
Lemma
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
link_all_def
| |
B : Type.
|
Axiom
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
B
| |
testB : B -> B -> bool.
|
Axiom
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
testB
| |
testOKB : forall x y, reflect (x = y) (testB x y). HB.instance Definition _ := HasEqDec.Build B testB testOKB.
|
Axiom
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
testOKB
| |
defB : B.
|
Axiom
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
defB
| |
all_defB : forall x, eqtest x defB = true. HB.instance Definition _ := IsContractible.Build B defB all_defB. (* Now we copy all instances from B to A via link *)
|
Axiom
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
all_defB
| |
A : Type.
|
Axiom
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
A
| |
f : B -> A.
|
Axiom
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
f
| |
g : A -> B.
|
Axiom
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
g
| |
canfg : forall x, f (g x) = x. (* We take all the instances up to Singleton on (link canfg) and we copy them on A. Recall (link canfg) is convertible to A *) HB.instance Definition _ := Singleton.copy A (link canfg). HB.about A. (* both Equality and Singleton have been copied *)
|
Axiom
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
canfg
| |
new_concept := 999999.
|
Definition
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
new_concept
| |
test x : new_concept ^ x ^ new_concept = x ^ new_concept ^ new_concept. Proof. (* this goal is not trivial, and maybe even false, but you may call some automation on it anyway *) Time Fail reflexivity. (* takes 7s, note that both by and // call reflexivity *) Abort.
|
Lemma
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
test
| |
test x : new_concept ^ x ^ new_concept = x ^ new_concept ^ new_concept. Time Fail reflexivity. (* takes 0s *) rewrite new_concept.unlock. Time Fail reflexivity. (* takes 7s, the original body is restored *) Abort. Print Module Type new_concept_Locked. Print Module new_concept. (*
|
Lemma
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
test
| |
body : nat.
|
Parameter
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
body
| |
unlock : body = 999999
|
Parameter
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
unlock
| |
new_concept := new_concept.body *)
|
Notation
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
new_concept
| |
unlock_new_concept := Unlockable new_concept.unlock.
|
Canonical
|
examples
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
examples/hulk.v
|
unlock_new_concept
| |
example (G : AbelianGrp.type) (x : G) : x + (- x) = - 0. Proof. by rewrite addrC addNr -[LHS](addNr zero) addrC add0r. Qed.
|
Lemma
|
examples
|
[
"From HB Require Import structures.",
"From Corelib Require Import ssreflect BinNums IntDef."
] |
examples/readme.v
|
example
| |
Z_add_assoc : forall x y z, Z.add x (Z.add y z) = Z.add (Z.add x y) z.
|
Axiom
|
examples
|
[
"From HB Require Import structures.",
"From Corelib Require Import ssreflect BinNums IntDef."
] |
examples/readme.v
|
Z_add_assoc
| |
Z_add_comm : forall x y, Z.add x y = Z.add y x.
|
Axiom
|
examples
|
[
"From HB Require Import structures.",
"From Corelib Require Import ssreflect BinNums IntDef."
] |
examples/readme.v
|
Z_add_comm
| |
Z_add_0_l : forall x, Z.add Z0 x = x.
|
Axiom
|
examples
|
[
"From HB Require Import structures.",
"From Corelib Require Import ssreflect BinNums IntDef."
] |
examples/readme.v
|
Z_add_0_l
| |
Z_add_opp_diag_l : forall x, Z.add (Z.opp x) x = Z0. HB.instance Definition Z_CoMoid := AddComoid_of_Type.Build Z Z0 Z.add Z_add_assoc Z_add_comm Z_add_0_l. HB.instance Definition Z_AbGrp := AbelianGrp_of_AddComoid.Build Z Z.opp Z_add_opp_diag_l.
|
Axiom
|
examples
|
[
"From HB Require Import structures.",
"From Corelib Require Import ssreflect BinNums IntDef."
] |
examples/readme.v
|
Z_add_opp_diag_l
| |
example2 (x : Z) : x + (- x) = - 0. Proof. by rewrite example. Qed. Check AbelianGrp.on Z. HB.graph "readme.dot". HB.about Z.
|
Lemma
|
examples
|
[
"From HB Require Import structures.",
"From Corelib Require Import ssreflect BinNums IntDef."
] |
examples/readme.v
|
example2
| |
Search Blacklist "Builders_".
|
Add
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
Search
| |
Search Blacklist "__canonical__".
|
Add
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
Search
| |
Search Blacklist "__to__".
|
Add
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
Search
| |
Search Blacklist "_between_".
|
Add
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
Search
| |
Search Blacklist "_mixin".
|
Add
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
Search
| |
error_msg := NoMsg | IsNotCanonicallyA (x : Type).
|
Variant
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
error_msg
| |
unify T1 T2 (t1 : T1) (t2 : T2) (s : error_msg) := phantom T1 t1 -> phantom T2 t2.
|
Definition
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
unify
| |
id_phant {T} {t : T} (x : phantom T t) := x.
|
Definition
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
id_phant
| |
id_phant_disabled {T T'} {t : T} {t' : T'} (x : phantom T t) := Phantom T' t'.
|
Definition
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
id_phant_disabled
| |
nomsg : error_msg := NoMsg.
|
Definition
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
nomsg
| |
is_not_canonically_a x := IsNotCanonicallyA x.
|
Definition
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
is_not_canonically_a
| |
new {T} (x : T) := x.
|
Definition
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
new
| |
eta {T} (x : T) := x.
|
Definition
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
eta
| |
ignore {T} (x: T) := x.
|
Definition
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
ignore
| |
ignore_disabled {T T'} (x : T) (x' : T') := x'. (* ********************* structures ****************************** *) From elpi Require Import elpi. Register unify as hb.unify. Register id_phant as hb.id. Register id_phant_disabled as hb.id_disabled. Register ignore as hb.ignore. Register ignore_disabled as hb.ignore_disabled. Register Coq.Init.Datatypes.None as hb.none. Register nomsg as hb.nomsg. Register is_not_canonically_a as hb.not_a_msg. Register Coq.Init.Datatypes.Some as hb.some. Register Coq.Init.Datatypes.pair as hb.pair. Register Coq.Init.Datatypes.prod as hb.prod. Register Coq.Init.Specif.sigT as hb.sigT. Register Coq.ssr.ssreflect.phant as hb.phant. Register Coq.ssr.ssreflect.Phant as hb.Phant. Register Coq.ssr.ssreflect.phantom as hb.phantom. Register Coq.ssr.ssreflect.Phantom as hb.Phantom. Register Coq.Init.Logic.eq as hb.eq. Register Coq.Init.Logic.eq_refl as hb.erefl. Register new as hb.new. Register eta as hb.eta. #[deprecated(since="HB 1.0.1", note="use #[key=...] instead")]
|
Definition
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
ignore_disabled
| |
indexed T := T (only parsing). Declare Scope HB_scope.
|
Notation
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
indexed
| |
aux_fact : .... HB.export aux_fact. ... HB.end. ...
|
Lemma
|
HB
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From elpi Require Import elpi.",
"From elpi.apps Require Import locker."
] |
HB/structures.v
|
aux_fact
| |
error_msg := NoMsg | IsNotCanonicallyA (x : Type).
|
Variant
|
shim
|
[
"From Coq Require Import String ssreflect ssrfun."
] |
shim/structures.v
|
error_msg
| |
unify T1 T2 (t1 : T1) (t2 : T2) (s : error_msg) := phantom T1 t1 -> phantom T2 t2.
|
Definition
|
shim
|
[
"From Coq Require Import String ssreflect ssrfun."
] |
shim/structures.v
|
unify
| |
id_phant {T} {t : T} (x : phantom T t) := x.
|
Definition
|
shim
|
[
"From Coq Require Import String ssreflect ssrfun."
] |
shim/structures.v
|
id_phant
| |
nomsg : error_msg := NoMsg.
|
Definition
|
shim
|
[
"From Coq Require Import String ssreflect ssrfun."
] |
shim/structures.v
|
nomsg
| |
is_not_canonically_a x := IsNotCanonicallyA x.
|
Definition
|
shim
|
[
"From Coq Require Import String ssreflect ssrfun."
] |
shim/structures.v
|
is_not_canonically_a
| |
new {T} (x : T) := x.
|
Definition
|
shim
|
[
"From Coq Require Import String ssreflect ssrfun."
] |
shim/structures.v
|
new
| |
eta {T} (x : T) := x.
|
Definition
|
shim
|
[
"From Coq Require Import String ssreflect ssrfun."
] |
shim/structures.v
|
eta
| |
testTy := A | B. HB.mixin Record Stack1 T := { prop1 : unit }. HB.structure Definition JustStack1 := { T of Stack1 T }. HB.mixin Record Stack1Param R T := { prop2 : unit }. HB.structure Definition JustStack1Param R := { T of Stack1Param R T }. HB.mixin Record Stack2 T := { prop3 : unit }. HB.structure Definition JustStack2 := { T of Stack2 T }. HB.mixin Record Mixed T of Stack1 T & Stack2 T := { prop4 : unit }. HB.structure Definition JustMixed := { T of Mixed T & Stack1 T & Stack2 T}. HB.structure Definition JustMixedParam R := { T of Mixed T & Stack1 T & Stack1Param R T & Stack2 T}. HB.instance Definition _ := @Stack1.Build testTy tt. HB.instance Definition _ := @Stack2.Build testTy tt. HB.instance Definition _ {R} := @Stack1Param.Build R testTy tt. HB.instance Definition _ := @Mixed.Build testTy tt. Check testTy : JustMixedParam.type _.
|
Variant
|
tests
|
[
"From HB Require Import structures."
] |
tests/bug_447.v
|
testTy
| |
unit' := unit. HB.instance Definition _ := isInhab.Build unit' tt. Check Inhab.of unit'. Fail Check Inhab.of unit. HB.instance Definition _ := Inhab.copy unit unit'. Check Inhab.of unit. (* with params *) HB.mixin Record isInhabIf (b : bool) (T : Type) := { y : forall ph : phant T, (match b with true => T | false => unit end) }. HB.structure Definition InhabIf b := { T of isInhabIf b T }.
|
Definition
|
tests
|
[
"From Coq Require Import ssreflect ssrfun ssrbool.",
"From HB Require Import structures."
] |
tests/class_for.v
|
unit'
| |
bool' := bool. HB.instance Definition _ := isInhabIf.Build true bool' (fun=> false). Check InhabIf.of bool'. Fail Check InhabIf.of bool. HB.instance Definition _ := InhabIf.copy bool bool'. Check InhabIf.of bool. Check (y (Phant bool) : bool).
|
Definition
|
tests
|
[
"From Coq Require Import ssreflect ssrfun ssrbool.",
"From HB Require Import structures."
] |
tests/class_for.v
|
bool'
| |
test := [the C.type _ _ of T].
|
Definition
|
tests
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From HB Require Import structures."
] |
tests/declare.v
|
test
| |
test2 := [the C.type _ _ of T].
|
Definition
|
tests
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From HB Require Import structures."
] |
tests/declare.v
|
test2
| |
copy : Type -> Type := id. HB.declare Context p T of hasABC p tt (copy T).
|
Definition
|
tests
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From HB Require Import structures."
] |
tests/declare.v
|
copy
| |
test3 := [the C.type _ _ of copy T].
|
Definition
|
tests
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From HB Require Import structures."
] |
tests/declare.v
|
test3
| |
comb A op := forall x : A, op (op x) = x. HB.mixin Record Foo A := { op : A -> A; ax : comb A op }. HB.structure Definition S1 := { A of Foo A }. Fail HB.structure Definition S2 := { A of Foo A }.
|
Definition
|
tests
|
[
"From HB Require Import structures."
] |
tests/duplicate_structure.v
|
comb
| |
x := (fun x : nat => true). HB.mixin Record m T := {x : T}. HB.factory Record f T := { x : T }. HB.builders Context T of f T. HB.instance Definition _ := m.Build T x. HB.end.
|
Notation
|
tests
|
[
"From HB Require Import structures."
] |
tests/factory_when_notation.v
|
x
| |
pred T := T -> bool. HB.mixin Record isPredNat (f : pred nat) := {}. HB.structure Definition PredNat := {f of isPredNat f}.
|
Definition
|
tests
|
[
"From HB Require Import structures."
] |
tests/grefclass.v
|
pred
| |
xxx := HB.pack_for AB.type T (hasB.Build T b) (hasA.Build T a). HB.instance Definition _ := AB.copy T xxx. HB.end. About hasAB.type. HB.factory Definition hasA' T := hasA T. About hasA'.type.
|
Definition
|
tests
|
[
"Require Import ssreflect ssrfun ssrbool.",
"From elpi Require Import elpi.",
"From HB Require Import structures."
] |
tests/hb_pack.v
|
xxx
| |
prop := Prop. HB.instance Definition Xprop := X_of_Type.Build prop. HB.instance Definition XSet := X_of_Type.Build Set.
|
Definition
|
tests
|
[
"From HB Require Import structures."
] |
tests/issue284.v
|
prop
| |
set := Set. HB.instance Definition Xset := X_of_Type.Build set. HB.instance Definition XType := X_of_Type.Build Type.
|
Definition
|
tests
|
[
"From HB Require Import structures."
] |
tests/issue284.v
|
set
| |
type := Type. HB.instance Definition Xtype := X_of_Type.Build type.
|
Definition
|
tests
|
[
"From HB Require Import structures."
] |
tests/issue284.v
|
type
| |
nat1 := nat. HB.lock Definition bar : nat1 := 3. HB.lock Definition baz n : nat := 3 + n.
|
Definition
|
tests
|
[
"From HB Require Import structures."
] |
tests/lock.v
|
nat1
| |
bigbody : Type -> Type -> Type.
|
Axiom
|
tests
|
[
"From HB Require Import structures."
] |
tests/lock.v
|
bigbody
| |
bigop : forall R I : Type, R -> list I -> (I -> bigbody R I) -> R. HB.lock Definition big := bigop.
|
Axiom
|
tests
|
[
"From HB Require Import structures."
] |
tests/lock.v
|
bigop
| |
A T := { a : T; f : T -> T; p : forall x : T, f x = x -> True; q : forall h : f a = a, p _ h = p _ h; }. HB.structure Definition S := { T of A T }. About A.p.
|
Record
|
tests
|
[
"From HB Require Import structures."
] |
tests/log_impargs_record.v
|
A
| |
option_mul {T : Mul.type} (o1 o2 : option T) : option T := match o1, o2 with | Some n, Some m => Some (mul n m) | _, _ => None end. HB.instance Definition _ (T : Mul.type) := HasMul.Build (option T) option_mul.
|
Definition
|
tests
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
tests/non_forgetful_inheritance.v
|
option_mul
| |
option_square {T : Sq.type} (o : option T) : option T := match o with | Some n => Some (sq n) | None => None end. HB.instance Definition _ (T : Sq.type) := HasSq.Build (option T) option_square. (* Now we mix the two unrelated structures by building Sq out of Mul. *** This breaks Forgetful Inheritance *** https://math-comp.github.io/competing-inheritance-paths-in-dependent-type-theory/ hence, HB prevents us from using it without care. *) Set Warnings "+HB.non-forgetful-inheritance". Fail HB.instance Definition _ (T : Mul.type) := HasSq.Build T (fun x => mul x x). (* As advised by the error message, we contain the problem in a module *)
|
Definition
|
tests
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
tests/non_forgetful_inheritance.v
|
option_square
| |
sq_mul (V : Mul.type) (v : V) : sq v = mul v v. Proof. by reflexivity. Qed.
|
Lemma
|
tests
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
tests/non_forgetful_inheritance.v
|
sq_mul
| |
problem (W : Mul.type) (w : option W) : sq w = mul w w. Proof. Fail reflexivity. (* What? It used to work! *) Fail rewrite sq_mul. (* Lemmas don't cross the container either! *) (* Let's investigate *) rewrite /mul/= /sq/=. (* As we expect, we are on the option type. In the LHS it is the Sq built using the NFI instance option_square w = option_mul w w *) rewrite /option_mul/=. rewrite /option_square/sq/=. congr (match w with Some n => _ | None => None end). (* The branches for Some differ, since w is a variable, they don't compare as equal (fun n : W => Some (mul n n)) = (fun n : W => match w with | Some m => Some (mul n m) | None => None end) *) Abort.
|
Lemma
|
tests
|
[
"From HB Require Import structures.",
"Require Import ssreflect ssrfun ssrbool."
] |
tests/non_forgetful_inheritance.v
|
problem
| |
to_AddComoid_of_TYPE := AddComoid_of_TYPE.Build A zero add addrA addrC add0r. HB.instance
|
Definition
|
tests
|
[
"From Coq Require Import ssreflect ssrfun.",
"From HB Require Import structures."
] |
tests/packable.v
|
to_AddComoid_of_TYPE
| |
to_Ring_of_AddComoid := Ring_of_AddComoid.Build A _ _ _ addNr mulrA mul1r mulr1 mulrDl mulrDr. HB.end. (* End change *) HB.structure Definition Ring := { A of Ring_of_TYPE A }.
|
Definition
|
tests
|
[
"From Coq Require Import ssreflect ssrfun.",
"From HB Require Import structures."
] |
tests/packable.v
|
to_Ring_of_AddComoid
| |
xxx := ABType T (hasB.Build T b) (hasA.Build T a). HB.instance Definition _ := AB.copy T xxx. HB.end. About hasAB.type. HB.factory Definition hasA' T := hasA T. About hasA'.type.
|
Definition
|
tests
|
[
"From Corelib Require Import ssreflect ssrfun.",
"From HB Require Import structures."
] |
tests/short.v
|
xxx
| |
pred T := T -> Prop. #[key="sub_sort"] HB.mixin Record is_SUB (T : Type) (P : pred T) (sub_sort : Type) := SubType { val : sub_sort -> T; Sub : forall x, P x -> sub_sort; Sub_rect : forall K (_ : forall x Px, K (@Sub x Px)) u, K u; SubK : forall x Px, val (@Sub x Px) = x }. HB.structure Definition SUB (T : Type) (P : pred T) := { S of is_SUB T P S }. #[verbose] HB.structure Definition SubInhab (T : Type) P := { sT of is_inhab sT & is_SUB T P sT }. HB.structure Definition SubNontrivial T P := { sT of is_nontrivial sT & is_SUB T P sT }. #[key="sT"] HB.factory Record InhabForSub (T : Inhab.type) P (sT : Type) of SubNontrivial T P sT := {}. HB.builders Context (T : Inhab.type) P sT of InhabForSub T P sT.
|
Definition
|
tests
|
[
"From HB Require Import structures."
] |
tests/subtype.v
|
pred
| |
xxx : P (default : T). HB.instance Definition SubInhabMix := is_inhab.Build sT (Sub (default : T) xxx). HB.end.
|
Axiom
|
tests
|
[
"From HB Require Import structures."
] |
tests/subtype.v
|
xxx
| |
ix : Type.
|
Axiom
|
tests
|
[
"From HB Require Import structures."
] |
tests/test_CS_db_filtering.v
|
ix
| |
vec T := ix -> T.
|
Definition
|
tests
|
[
"From HB Require Import structures."
] |
tests/test_CS_db_filtering.v
|
vec
| |
dual (T : Type) := T.
|
Definition
|
tests
|
[
"From HB Require Import structures."
] |
tests/test_synthesis_params.v
|
dual
| |
dd (d:unit) : unit. exact d. Qed. HB.instance Definition _ d (T : POrder.type d) := IsDualPOrdered.Build (dd d) (dual T) (fun x y => @le d T y x) (fun x y => @le d T y x). HB.instance Definition _ d (T : TPOrder.type d) := HasBottom.Build (dd d) (dual T) (@top _ T). HB.instance Definition _ d (T : BPOrder.type d) := HasTop.Build (dd d) (dual T) (@bottom _ T).
|
Definition
|
tests
|
[
"From HB Require Import structures."
] |
tests/test_synthesis_params.v
|
dd
| |
comb A op := forall x : A, op (op x) = x. HB.mixin Record Foo A := { op : A -> A; ax : comb A op }. HB.structure Definition S := { A of Foo A }. Set Printing All.
|
Definition
|
tests
|
[
"From HB Require Import structures."
] |
tests/type_of_exported_ops.v
|
comb
| |
test1 : True. Proof. pose proof @ax as H. match goal with | H : forall x : S.type, comb (S.sort x) op |- _ => trivial | H : ?T |- _ => fail "type of ax not as nice as expected:" T end. Qed. HB.mixin Record HasMul T := { mul : T -> T -> T; mulC: forall x y : T, mul x y = mul y x; mulA: forall x y z : T, mul x (mul y z) = mul (mul x y) z; }. HB.structure Definition Mul := { T of HasMul T }.
|
Lemma
|
tests
|
[
"From HB Require Import structures."
] |
tests/type_of_exported_ops.v
|
test1
| |
test2 : True. Proof. pose proof @mulA as H. match goal with | H : forall s : Mul.type, forall x y z : Mul.sort s, mul x (mul y z) = mul (mul x y) z |- _ => trivial | H : ?T |- _ => fail "type of mulA not as nice as expected:" T end. Qed.
|
Lemma
|
tests
|
[
"From HB Require Import structures."
] |
tests/type_of_exported_ops.v
|
test2
| |
_ := AddAG_of_TYPE.Build Z 0%Z Z.add Z.opp Z.add_assoc Z.add_comm Z.add_0_l Z.add_opp_diag_l. HB.instance
|
Definition
|
tests_stdlib
|
[
"From Coq Require Import ZArith ssrfun ssreflect.",
"From HB Require Import structures.",
"From HB Require Import demo1."
] |
tests_stdlib/about.v
|
_
| |
_ := Ring_of_TYPE.Build Z 0%Z 1%Z Z.add Z.opp Z.mul Z.add_assoc Z.add_comm Z.add_0_l Z.add_opp_diag_l Z.mul_assoc Z.mul_1_l Z.mul_1_r Z.mul_add_distr_r Z.mul_add_distr_l. (* mixin *) HB.about AddMonoid_of_TYPE. (* mixin constructor *) HB.about AddMonoid_of_TYPE.Build. (* structure *) HB.about AddAG.type. (* class *) HB.about AddMonoid. (* factory *) HB.about Ring_of_AddAG. (* factory constructor *) HB.about Ring_of_AddAG.Build. (* operation *) HB.about add. (* canonical proj/value *) HB.about AddAG.sort. (* canonical value *) HB.about Z. (* coercion *) HB.about hierarchy_5_Ring_class__to__hierarchy_5_SemiRing_class. HB.about hierarchy_5_Ring__to__hierarchy_5_SemiRing. (* builder *) HB.about Builders_40.hierarchy_5_Ring_of_AddAG__to__hierarchy_5_BiNearRing_of_AddMonoid. HB.locate BinNums_Z__canonical__hierarchy_5_AddAG. (* Test minimally qualified names *)
|
Definition
|
tests_stdlib
|
[
"From Coq Require Import ZArith ssrfun ssreflect.",
"From HB Require Import structures.",
"From HB Require Import demo1."
] |
tests_stdlib/about.v
|
_
| |
addr0 : right_id (@zero R) add. Proof. by move=> x; rewrite addrC add0r. Qed. HB.export addr0.
|
Lemma
|
tests_stdlib
|
[
"From Coq Require Import ssreflect ssrfun ZArith.",
"From HB Require Import structures."
] |
tests_stdlib/exports.v
|
addr0
| |
addrN : right_inverse (@zero R) opp add. Proof. by move=> x; rewrite addrC addNr. Qed.
|
Lemma
|
tests_stdlib
|
[
"From Coq Require Import ssreflect ssrfun ZArith.",
"From HB Require Import structures."
] |
tests_stdlib/exports.v
|
addrN
| |
subrr x : x - x = 0. Proof. by rewrite addrN. Qed.
|
Lemma
|
tests_stdlib
|
[
"From Coq Require Import ssreflect ssrfun ZArith.",
"From HB Require Import structures."
] |
tests_stdlib/exports.v
|
subrr
| |
addrNK x y : x + y - y = x. Proof. by rewrite -addrA subrr addr0. Qed.
|
Lemma
|
tests_stdlib
|
[
"From Coq Require Import ssreflect ssrfun ZArith.",
"From HB Require Import structures."
] |
tests_stdlib/exports.v
|
addrNK
| |
addrNK := addrNK. HB.export addrNK. HB.end.
|
Definition
|
tests_stdlib
|
[
"From Coq Require Import ssreflect ssrfun ZArith.",
"From HB Require Import structures."
] |
tests_stdlib/exports.v
|
addrNK
|
Structured dataset from Hierarchy Builder — High-level commands for packed class hierarchies.
752 declarations extracted from Coq source files.
| Column | Type | Description |
|---|---|---|
| fact | string | Declaration body |
| type | string | Lemma, Definition, Theorem, etc. |
| library | string | Source module |
| imports | list | Required imports |
| filename | string | Source file path |
| symbolic_name | string | Identifier |