Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] ring tatic on Z with positives

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] ring tatic on Z with positives


Chronological Thread 
  • From: Frédéric Besson <frederic.besson AT inria.fr>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] ring tatic on Z with positives
  • Date: Fri, 08 Jan 2021 20:58:08 +0100
  • Organization: Inria

Hi Abhishek,

There is already a preprocessor tactic for arithmetics : zify
zify; ring works for your goal.

Best,
--
Frédéric


On Fri, 2021-01-08 at 11:07 -0800, Abhishek Anand wrote:
> It was a bit surprising that ring couldn't solve the lemma below:
> Should it be extended to preprocess the goal as I do in the
> ringpp Ltac below?
> It seems that would strictly increase the potence of ring.
> Has someone written such more potent ring tactics and are willing to
> share? 
>
> Require Import ZArith.
>
> Lemma ringz (numCpu: positive): (3 * 1 * Z.pos numCpu * Z.pos (1 *
> 16))%Z = (3 * 1 * Z.pos (1 * 16 * numCpu))%Z.
> Proof.
>   Fail ring.
> Ltac ringpp :=
>   repeat rewrite Pos2Z.inj_mul;
>   repeat rewrite Pos2Z.inj_add;
>   ring.
>
>   ringpp.
>
>
> -- Abhishek
> http://www.cs.cornell.edu/~aa755/





Archive powered by MHonArc 2.6.19+.

Top of Page