fact
stringlengths
8
29k
type
stringclasses
20 values
library
stringclasses
1 value
imports
listlengths
0
9
filename
stringclasses
173 values
symbolic_name
stringlengths
1
44
docstring
stringclasses
1 value
find (T : Type) (x : T) (xs : seq T) (i:nat). #[export]
Class
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
find
find0 (T : Type) (x : T) (xs : seq T) : find x (x :: xs) 0 := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
find0
findS (T : Type) (x : T) (y : T) (ys : seq T) i {_: find x ys i} : find x (y :: ys) i.+1 | 1 := { }. (* -------------------------------------------------------------------- *)
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
findS
closed (T : Type) (xs : seq T). #[export]
Class
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
closed
closed_nil T : closed (T:=T) nil := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
closed_nil
closed_cons T (x : T) (xs : seq T) {_: closed xs} : closed (x :: xs) := { }. (* -------------------------------------------------------------------- *)
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
closed_cons
reify (R : ringType) (a : R) (t : PExpr Z) (e : seq R). #[export]
Class
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
reify
reify_zero (R : ringType) e : @reify R 0 0%S e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
reify_zero
reify_one (R : ringType) e : @reify R 1 1%S e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
reify_one
reify_natconst (R : ringType) n e : @reify R n%:R ((n : Z)%:S)%S e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
reify_natconst
reify_add (R : ringType) a1 a2 t1 t2 e {_: @reify R a1 t1 e} {_: @reify R a2 t2 e} : reify (a1 + a2) (t1 + t2)%S e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
reify_add
reify_opp (R : ringType) a t e {_: @reify R a t e} : reify (-a) (-t)%S e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
reify_opp
reify_natmul (R : ringType) a n t e {_: @reify R a t e} : reify (a *+ n) (t * (n : Z)%:S)%S e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
reify_natmul
reify_mul (R : ringType) a1 a2 t1 t2 e {_: @reify R a1 t1 e} {_: @reify R a2 t2 e} : reify (a1 * a2) (t1 * t2)%S e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
reify_mul
reify_exp (R : ringType) a n t e {_: @reify R a t e} : reify (a ^+ n) (t ^+ n)%S e | 1 := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
reify_exp
reify_var (R : ringType) a i e `{find R a e i} : reify a ('X_i)%S e | 100 := { }.
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
reify_var
reifyl (R : ringType) a t e {_: @reify R a t e} `{closed (T := R) e} := (t, e). (* -------------------------------------------------------------------- *)
Definition
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
reifyl
reify xt xe := match goal with |- ?a = 0 => match eval red in (reifyl (a := a)) with | (?t, ?e) => pose xt := t; pose xe := e end end. (* -------------------------------------------------------------------- *)
Ltac
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
reify
freify (F : fieldType) (a : F) (t : FExpr Z) (e : seq F). #[export]
Class
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
freify
freify_zero (F : fieldType) e : @freify F 0 0%F e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
freify_zero
freify_one (F : fieldType) e : @freify F 1 1%F e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
freify_one
freify_natconst (F : fieldType) n e : @freify F n%:R ((n : Z)%:S)%F e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
freify_natconst
freify_add (F : fieldType) a1 a2 t1 t2 e {_: @freify F a1 t1 e} {_: @freify F a2 t2 e} : freify (a1 + a2) (t1 + t2)%F e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
freify_add
freify_opp (F : fieldType) a t e {_: @freify F a t e} : freify (-a) (-t)%F e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
freify_opp
freify_natmul (F : fieldType) a n t e {_: @freify F a t e} : freify (a *+ n) (t * (n : Z)%:S)%F e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
freify_natmul
freify_mul (F : fieldType) a1 a2 t1 t2 e {_: @freify F a1 t1 e} {_: @freify F a2 t2 e} : freify (a1 * a2) (t1 * t2)%F e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
freify_mul
freify_inv (F : fieldType) a t e {_: @freify F a t e} : freify (a^-1) (t^-1)%F e := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
freify_inv
freify_exp (F : fieldType) a n t e {_: @freify F a t e} : freify (a ^+ n) (t ^+ n)%F e | 1 := { }. #[export]
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
freify_exp
freify_var (F : fieldType) a i e `{find F a e i} : freify a ('X_i)%F e | 100 := { }.
Instance
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
freify_var
freifyl (F : fieldType) a t e {_: @freify F a t e} `{closed (T := F) e} := (t, e). (* -------------------------------------------------------------------- *)
Definition
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
freifyl
freify xt xe := match goal with |- ?a = 0 => match eval red in (freifyl (a := a)) with | (?t, ?e) => pose xt := t; pose xe := e end end. (* -------------------------------------------------------------------- *)
Ltac
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
freify
R_of_Z (R : ringType) (z : Z) : R := match z with | Z0 => 0 | Zpos n => (nat_of_P n)%:R | Zneg n => - (nat_of_P n)%:R end. Arguments R_of_Z [R].
Definition
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
R_of_Z
z0E : 0%Z = 0. Proof. by []. Qed.
Lemma
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
z0E
zaddE (z1 z2 : Z): (z1 + z2)%Z = z1 + z2. Proof. by []. Qed.
Lemma
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
zaddE
zoppE (z : Z): (-z)%Z = -z. Proof. by []. Qed.
Lemma
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
zoppE
zmulE (z1 z2 : Z): (z1 * z2)%Z = z1 * z2. Proof. by []. Qed.
Lemma
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
zmulE
zE := (z0E, zaddE, zoppE).
Definition
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
zE
R_of_Z_is_additive (R : ringType): additive (R_of_Z (R := R)). Proof. have oppm: {morph (R_of_Z (R := R)) : x / -x >-> -x}. by case=> [|n|n] //=; rewrite ?(oppr0, opprK). have addm z1 z2: R_of_Z (z1 + z2) = R_of_Z z1 + R_of_Z z2 :> R. wlog: z1 z2 / (z1 <=? z2)%Z; first move=> wlog. + case: (boolP (z1 <=? z2))%Z; first by move/wlog. + move/negbTE/Z.leb_gt/Z.lt_le_incl/Z.leb_le. by move/wlog; rewrite Z.add_comm addrC. case: z1 z2=> [|n1|n1] [|n2|n2] //= _; rewrite ?(addr0, add0r) //. + by rewrite Pos2Nat.inj_add natrD. + case: (Z.compare_spec n1 n2) => [[->]||]. * by rewrite Z.pos_sub_diag addrC subrr. * move=> lt; rewrite (Z.pos_sub_gt _ _ lt) /=. rewrite (Pos2Nat.inj_sub _ _ lt) natrB 1?addrC //. apply/leP/Pos2Nat.inj_le/Pos.lt_le_incl/Pos.ltb_lt. by rewrite Pos2Z.inj_ltb; apply/Pos.ltb_lt. * move=> lt; rewrite (Z.pos_sub_lt _ _ lt) /=. rewrite (Pos2Nat.inj_sub _ _ lt) natrB ?opprB 1?addrC //. apply/leP/Pos2Nat.inj_le/Pos.lt_le_incl/Pos.ltb_lt. by rewrite Pos2Z.inj_ltb; apply/Pos.ltb_lt. + by rewrite Pos2Nat.inj_add natrD opprD. by move=> z1 z2 /=; rewrite addm oppm. Qed. HB.instance Definition _ (R : ringType) := GRing.isAdditive.Build _ _ (R_of_Z (R:=R)) (R_of_Z_is_additive R).
Lemma
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
R_of_Z_is_additive
R_of_Z_is_multiplicative (R : ringType): multiplicative (R_of_Z (R := R)). Proof. split=> //=; case=> [|z1|z1] [|z2|z2] //=; rewrite ?simpm // ?(mulNr, mulrN, opprK); by rewrite nat_of_P_mult_morphism natrM. Qed. HB.instance Definition _ (R : ringType) := GRing.isMultiplicative.Build _ _ (R_of_Z (R:=R)) (R_of_Z_is_multiplicative R). Local Notation REeval := (@PEeval _ 0 +%R *%R (fun x y => x - y) -%R Z R_of_Z nat nat_of_N (@GRing.exp _)).
Lemma
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
R_of_Z_is_multiplicative
RE (R : ringType): @ring_eq_ext R +%R *%R -%R (@eq R). Proof. by split; do! move=> ? _ <-. Qed. Local Notation "~%R" := (fun x y => x - y). Local Notation "/%R" := (fun x y => x / y). Local Notation "^-1%R" := (@GRing.inv _) (only parsing).
Lemma
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
RE
RR (R : comRingType): @ring_theory R 0 1 +%R *%R ~%R -%R (@eq R). Proof. split=> //=; [ exact: add0r | exact: addrC | exact: addrA | exact: mul1r | exact: mulrC | exact: mulrA | exact: mulrDl | exact: subrr ]. Qed.
Lemma
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
RR
RZ (R : ringType): ring_morph (R := R) 0 1 +%R *%R ~%R -%R eq 0%Z 1%Z Zplus Zmult Zminus Z.opp Z.eqb (@R_of_Z _). Proof. split=> //=. + by move=> x y; rewrite rmorphD. + by move=> x y; rewrite rmorphB. + by move=> x y; rewrite rmorphM. + by move=> x; rewrite raddfN. + by move=> x y /Z.eqb_eq ->. Qed.
Lemma
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
RZ
PN (R : ringType): @power_theory R 1 *%R eq nat nat_of_N (@GRing.exp R). Proof. split=> r [|n] //=; elim: n => //= p ih. + by rewrite Pos2Nat.inj_xI exprS -!ih -exprD addnn -mul2n. + by rewrite Pos2Nat.inj_xO -!ih -exprD addnn -mul2n. Qed.
Lemma
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
PN
RF (F : fieldType): @field_theory F 0 1 +%R *%R ~%R -%R /%R ^-1%R (@eq F). Proof. split=> //=; first by apply RR. + by apply/eqP; rewrite oner_eq0. + by move=> x /eqP nz_z; rewrite mulVf. Qed.
Lemma
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
RF
Rcorrect (R : comRingType) := ring_correct (Eqsth R) (RE R) (Rth_ARth (Eqsth R) (RE R) (RR R)) (RZ R) (PN R) (triv_div_th (Eqsth R) (RE R) (Rth_ARth (Eqsth R) (RE R) (RR R)) (RZ R)).
Definition
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
Rcorrect
Fcorrect (F : fieldType) := Field_correct (Eqsth F) (RE F) (congr1 GRing.inv) (F2AF (Eqsth F) (RE F) (RF F)) (RZ F) (PN F) (triv_div_th (Eqsth F) (RE F) (Rth_ARth (Eqsth F) (RE F) (RR F)) (RZ F)). (* -------------------------------------------------------------------- *)
Definition
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
Fcorrect
Reval (R : ringType) (l : seq R) (pe : PExpr Z) := match pe with | 0%S => 0 | 1%S => 1 | (c%:S)%S => R_of_Z c | ('X_j)%S => BinList.nth 0 j l | (pe1 + pe2)%S => (Reval l pe1) + (Reval l pe2) | (pe1 - pe2)%S => (Reval l pe1) - (Reval l pe2) | (- pe1)%S => - (Reval l pe1) | (pe1 ^+ n)%S => (Reval l pe1) ^+ (nat_of_N n) | (pe1 * pe2)%S => match pe2 with | ((Zpos n)%:S)%S => (Reval l pe1) *+ (nat_of_P n) | _ => (Reval l pe1) * (Reval l pe2) end end. Local Notation RevalC R := (PEeval 0 1 +%R *%R ~%R -%R (R_of_Z (R := R)) nat_of_N (@GRing.exp R)).
Fixpoint
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
Reval
PEReval (R : ringType): RevalC _ =2 @Reval R. Proof. move=> l; elim => //=; try by do? move=> ?->. + move=> pe1 -> pe2 ->; case: pe2 => //=. by case=> [|c|c] //=; rewrite mulr_natr. Qed. (* -------------------------------------------------------------------- *)
Lemma
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
PEReval
Feval (F : fieldType) (l : seq F) (pe : FExpr Z) := match pe with | 0%F => 0 | 1%F => 1 | (c%:S)%F => R_of_Z c | ('X_j)%F => BinList.nth 0 j l | (pe1 + pe2)%F => (Feval l pe1) + (Feval l pe2) | (pe1 - pe2)%F => (Feval l pe1) - (Feval l pe2) | (- pe1)%F => - (Feval l pe1) | (pe1 ^+ n)%F => (Feval l pe1) ^+ (nat_of_N n) | (pe^-1)%F => (Feval l pe)^-1 | (pe1 / pe2)%F => (Feval l pe1) / (Feval l pe2) | (pe1 * pe2)%F => match pe2 with | ((Zpos n)%:S)%F => (Feval l pe1) *+ (nat_of_P n) | _ => (Feval l pe1) * (Feval l pe2) end end. Local Notation FevalC R := (FEeval 0 1 +%R *%R ~%R -%R /%R ^-1%R (R_of_Z (R := R)) nat_of_N (@GRing.exp R)).
Fixpoint
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
Feval
PEFeval (F : fieldType): FevalC _ =2 @Feval F. Proof. move=> l; elim => //=; try by do? move=> ?->. + move=> pe1 -> pe2 ->; case: pe2 => //=. by case=> [|c|c] //=; rewrite mulr_natr. Qed. (* -------------------------------------------------------------------- *)
Lemma
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
PEFeval
ssring := let xt := fresh "xt" in let xe := fresh "xe" in apply/eqP; rewrite -subr_eq0; apply/eqP; reify xt xe; apply (@Rcorrect _ 100 xe [::] xt (Coq.setoid_ring.Ring_polynom.PEc 0%Z) I); vm_compute;exact (erefl true). (* -------------------------------------------------------------------- *)
Ltac
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
ssring
ssfield := let xt := fresh "xt" in let xe := fresh "xe" in apply/eqP; rewrite -subr_eq0; apply/eqP; (* rewrite ?(mulr0, mul0r, mulr1, mul1r); *) freify xt xe; move: (@Fcorrect _ 100 xe [::] xt (Field_theory.FEc 0) I [::] (erefl [::])); move/(_ _ (erefl _) _ (erefl _) (erefl true)); rewrite !PEFeval; apply=> /=; do? split; cbv delta[BinPos.Pos.to_nat] => /= {xt xe}; try (exact I || apply/eqP).
Ltac
proofs
[ "From HB Require Import structures.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrnat ssrfun seq.", "From mathcomp Require Import choice ssralg bigop.", "From mathcomp Require Export word_ssrZ.", "From Coq Require Import NArith ZArith BinPos Ring_polynom Field_theory." ]
proofs/3rdparty/ssrring.v
ssfield
pair_inj {A B: Type} {a a': A} {b b': B} (e: (a, b) = (a', b')) : a = a' ∧ b = b' := let 'Logic.eq_refl := e in conj Logic.eq_refl Logic.eq_refl. (* -------------------------------------------------------------------- *)
Definition
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
pair_inj
assoc (s : seq (T * U)) (x : T) : option U := if s is (y, v) :: s then if x == y then Some v else assoc s x else None.
Fixpoint
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
assoc
assoc_cat (s1 s2: seq (T * U)) x : assoc (s1 ++ s2) x = if assoc s1 x is Some _ then assoc s1 x else assoc s2 x. Proof. by elim: s1 => [|[t u] s1 ih] //=; case: eqP. Qed.
Lemma
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
assoc_cat
assoc_mem' (T: eqType) U (s: seq (T * U)) x w : assoc s x = Some w → List.In (x, w) s. Proof. elim: s => // [ [t u] s ] ih /=; case: eqP; last by auto. by move => a /Some_inj; left; f_equal. Qed.
Lemma
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
assoc_mem'
InP (T: eqType) (s: seq T) m : reflect (List.In m s) (m \in s). Proof. elim: s. by constructor. move => a s ih. rewrite in_cons. case: (@eqP _ m a). by constructor; left. case ih; constructor. by right. simpl; intuition. Qed.
Lemma
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
InP
mem_uniq_assoc (T: eqType) U (s: seq (T * U)) x w : List.In (x, w) s → uniq (map fst s) → assoc s x = Some w. Proof. elim: s => // [ [t u] s] ih [ /pair_inj [] -> -> | rec ] /andP [nr un] /=. by rewrite eq_refl; eauto. case: eqP; last by eauto. fold (List.In (x, w) s) in rec. apply (List.in_map fst), (rwP (InP _ _)) in rec. move=> ?; subst. rewrite rec in nr. done. Qed.
Lemma
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
mem_uniq_assoc
assoc_mem_dom' (T: eqType) U (s : seq (T * U)) x w : assoc s x = Some w -> x \in [seq v.1 | v <- s]. Proof. move => h; apply assoc_mem' in h. apply (rwP (InP _ _)), List.in_map_iff. eexists; split. 2: eassumption. reflexivity. Qed. (* -------------------------------------------------------------------- *)
Lemma
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
assoc_mem_dom'
assocP (s : seq (T * U)) (x : T) (w : U) : uniq (map fst s) -> reflect (assoc s x = Some w) ((x, w) \in s). Proof. elim: s => [|[t u] s ih] => uq; first by constructor. move: uq => /andP[/= t_notin_s /ih {ih}]; move: t_notin_s. case: eqP=> [->|/eqP ne_xt] t_notin_s; last first. + by rewrite in_cons eqE /= (negbTE ne_xt). rewrite inE eqE /= eqxx /=; case: eqP => [->|ne_wu] _ /=. + by constructor. suff ->: (t, w) \in s = false by constructor; case=> /esym. by apply/negbTE; apply/contra: t_notin_s => /(map_f fst). Qed.
Lemma
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
assocP
assoc_mem (s : seq (T * U)) x w : assoc s x = Some w -> (x, w) \in s. Proof. elim: s => [|[t u] s ih] //=; case: eqP => [-> [->]|/eqP ne]. + by rewrite in_cons eqxx orTb. by rewrite in_cons eqE /= (negbTE ne). Qed.
Lemma
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
assoc_mem
assoc_mem_dom (s : seq (T * U)) x w : assoc s x = Some w -> w \in [seq v.2 | v <- s]. Proof. by move/assoc_mem/(map_f snd). Qed.
Lemma
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
assoc_mem_dom
assoc_inj (s : seq (T * U)) x y w : uniq [seq v.2 | v <- s] -> assoc s x = Some w -> assoc s y = Some w -> x = y. Proof. elim: s => [|[t u] s ih] //= /andP[u_notin_s uq_s xw yx]. move: xw yx ih u_notin_s; case: eqP => [-> [->]|ne_xt]. + by case: eqP=> [->//|] ne_yt yw _ /negbTE; rewrite (assoc_mem_dom yw). move=> xw; case: eqP=> [-> [->] _|]. + by move/negbTE; rewrite (assoc_mem_dom xw). by move=> ne_yt yw ih u_notin_s; apply: ih. Qed.
Lemma
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
assoc_inj
assoc_mapE m n : (∀ n u, (h (n, u)).1 = n) → assoc (map h m) n = omap (λ u, (h (n, u)).2) (assoc m n). Proof. move => E. elim: m => // - [] t u m /= ->. case htu: h (E t u) => [ ? v ] /= ?; subst. case: eqP => //= ->. by rewrite htu. Qed.
Lemma
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
assoc_mapE
assoc_filterI (m: seq (T * U)) (n: T) : assoc [seq x <- m | p x.1 ] n = if p n then assoc m n else None. Proof. elim: m n. - by move => n /=; case: ifP. case => t u m ih n /=. case: ifP. - by move => /=; case: eqP => // -> ->. by case: eqP => // -> {n} h; rewrite ih h. Qed.
Lemma
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
assoc_filterI
assoc_filter (m: seq (T * U)) (n: T) : p n → assoc [seq x <- m | p x.1] n = assoc m n. Proof. by move => h; rewrite assoc_filterI h. Qed.
Corollary
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
assoc_filter
in_map b m : reflect (exists2 a : A, List.In a m & b = f a) (b \in [seq f i | i <- m]). Proof. elim: m; first by constructor => - [] _ []. move => a m ih /=. rewrite in_cons; case: eqP => [ -> | neq ] /=. - by constructor; exists a => //; left. case: ih => ih; constructor. - by case: ih => a' ??; exists a' => //; right. case => a' ha' ?; apply: ih; exists a' => //. case: ha' => //; congruence. Qed.
Lemma
proofs
[ "From Coq Require List.", "From Coq Require Import Utf8.", "From mathcomp Require Import ssreflect eqtype ssrbool ssrfun ssrnat.", "From mathcomp Require Export seq." ]
proofs/3rdparty/xseq.v
in_map
ToString (t: ltype) (T: Type) := { category : string (* Name of the "register" used to print errors. *) ; _finC : finTypeC T ; to_string : T -> string }. #[global]
Class
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
ToString
Instance _finC.
Existing
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
Instance
rtype {t T} `{ToString t T} := t. (* This type and the field check_CAimm is not very elegant, but it is the only solution I have to keep a decidable equality over the type arg_kind. If new architecture need new checker for immediate then we should add an entry here. But it definition can be done in the architecture itself *) #[only(eqbOK)] derive
Definition
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
rtype
caimm_checker_s := | CAimmC_none | CAimmC_arm_shift_amout of shift_kind | CAimmC_arm_wencoding of expected_wencoding | CAimmC_arm_0_8_16_24 | CAimmC_riscv_12bits_signed | CAimmC_riscv_5bits_unsigned. HB.instance Definition _ := hasDecEq.Build caimm_checker_s caimm_checker_s_eqb_OK. (* -------------------------------------------------------------------- *) (* Basic architecture declaration. * Parameterized by types for registers, extra registers, flags, and conditions. *)
Inductive
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
caimm_checker_s
arch_decl (reg regx xreg rflag cond : Type) := { reg_size : wsize (* Register size. Also used as pointer size. *) ; xreg_size : wsize (* Extended registers size. *) ; cond_eqC : eqTypeC cond ; toS_r : ToString (lword reg_size) reg ; toS_rx : ToString (lword reg_size) regx ; toS_x : ToString (lword xreg_size) xreg ; toS_f : ToString lbool rflag ; reg_size_neq_xreg_size : reg_size != xreg_size ; ad_rsp : reg ; ad_fcp : FlagCombinationParams ; check_CAimm : caimm_checker_s -> forall ws, word ws -> bool }. #[global]
Class
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
arch_decl
Instances cond_eqC toS_r toS_rx toS_x toS_f ad_fcp. #[export]
Existing
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
Instances
arch_pd `{arch_decl} : PointerData := { Uptr := reg_size }. #[export]
Instance
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
arch_pd
arch_msfsz `{arch_decl} : MSFsize := { msf_size := reg_size }.
Instance
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
arch_msfsz
mk_ptr `{arch_decl} name := {| vtype := aword Uptr; vname := name; |}. (* FIXME ARM : Try to not use this projection *)
Definition
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
mk_ptr
reg_t {reg regx xreg rflag cond} `{arch : arch_decl reg regx xreg rflag cond} := reg.
Definition
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
reg_t
regx_t {reg regx xreg rflag cond} `{arch : arch_decl reg regx xreg rflag cond} := regx.
Definition
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
regx_t
xreg_t {reg regx xreg rflag cond} `{arch : arch_decl reg regx xreg rflag cond} := xreg.
Definition
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
xreg_t
rflag_t {reg regx xreg rflag cond} `{arch : arch_decl reg regx xreg rflag cond} := rflag.
Definition
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
rflag_t
cond_t {reg regx xreg rflag cond} `{arch : arch_decl reg regx xreg rflag cond} := cond.
Definition
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
cond_t
sem_lt t := (sem_t (eval_ltype t)).
Notation
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
sem_lt
sem_olt t := (sem_ot (eval_ltype t)).
Notation
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
sem_olt
sem_lprod ts tr := (sem_prod (map eval_ltype ts) tr).
Notation
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
sem_lprod
sem_ltuple ts := (sem_tuple (map eval_ltype ts)).
Notation
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
sem_ltuple
sem_lforall P tin := (sem_forall P (map eval_ltype tin)).
Notation
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
sem_lforall
interp_safe_cond_lty tin id_safe id_semi := (values.interp_safe_cond_ty (tin := map eval_ltype tin) id_safe id_semi).
Notation
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
interp_safe_cond_lty
lreg := lword reg_size.
Definition
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
lreg
wreg := sem_lt lreg.
Definition
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
wreg
lxreg := lword xreg_size.
Definition
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
lxreg
wxreg := sem_lt lxreg.
Definition
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
wxreg
lword_reg_neq_xreg : lreg != lxreg. Proof. apply/eqP. move=> []. apply/eqP. exact: reg_size_neq_xreg_size. Qed. (* -------------------------------------------------------------------- *) (* Addresses. * An address consists of * - A displacement (an immediate value). * - A base (a register). * - A scale. * - An offset (a register). * The effective address is displacement + base + offset * scale. *)
Lemma
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
lword_reg_neq_xreg
reg_address : Type := mkAddress { ad_disp : pointer ; ad_base : option reg_t ; ad_scale : nat ; ad_offset : option reg_t }.
Record
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
reg_address
address := | Areg of reg_address (* Absolute address. *) | Arip of pointer. (* Address relative to instruction pointer. *)
Variant
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
address
oeq_reg (x y:option reg_t) := @eq_op (option ceqT_eqType) x y.
Definition
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
oeq_reg
reg_address_beq (addr1: reg_address) addr2 := match addr1, addr2 with | mkAddress d1 b1 s1 o1, mkAddress d2 b2 s2 o2 => [&& d1 == d2, oeq_reg b1 b2, s1 == s2 & oeq_reg o1 o2] end.
Definition
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
reg_address_beq
reg_address_eq_axiom : Equality.axiom reg_address_beq. Proof. case=> [d1 b1 s1 o1] [d2 b2 s2 o2]; apply: (iffP idP) => /=. + by case/and4P ; do 4! move/eqP=> ->. by case; do 4! move=> ->; rewrite /oeq_reg !eqxx. Qed. HB.instance Definition _ := hasDecEq.Build reg_address reg_address_eq_axiom. (* -------------------------------------------------------------------- *)
Lemma
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
reg_address_eq_axiom
address_beq (addr1: address) addr2 := match addr1, addr2 with | Areg ra1, Areg ra2 => ra1 == ra2 | Arip p1, Arip p2 => p1 == p2 | _, _ => false end.
Definition
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
address_beq
address_eq_axiom : Equality.axiom address_beq. Proof. by case=> []? []? /=; (constructor || apply: reflect_inj eqP => ?? []). Qed. HB.instance Definition _ := hasDecEq.Build address address_eq_axiom. (* -------------------------------------------------------------------- *) (* Arguments to assembly instructions. *)
Lemma
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
address_eq_axiom
asm_arg : Type := | Condt of cond_t | Imm ws of word ws | Reg of reg_t | Regx of regx_t | Addr of address | XReg of xreg_t.
Variant
proofs
[ "From elpi.apps Require Import derive.", "From HB Require Import structures.", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype ssralg.", "From mathcomp Require Import word_ssrZ." ]
proofs/arch/arch_decl.v
asm_arg