Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic


Chronological Thread 
  • From: Ramkumar Ramachandra <artagnon AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic
  • Date: Tue, 16 Jan 2018 15:14:11 -0800
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=artagnon AT gmail.com; spf=Pass smtp.mailfrom=artagnon AT gmail.com; spf=None smtp.helo=postmaster AT mail-yb0-f181.google.com
  • Ironport-phdr: 9a23:t7QBKBFkc/60tcqqHoCTxJ1GYnF86YWxBRYc798ds5kLTJ78ps2wAkXT6L1XgUPTWs2DsrQY07OQ6/iocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmCexbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjDQhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VDK/5KlpVRDokj8KODw38G/XhMJ+j79Vrgy9qBFk2YHYfJuYOeBicq/Bf94XQ3dKUMZLVyxGB4Oxd5cBAPAEPeZbson9okEBrQGjDgewHuzvzyVHiWP23aIg1eQuDBvG0xY9FN8JqnvUtsn1O70dUeCzy6nIyy7Ob/xT2Tjn6YjIdgotru2LXbJ1aMfcz1QkGQDdjliIt4DpIzeY2v4OvmWb9eZsS/+jhmA9pw1soTWj28EhgZTTiI0P0FDL7yB5zZ41JdKmTE57ZsapEJ5KuCGbM4t6W8MjTHp0tCojxL0KpJ22cDUQxJQowB7fbPOHc4yW7R75SOmRJjJ4iGpkeLK5mRmy7VCtxvPgWsSwylpHrSpInsPSunwQ2RHf8NWLR/hg8ku53DaAzQHT6uVKIUAukqrbLoYszaQqlpoPq0vDESn2mELwjKKNeUUk//Kn6+XjYrn8upCcMIp0hhnkMqsygsy/Hfg4Mg8WUmeH/uS8zaTv8lH9QLVXlfI7ibLZsZDfJcQDvKG1GQ5V0oA56xa+FTiqytoYnWNUZG5CLRmAls3iP0zECPH+F/a2xVq2wxlxwPWTBLTkAYjIJ2KLqr7kdL194khQ0gN7mdlF+5tbDLYHCP32U0718tffC0lqYESP3+/7BYAlhcslUmWVD/rBafKAgRqz/usqZtK0SsoQsTf5JeIi4qe333A8kF4ZO6Ku2MlOMSzqLrFdO0ycJEHUrJIZC25T51gxSeXrjBuJVjsBPy/vDZJ53SkyDcedNamGRo2ph+bfjiKyH5kTd2oeT17VQS6ueIKDVPMBLimVJ505nw==

Hi Guillaume and Pierre,

Thanks for the help. I now have:

Theorem readEvalLoop_ind : forall steps blk t,
let blk' := augmentBlk (blk ++ issueVerdicts t) t in
let t' := commitBlock blk' (updateRunningCounters blk' t) in
readEvalLoop (steps + 3) propose blk t =
readEvalLoop steps propose blk' t'.
Proof.
intros.
induction steps.
rewrite add_0_1; reflexivity.
generalize (eq_refl (S steps)).
generalize (S steps) at -2; intro n.
induction n.
intuition.
generalize dependent (S n); intro n0.
Abort.

With the following hypotheses/goals:
  • steps: nat
  • blk: list registration
  • t: serverState
  • blk':= augmentBlk (blk ++ issueVerdicts t) t : block
  • t':= commitBlock blk' (updateRunningCounters blk' t) : serverState
  • IHsteps: readEvalLoop (steps + 3) propose blk t = readEvalLoop steps propose blk' t'
  • n: nat
  • IHn: n = S steps -> readEvalLoop (n + 3) propose blk t = readEvalLoop n propose blk' t'
  • n0: nat
  • 1/1n0 = S steps -> readEvalLoop (n0 + 3) propose blk t = readEvalLoop n0 propose blk' t'
Ofcourse, I'm unable to unify with `IHn`, because `n` and `n0` are superficially different. How am I supposed to convince Coq that they're really the same? I've included some additional code because Pierre requested it.

(* stageHandler will take a given block and run it through a single stageStep *)
Definition stageHandler (s : stageStep) (blk : block) (t : serverState)
: (stageStep * serverState) :=
match s with
| propose => let blk' := blk ++ (issueVerdicts t) in
(preVote (augmentBlk blk' t), t)
| preVote blk => ((preCommit blk), t)
| preCommit blk => (propose, (commitBlock blk (updateRunningCounters blk t)))
end.

(* readEvalLoop will run for a given number of steps: in real-world, forever *)
Fixpoint readEvalLoop (steps : nat) (s : stageStep) (blk : block) (t : serverState)
: serverState :=
match steps with
| O => t
| (S n') => let (s', t') := stageHandler s blk t in readEvalLoop n' s' blk t'
end.


Cheers.

Ram



Archive powered by MHonArc 2.6.18.

Top of Page