Skip to content
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
1 change: 1 addition & 0 deletions theories/common.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
From mathcomp Require all_algebra. (* Remove this line when requiring Rocq > 9.1 *)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need to import all_algebra first, i.e., not in the dependency order?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it has to come before any (even transitive) Require that does Declare ML Module micromega, so first is the safest.
Note that it is only a Require, not a Require Import

From elpi Require Import elpi.
From Coq Require Import PeanoNat BinNat Zbool QArith.

Check warning on line 3 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-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.4.0-rocq-prover-9.0)

"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-dev:rocq-prover-9.0)

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

Check warning on line 4 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

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

Check warning on line 4 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.4.0-rocq-prover-9.0)

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

Check warning on line 4 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-9.0)

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

Check warning on line 5 in theories/common.v

View workflow job for this annotation

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

Library File mathcomp.ssreflect.all_ssreflect is deprecated

Check warning on line 5 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

Library File mathcomp.ssreflect.all_ssreflect is deprecated

Check warning on line 5 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-9.0)

Library File mathcomp.ssreflect.all_ssreflect is deprecated
From mathcomp.zify Require Import ssrZ zify.

Import Order.TTheory GRing.Theory Num.Theory.
Expand Down Expand Up @@ -1331,7 +1332,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 1335 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

Reference Zeq_is_eq_bool is deprecated since 9.0.

Check warning on line 1335 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

Reference Zeq_is_eq_bool is deprecated since 9.0.

Check warning on line 1335 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.4.0-rocq-prover-9.0)

Reference Zeq_is_eq_bool is deprecated since 9.0.

Check warning on line 1335 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.4.0-rocq-prover-9.0)

Reference Zeq_is_eq_bool is deprecated since 9.0.

Check warning on line 1335 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-9.0)

Reference Zeq_is_eq_bool is deprecated since 9.0.

Check warning on line 1335 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-9.0)

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
21 changes: 13 additions & 8 deletions theories/lra.v
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
From mathcomp Require all_algebra. (* Remove this line when requiring Rocq > 9.1 *)
From elpi Require Import elpi.
From Coq Require Import BinNat QArith Ring.

Check warning on line 3 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-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.4.0-rocq-prover-9.0)

"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-dev:rocq-prover-9.0)

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

Check warning on line 4 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

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

Check warning on line 4 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.4.0-rocq-prover-9.0)

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

Check warning on line 4 in theories/lra.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-9.0)

"From Coq" has been replaced by "From Stdlib".
From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq.
From mathcomp Require Import fintype finfun bigop order ssralg ssrnum ssrint.
Expand Down Expand Up @@ -63,10 +64,10 @@
| OpGt => fun x y => lt y x
end.

Definition Reval_op2 k : Op2 -> R -> R -> rtyp k :=
Definition Reval_op2 k : Op2 -> R -> R -> eKind k :=
match k with isProp => Reval_pop2 | isBool => Reval_bop2 end.

Definition Reval_formula k (ff : RFormula R) : rtyp k :=
Definition Reval_formula k (ff : RFormula R) : eKind k :=
let (lhs,o,rhs) := ff in Reval_op2 k o (Reval lhs) (Reval rhs).

Definition Rnorm_formula k (ff : RFormula R) :=
Expand All @@ -93,8 +94,8 @@
- by move=> ff1 IH1 ff2 IH2; congr eq.
Qed.

Definition Reval_PFormula (e : PolEnv R) k (ff : Formula Z) : rtyp k :=
let eval := PEeval add mul sub opp R_of_Z id exp e in
Definition Reval_PFormula (e : PolEnv R) k (ff : Formula Z) : eKind k :=
let eval := EnvRing.PEeval add mul sub opp R_of_Z id exp e in
let (lhs,o,rhs) := ff in Reval_op2 k o (eval lhs) (eval rhs).

Lemma pop2_bop2 (op : Op2) (q1 q2 : R) :
Expand All @@ -104,7 +105,9 @@
Lemma Reval_formula_compat (env : PolEnv R) k (f : Formula Z) :
hold k (Reval_PFormula env k f) <->
eval_formula add mul sub opp eqProp le lt R_of_Z id exp env f.
Proof. by case: f => lhs op rhs; case: k => //=; rewrite pop2_bop2. Qed.
Proof.
by case: f => lhs op rhs; case: k => /=; rewrite ?pop2_bop2; case: op.
Qed.

End Rnorm_formula.

Expand All @@ -117,7 +120,7 @@

Definition ZTautoChecker (f : BFormula (Formula Z) isProp) (w: list (Psatz Z)) :
bool :=
@tauto_checker
@Tauto.tauto_checker
(Formula Z) (NFormula Z) unit
(check_inconsistent 0 Z.eqb Z.leb)
(nformula_plus_nformula 0 Z.add Z.eqb)
Expand Down Expand Up @@ -208,7 +211,7 @@
- by move=> ff1 IH1 ff2 IH2; congr eq.
Qed.

Definition Feval_PFormula (e : PolEnv F) k (ff : Formula Q) : rtyp k :=
Definition Feval_PFormula (e : PolEnv F) k (ff : Formula Q) : eKind k :=
let eval := eval_pexpr add mul sub opp F_of_Q id exp e in
let (lhs,o,rhs) := ff in Feval_op2 k o (eval lhs) (eval rhs).

Expand All @@ -219,7 +222,9 @@
Lemma Feval_formula_compat env b f :
hold b (Feval_PFormula env b f) <->
eval_formula add mul sub opp eqProp le lt F_of_Q id exp env f.
Proof. by case: f => lhs op rhs; case: b => //=; rewrite pop2_bop2'. Qed.
Proof.
by case: f => lhs op rhs; case: b => /=; rewrite ?pop2_bop2'; case: op.
Qed.

End Fnorm_formula.

Expand Down
1 change: 1 addition & 0 deletions theories/ring.v
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
From mathcomp Require all_algebra. (* Remove this line when requiring Rocq > 9.1 *)
From elpi Require Import elpi.
From Coq Require Import ZArith Ring Ring_polynom Field_theory.

Check warning on line 3 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

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

Check warning on line 3 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.4.0-rocq-prover-9.0)

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

Check warning on line 3 in theories/ring.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-9.0)

"From Coq" has been replaced by "From Stdlib".
From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq.
From mathcomp Require Import fintype finfun bigop order ssralg ssrnum ssrint.
From mathcomp.zify Require Import ssrZ zify.
Expand Down
Loading