Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make algebra_tactics robust to attacks on the algebraic hierarchy #108

Merged
merged 2 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 103 additions & 19 deletions theories/common.elpi
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,66 @@ canonical-init Scope DbName :- std.do! [
register-instance Scope DbName
{{:gref GRing.UnitRing.sort }} {{:gref Z }} canonical-Z-unitring ].

pred coercion-init i:scope, i:id.
coercion-init Scope DbName :- std.do! [
coq.typecheck {{ @GRing.zero lp:Zero }} _ ok,
coq.typecheck Zero TZero ok,
coq.elaborate-skeleton {{ id }} {{ nmodType -> lp:TZero }} CZero ok,
coq.elpi.accumulate Scope DbName (clause _ _ (coercion "zero" CZero :- !)),

coq.typecheck {{ @GRing.opp lp:Opp }} _ ok,
coq.typecheck Opp TOpp ok,
coq.elaborate-skeleton {{ id }} {{ zmodType -> lp:TOpp }} COpp ok,
coq.elpi.accumulate Scope DbName (clause _ _ (coercion "opp" COpp :- !)),

coq.typecheck {{ @GRing.add lp:Add }} _ ok,
coq.typecheck Add TAdd ok,
coq.elaborate-skeleton {{ id }} {{ nmodType -> lp:TAdd }} CAdd ok,
coq.elpi.accumulate Scope DbName (clause _ _ (coercion "add" CAdd :- !)),

coq.typecheck {{ @GRing.one lp:One }} _ ok,
coq.typecheck One TOne ok,
coq.elaborate-skeleton {{ id }} {{ semiRingType -> lp:TOne }} COne ok,
coq.elpi.accumulate Scope DbName (clause _ _ (coercion "one" COne :- !)),

coq.typecheck {{ @GRing.mul lp:Mul }} _ ok,
coq.typecheck Mul TMul ok,
coq.elaborate-skeleton {{ id }} {{ semiRingType -> lp:TMul }} CMul ok,
coq.elpi.accumulate Scope DbName (clause _ _ (coercion "mul" CMul :- !)),

coq.typecheck {{ @GRing.exp lp:Exp }} _ ok,
coq.typecheck Exp TExp ok,
coq.elaborate-skeleton {{ id }} {{ semiRingType -> lp:TExp }} CExp ok,
coq.elpi.accumulate Scope DbName (clause _ _ (coercion "exp" CExp :- !)),

coq.typecheck {{ @GRing.inv lp:Inv }} _ ok,
coq.typecheck Inv TInv ok,
coq.elaborate-skeleton {{ id }} {{ unitRingType -> lp:TInv }} CInv ok,
coq.elpi.accumulate Scope DbName (clause _ _ (coercion "inv" CInv :- !)),

coq.typecheck {{ @GRing.natmul lp:Natmul }} _ ok,
coq.typecheck Natmul TNatmul ok,
coq.elaborate-skeleton {{ id }} {{ nmodType -> lp:TNatmul }} CNatmul ok,
coq.elpi.accumulate Scope DbName (clause _ _ (coercion "natmul" CNatmul :- !)),

coq.typecheck {{ @GRing.Additive.sort lp:AdditiveDom lp:AdditiveIm }} _ ok,
coq.typecheck AdditiveDom TAdditiveDom ok,
coq.elaborate-skeleton {{ id }} {{ nmodType -> lp:TAdditiveDom }} CAdditiveDom ok,
coq.elpi.accumulate Scope DbName (clause _ _ (coercion "additive-dom" CAdditiveDom :- !)),
coq.typecheck AdditiveIm TAdditiveIm ok,
coq.elaborate-skeleton {{ id }} {{ nmodType -> lp:TAdditiveIm }} CAdditiveIm ok,
coq.elpi.accumulate Scope DbName (clause _ _ (coercion "additive-im" CAdditiveIm :- !)),

coq.typecheck {{ @GRing.RMorphism.sort lp:RMorphDom lp:RMorphIm }} _ ok,
coq.typecheck RMorphDom TRMorphDom ok,
coq.elaborate-skeleton {{ id }} {{ semiRingType -> lp:TRMorphDom }} CRMorphDom ok,
coq.elpi.accumulate Scope DbName (clause _ _ (coercion "rmorph-dom" CRMorphDom :- !)),
coq.typecheck RMorphIm TRMorphIm ok,
coq.elaborate-skeleton {{ id }} {{ semiRingType -> lp:TRMorphIm }} CRMorphIm ok,
coq.elpi.accumulate Scope DbName (clause _ _ (coercion "rmorph-im" CRMorphIm :- !)),
].


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Expression refifier

Expand Down Expand Up @@ -217,16 +277,22 @@ pred rmorphism->morph i:rmorphism, o:term -> term.
rmorphism->morph (rmorphism _ _ _ _ _ _ Morph) Morph :- !.
rmorphism->morph rmorphism-nat Morph :- !,
target-nmodule TU, !, target-semiring TR, !,
Morph = n\ {{ @GRing.natmul lp:TU (@GRing.one lp:TR) lp:n }}.
coercion "natmul" CNatmul, !,
coercion "one" COne, !,
Morph = n\ {{ @GRing.natmul (lp:CNatmul lp:TU) (@GRing.one (lp:COne lp:TR)) lp:n }}.
rmorphism->morph rmorphism-N Morph :- !,
target-nmodule TU, !, target-semiring TR, !,
Morph = n\ {{ @GRing.natmul lp:TU (@GRing.one lp:TR) (N.to_nat lp:n) }}.
coercion "natmul" CNatmul, !,
coercion "one" COne, !,
Morph = n\ {{ @GRing.natmul (lp:CNatmul lp:TU) (@GRing.one (lp:COne lp:TR)) (N.to_nat lp:n) }}.
rmorphism->morph rmorphism-int Morph :- !,
target-zmodule TU, !, target-semiring TR, !,
Morph = n\ {{ @intmul lp:TU (@GRing.one lp:TR) lp:n }}.
coercion "one" COne, !,
Morph = n\ {{ @intmul lp:TU (@GRing.one (lp:COne lp:TR)) lp:n }}.
rmorphism->morph rmorphism-Z Morph :- !,
target-zmodule TU, !, target-semiring TR, !,
Morph = n\ {{ @intmul lp:TU (@GRing.one lp:TR) (int_of_Z lp:n) }}.
coercion "one" COne, !,
Morph = n\ {{ @intmul lp:TU (@GRing.one (lp:COne lp:TR)) (int_of_Z lp:n) }}.

pred rmorphism-rm-field i:rmorphism, o:rmorphism.
rmorphism-rm-field (rmorphism U V SR R UR _ M) (rmorphism U V SR R UR none M).
Expand Down Expand Up @@ -301,26 +367,30 @@ nmod C {{ lp:In : _ }} OutM Out VM :- !,
nmod C In OutM Out VM.
% 0%R
nmod (additive U _ _) {{ @GRing.zero lp:U' }} {{ @M0 lp:U }} Out _ :-
coq.unify-eq U U' ok, !,
coercion "zero" CZero,
coq.unify-eq (app [CZero, U]) U' ok, !,
build.zero Out.
% +%R
nmod (additive U _ _ as C) {{ @GRing.add lp:U' lp:In1 lp:In2 }}
{{ @MAdd lp:U lp:OutM1 lp:OutM2 }} Out VM :-
coq.unify-eq U U' ok, !,
coercion "add" CAdd,
coq.unify-eq (app [CAdd, U]) U' ok, !,
nmod C In1 OutM1 Out1 VM, !,
nmod C In2 OutM2 Out2 VM, !,
build.add Out1 Out2 Out.
% (_ *+ _)%R
nmod (additive U _ _ as C) {{ @GRing.natmul lp:U' lp:In1 lp:In2 }}
{{ @MMuln lp:U lp:OutM1 lp:OutM2 }} Out VM :-
coq.unify-eq U U' ok, !,
coercion "natmul" CNatmul,
coq.unify-eq (app [CNatmul, U]) U' ok, !,
nmod C In1 OutM1 Out1 VM, !,
ring rmorphism-nat In2 OutM2 Out2 VM, !,
build.mul Out1 Out2 Out.
% -%R
nmod (additive _ (some U) _ as C) {{ @GRing.opp lp:U' lp:In1 }}
{{ @MOpp lp:U lp:OutM1 }} Out VM :-
coq.unify-eq U U' ok, !,
coercion "opp" COpp,
coq.unify-eq (app [COpp, U]) U' ok, !,
nmod C In1 OutM1 Out1 VM, !,
build.opp Out1 Out.
% (_ *~ _)%R
Expand All @@ -332,8 +402,10 @@ nmod (additive _ (some U) _ as C) {{ @intmul lp:U' lp:In1 lp:In2 }}
build.mul Out1 Out2 Out.
% additive functions
nmod (additive U _ _ as C) In OutM Out VM :-
coercion "additive-im" CAdditiveIm,
coercion "additive-dom" CAdditiveDom,
% TODO: for concrete additive functions, should we unpack [NewMorphInst]?
NewMorph = (x\ {{ @GRing.Additive.sort lp:V lp:U lp:NewMorphInst lp:x }}),
NewMorph = (x\ {{ @GRing.Additive.sort (lp:CAdditiveDom lp:V) (lp:CAdditiveIm lp:U) lp:NewMorphInst lp:x }}),
coq.unify-eq In (NewMorph In1) ok, !,
nmod.additive V C NewMorph NewMorphInst In1 OutM Out VM.
% variables
Expand Down Expand Up @@ -394,13 +466,15 @@ ring C {{ lp:In : _ }} OutM Out VM :- !,
ring C In OutM Out VM.
% 0%R
ring C {{ @GRing.zero lp:U }} {{ @R0 lp:R }} Out _ :-
coq.unify-eq { rmorphism->nmod C } U ok,
coercion "zero" CZero,
coq.unify-eq (app [CZero, { rmorphism->nmod C }]) U ok,
rmorphism->sring C R, !,
build.zero Out.
% +%R
ring C {{ @GRing.add lp:U lp:In1 lp:In2 }}
{{ @RAdd lp:R lp:OutM1 lp:OutM2 }} Out VM :-
coq.unify-eq { rmorphism->nmod C } U ok,
coercion "add" CAdd,
coq.unify-eq (app [CAdd, { rmorphism->nmod C }]) U ok,
rmorphism->sring C R, !,
ring C In1 OutM1 Out1 VM, !,
ring C In2 OutM2 Out2 VM, !,
Expand All @@ -426,14 +500,16 @@ ring rmorphism-Z {{ Z.add lp:In1 lp:In2 }}
% (_ *+ _)%R
ring C {{ @GRing.natmul lp:U lp:In1 lp:In2 }}
{{ @RMuln lp:R lp:OutM1 lp:OutM2 }} Out VM :-
coq.unify-eq { rmorphism->nmod C } U ok,
coercion "natmul" CNatmul,
coq.unify-eq (app [CNatmul, { rmorphism->nmod C }]) U ok,
rmorphism->sring C R, !,
ring C In1 OutM1 Out1 VM, !,
ring rmorphism-nat In2 OutM2 Out2 VM, !,
build.mul Out1 Out2 Out.
% -%R
ring C {{ @GRing.opp lp:U lp:In1 }} {{ @ROpp lp:R lp:OutM1 }} Out VM :-
coq.unify-eq { rmorphism->zmod C } U ok,
coercion "opp" COpp,
coq.unify-eq (app [COpp, { rmorphism->zmod C }]) U ok,
rmorphism->ring C R, !,
ring C In1 OutM1 Out1 VM, !,
build.opp Out1 Out.
Expand All @@ -457,14 +533,16 @@ ring C {{ @intmul lp:U lp:In1 lp:In2 }}
build.mul Out1 Out2 Out.
% 1%R
ring C {{ @GRing.one lp:R' }} {{ @R1 lp:R }} Out _ :-
coercion "one" COne,
rmorphism->sring C R,
coq.unify-eq R R' ok, !,
coq.unify-eq (app [COne, R]) R' ok, !,
build.one Out.
% *%R
ring C {{ @GRing.mul lp:R' lp:In1 lp:In2 }}
{{ @RMul lp:R lp:OutM1 lp:OutM2 }} Out VM :-
coercion "mul" CMul,
rmorphism->sring C R,
coq.unify-eq R R' ok, !,
coq.unify-eq (app [CMul, R]) R' ok, !,
ring C In1 OutM1 Out1 VM, !,
ring C In2 OutM2 Out2 VM, !,
build.mul Out1 Out2 Out.
Expand All @@ -489,8 +567,9 @@ ring rmorphism-Z {{ Z.mul lp:In1 lp:In2 }}
% (_ ^+ _)%R
ring C {{ @GRing.exp lp:R' lp:In1 lp:In2 }}
{{ @RExpn lp:R lp:OutM1 lp:OutM2 }} Out VM :-
coercion "exp" CExp,
rmorphism->sring C R,
coq.unify-eq R R' ok,
coq.unify-eq (app [CExp, R]) R' ok,
n-const In2 OutM2 Out2, !,
ring C In1 OutM1 Out1 VM, !,
build.exp Out1 Out2 Out.
Expand Down Expand Up @@ -533,8 +612,9 @@ ring rmorphism-Z {{ Z.pow lp:In1 lp:In2 }}
build.zero Out). % If [In2] is negative
% _^-1
ring C {{ @GRing.inv lp:R lp:In1 }} {{ @RInv lp:F lp:OutM1 }} Out VM :-
coercion "inv" CInv,
rmorphism->field C F,
coq.unify-eq { rmorphism->uring C } R ok, !,
coq.unify-eq (app [CInv, { rmorphism->uring C }]) R ok, !,
ring C In1 OutM1 Out1 VM,
build.inv Out1 Out.
% S (..(S ..)..) and nat constants
Expand Down Expand Up @@ -571,15 +651,19 @@ ring rmorphism-Z In {{ @RZC lp:In }} Out _ :-
% morphisms
ring C In OutM Out VM :-
rmorphism->sring C R,
coercion "rmorph-dom" CRMorphDom,
coercion "rmorph-im" CRMorphIm,
% TODO: for concrete additive functions, should we unpack [NewMorphInst]?
NewMorph = (x\ {{ @GRing.RMorphism.sort lp:S lp:R lp:NewMorphInst lp:x }}),
NewMorph = (x\ {{ @GRing.RMorphism.sort (lp:CRMorphDom lp:S) (lp:CRMorphIm lp:R) lp:NewMorphInst lp:x }}),
coq.unify-eq In (NewMorph In1) ok, !,
ring.rmorphism S C NewMorph NewMorphInst In1 OutM Out VM.
% additive functions
ring C In OutM Out VM :-
rmorphism->nmod C U,
coercion "additive-dom" CAdditiveDom,
coercion "additive-im" CAdditiveIm,
% TODO: for concrete additive functions, should we unpack [NewMorphInst]?
NewMorph = (x\ {{ @GRing.Additive.sort lp:V lp:U lp:NewMorphInst lp:x }}),
NewMorph = (x\ {{ @GRing.Additive.sort (lp:CAdditiveDom lp:V) (lp:CAdditiveIm lp:U) lp:NewMorphInst lp:x }}),
coq.unify-eq In (NewMorph In1) ok, !,
ring.additive V C NewMorph NewMorphInst In1 OutM Out VM.
% variables
Expand Down
1 change: 1 addition & 0 deletions theories/common.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From elpi Require Import elpi.
From Coq Require Import QArith.

Check warning on line 2 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-dev)

"From Coq" has been replaced by "From Stdlib".

Check warning on line 2 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-dev)

"From Coq" has been replaced by "From Stdlib".

Check warning on line 2 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-dev)

"From Coq" has been replaced by "From Stdlib".
From Coq.micromega Require Import OrderedRing RingMicromega.

Check warning on line 3 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-dev)

"From Coq" has been replaced by "From Stdlib".

Check warning on line 3 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-dev)

"From Coq" has been replaced by "From Stdlib".

Check warning on line 3 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-dev)

"From Coq" has been replaced by "From Stdlib".
From mathcomp Require Import all_ssreflect ssralg ssrnum ssrint.

Check warning on line 4 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.20)

Notations "[ seq _ | _ <- _ ]" defined at level 0 with arguments

Check warning on line 4 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.20)

Notations "\pi ( _ )" defined at level 2 and "\pi"

Check warning on line 4 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-dev)

Notations "[ seq _ | _ <- _ ]" defined at level 0 with arguments

Check warning on line 4 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-dev)

Notations "\pi ( _ )" defined at level 2 and "\pi"

Check warning on line 4 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.0.0-coq-8.18)

Hiding binding of key N to N_scope

Check warning on line 4 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.0.0-coq-8.18)

Hiding binding of key Z to Z_scope

Check warning on line 4 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.1.0-coq-8.18)

Hiding binding of key N to N_scope

Check warning on line 4 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.1.0-coq-8.18)

Hiding binding of key Z to Z_scope
From mathcomp.zify Require Import ssrZ zify.

Expand All @@ -12,7 +12,7 @@

Local Open Scope ring_scope.

Implicit Types (V : nmodType) (R : semiRingType) (F : fieldType).

Check warning on line 15 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-dev)

Notation semiRingType is deprecated since mathcomp 2.4.0.

Check warning on line 15 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.19)

Notation semiRingType is deprecated since mathcomp 2.4.0.

Check warning on line 15 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.20)

Notation semiRingType is deprecated since mathcomp 2.4.0.

(* Some basic facts about `Decimal.uint` and `Hexadecimal.uint` *)

Expand Down Expand Up @@ -181,7 +181,7 @@

(* Type for reified expressions *)

Inductive RExpr : semiRingType -> Type :=

Check warning on line 184 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-dev)

Notation semiRingType is deprecated since mathcomp 2.4.0.

Check warning on line 184 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.19)

Notation semiRingType is deprecated since mathcomp 2.4.0.

Check warning on line 184 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.20)

Notation semiRingType is deprecated since mathcomp 2.4.0.
(* 0 *)
| R0 R : RExpr R
(* addition *)
Expand All @@ -192,11 +192,11 @@
(* natmul *)
| RMuln R : RExpr R -> RExpr nat -> RExpr R
(* opposite and subtraction *)
| ROpp (R : ringType) : RExpr R -> RExpr R

Check warning on line 195 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-dev)

Notation ringType is deprecated since mathcomp 2.4.0.

Check warning on line 195 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.19)

Notation ringType is deprecated since mathcomp 2.4.0.

Check warning on line 195 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.20)

Notation ringType is deprecated since mathcomp 2.4.0.
| RZOpp : RExpr Z -> RExpr Z
| RZSub : RExpr Z -> RExpr Z -> RExpr Z
(* intmul *)
| RMulz (R : ringType) : RExpr R -> RExpr int -> RExpr R

Check warning on line 199 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-dev)

Notation ringType is deprecated since mathcomp 2.4.0.

Check warning on line 199 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.19)

Notation ringType is deprecated since mathcomp 2.4.0.

Check warning on line 199 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.20)

Notation ringType is deprecated since mathcomp 2.4.0.
(* 1 *)
| R1 R : RExpr R
(* multiplication *)
Expand Down Expand Up @@ -309,7 +309,7 @@

Section norm.

Variables (R' : semiRingType) (R_of_N : N -> R').

Check warning on line 312 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-dev)

Notation semiRingType is deprecated since mathcomp 2.4.0.

Check warning on line 312 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.19)

Notation semiRingType is deprecated since mathcomp 2.4.0.

Check warning on line 312 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.20)

Notation semiRingType is deprecated since mathcomp 2.4.0.
Variables (zero : R') (add : R' -> R' -> R').
Variables (one : R') (mul : R' -> R' -> R') (exp : R' -> N -> R').

Expand Down Expand Up @@ -385,7 +385,7 @@

Section correct.

Variables (R' : semiRingType).

Check warning on line 388 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-dev)

Notation semiRingType is deprecated since mathcomp 2.4.0.

Check warning on line 388 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.19)

Notation semiRingType is deprecated since mathcomp 2.4.0.

Check warning on line 388 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.20)

Notation semiRingType is deprecated since mathcomp 2.4.0.

Notation Rnorm :=
(Rnorm (fun n => (nat_of_N n)%:R) 0 +%R 1 *%R (fun x n => x ^+ N.to_nat n)).
Expand Down Expand Up @@ -448,7 +448,7 @@

Section norm.

Variables (R' : ringType) (R_of_Z : Z -> R').

Check warning on line 451 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-dev)

Notation ringType is deprecated since mathcomp 2.4.0.

Check warning on line 451 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.19)

Notation ringType is deprecated since mathcomp 2.4.0.

Check warning on line 451 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.20)

Notation ringType is deprecated since mathcomp 2.4.0.
Variables (zero : R') (add : R' -> R' -> R').
Variables (opp : R' -> R') (sub : R' -> R' -> R').
Variables (one : R') (mul : R' -> R' -> R') (exp : R' -> N -> R').
Expand Down Expand Up @@ -555,7 +555,7 @@

Section correct.

Variables (R' : ringType).

Check warning on line 558 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-dev)

Notation ringType is deprecated since mathcomp 2.4.0.

Check warning on line 558 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.19)

Notation ringType is deprecated since mathcomp 2.4.0.

Check warning on line 558 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.20)

Notation ringType is deprecated since mathcomp 2.4.0.

Notation Rnorm :=
(Rnorm (fun n : Z => (int_of_Z n)%:~R) 0 +%R -%R (fun x y => x - y)
Expand Down Expand Up @@ -650,7 +650,7 @@

Section norm.

Variables (F : ringType) (F_of_Z : Z -> F).

Check warning on line 653 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.19)

Notation ringType is deprecated since mathcomp 2.4.0.

Check warning on line 653 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.20)

Notation ringType is deprecated since mathcomp 2.4.0.
Variables (zero : F) (add : F -> F -> F) (opp : F -> F) (sub : F -> F -> F).
Variables (one : F) (mul : F -> F -> F) (exp : F -> N -> F) (inv : F -> F).

Expand Down Expand Up @@ -857,7 +857,7 @@

Section norm.

Variables (F : ringType) (F_of_Z : bool -> Z -> F).

Check warning on line 860 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.19)

Notation ringType is deprecated since mathcomp 2.4.0.

Check warning on line 860 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-8.20)

Notation ringType is deprecated since mathcomp 2.4.0.
Variables (zero : F) (add : F -> F -> F) (opp : F -> F) (sub : F -> F -> F).
Variables (one : F) (mul : F -> F -> F) (exp : F -> N -> F) (inv : F -> F).

Expand Down Expand Up @@ -1335,7 +1335,7 @@
Proof.
rewrite /Qeq_bool /R_of_Q /= eqr_div ?pnatr_eq0; try lia.
rewrite !pmulrn -!intrM eqr_int -!/(int_of_Z (Z.pos _)) -!rmorphM /=.
by rewrite (can_eq int_of_ZK); apply/idP/eqP => /Zeq_is_eq_bool.

Check warning on line 1338 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-dev)

Reference Zeq_is_eq_bool is deprecated since 9.0.

Check warning on line 1338 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-dev)

Reference Zeq_is_eq_bool is deprecated since 9.0.

Check warning on line 1338 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-dev)

Reference Zeq_is_eq_bool is deprecated since 9.0.

Check warning on line 1338 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-dev)

Reference Zeq_is_eq_bool is deprecated since 9.0.
Qed.

Lemma R_of_Q_le x y : Qle_bool x y = (R_of_Q x <= R_of_Q y :> F).
Expand Down Expand Up @@ -1393,5 +1393,6 @@
pred canonical-Z-ring o:constant.
pred canonical-Z-comring o:constant.
pred canonical-Z-unitring o:constant.
pred coercion o:string o:term.

}}.
1 change: 1 addition & 0 deletions theories/lra.v
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
From elpi Require Import elpi.
From Coq Require Import QArith Ring.

Check warning on line 2 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-dev)

"From Coq" has been replaced by "From Stdlib".

Check warning on line 2 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-dev)

"From Coq" has been replaced by "From Stdlib".
From Coq.micromega Require Import RingMicromega QMicromega EnvRing Tauto Lqa.

Check warning on line 3 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-dev)

"From Coq" has been replaced by "From Stdlib".

Check warning on line 3 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-dev)

"From Coq" has been replaced by "From Stdlib".
From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq.

Check warning on line 4 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.0.0-coq-8.18)

Hiding binding of key N to N_scope

Check warning on line 4 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.1.0-coq-8.18)

Hiding binding of key N to N_scope
From mathcomp Require Import fintype finfun bigop order ssralg ssrnum ssrint.

Check warning on line 5 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.20)

Notations "[ seq _ | _ <- _ ]" defined at level 0 with arguments

Check warning on line 5 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-dev)

Notations "[ seq _ | _ <- _ ]" defined at level 0 with arguments

Check warning on line 5 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.0.0-coq-8.18)

Hiding binding of key Z to Z_scope

Check warning on line 5 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.1.0-coq-8.18)

Hiding binding of key Z to Z_scope
From mathcomp.zify Require Import ssrZ zify.
From mathcomp.algebra_tactics Require Import common.
From mathcomp.algebra_tactics Extra Dependency "common.elpi" as common.
Expand Down Expand Up @@ -394,7 +394,7 @@
Elpi Tactic lra.
Elpi Accumulate Db canonicals.db.
Elpi Accumulate File common lra.
Elpi Typecheck.

Check warning on line 397 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-dev)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Check warning on line 397 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-dev)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Check warning on line 397 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-8.20)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Check warning on line 397 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-8.20)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Check warning on line 397 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.20)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Check warning on line 397 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.20)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Check warning on line 397 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-dev)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Tactic Notation "lra" := elpi lra "lra_witness" "tacF" "tacR" 0.
Tactic Notation "nra" := elpi lra "nra_witness" "tacF" "tacR" 0.
Expand All @@ -403,3 +403,4 @@
Tactic Notation "psatz" := elpi lra "psatz_witness" "tacF" "tacR" (-1).

Elpi Query lp:{{ canonical-init library "canonicals.db" }}.
Elpi Query lp:{{ coercion-init library "canonicals.db" }}.
1 change: 1 addition & 0 deletions theories/ring.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From elpi Require Import elpi.
From Coq Require Import ZArith Ring Ring_polynom Field_theory.

Check warning on line 2 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-dev)

"From Coq" has been replaced by "From Stdlib".
From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq.

Check warning on line 3 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.0.0-coq-8.18)

Hiding binding of key N to N_scope

Check warning on line 3 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.1.0-coq-8.18)

Hiding binding of key N to N_scope
From mathcomp Require Import fintype finfun bigop order ssralg ssrnum ssrint.

Check warning on line 4 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.20)

Notations "[ seq _ | _ <- _ ]" defined at level 0 with arguments

Check warning on line 4 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.0.0-coq-8.18)

Hiding binding of key Z to Z_scope

Check warning on line 4 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.1.0-coq-8.18)

Hiding binding of key Z to Z_scope
From mathcomp.zify Require Import ssrZ zify.
From mathcomp.algebra_tactics Require Import common.
From mathcomp.algebra_tactics Extra Dependency "common.elpi" as common.
Expand Down Expand Up @@ -438,7 +438,7 @@
Elpi Tactic ring.
Elpi Accumulate Db canonicals.db.
Elpi Accumulate File common ring ring_tac.
Elpi Typecheck.

Check warning on line 441 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-dev)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Check warning on line 441 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-8.20)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Check warning on line 441 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-8.20)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Check warning on line 441 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.20)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Check warning on line 441 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.20)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Tactic Notation "ring" := elpi ring.
Tactic Notation "ring" ":" ne_constr_list(L) := elpi ring ltac_term_list:(L).
Expand All @@ -449,7 +449,7 @@
Elpi Tactic field.
Elpi Accumulate Db canonicals.db.
Elpi Accumulate File common ring field_tac.
Elpi Typecheck.

Check warning on line 452 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-8.20)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Check warning on line 452 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.3.0-coq-8.20)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Check warning on line 452 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.20)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Check warning on line 452 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.20)

The command 'Elpi Typecheck' is deprecated (and does nothing) since

Tactic Notation "field" := elpi field.
Tactic Notation "field" ":" ne_constr_list(L) := elpi field ltac_term_list:(L).
Expand All @@ -459,3 +459,4 @@
ltac_attributes:(A) elpi field ltac_term_list:(L).

Elpi Query lp:{{ canonical-init library "canonicals.db" }}.
Elpi Query lp:{{ coercion-init library "canonicals.db" }}.
Loading