coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Pierre Courtieu <pierre.courtieu AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic
- Date: Wed, 17 Jan 2018 12:46:57 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=pierre.courtieu AT gmail.com; spf=Pass smtp.mailfrom=pierre.courtieu AT gmail.com; spf=None smtp.helo=postmaster AT mail-ot0-f169.google.com
- Ironport-phdr: 9a23:QQdYGR2qTKAvurO4smDT+DRfVm0co7zxezQtwd8Zse0RI/ad9pjvdHbS+e9qxAeQG9mDsrQc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q99pHPfglEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7Vq4/Vyi84Kh3SR/okCYHOCA/8GHLkcx7kaZXrAu8qxBj34LYZYeYP+d8cKzAZ9MXXWhOXshRWSJPAY2ycpUBAPYaMOZEs4XwvUcCoQeiCQSuAu7k1z9GhmXx3a0/y+kvCwDG0xI6H9IUrnvfscv4NKAPUeCv0KnIzCvMb+5L0jr68IjIcw4uoeuWXb1ua8be1U4vFx7fjlWMqIzqIS6V2/8Cs2ie9eVgVOavh3Q7pAF2pzii38EhgZTKiIIN0l3J9yp0zJwoKdGmSEN3e92pHIVKuy2HNoZ7RsUvSHxytikg0L0Jo5u7cTAKyJs5wx7fbOSKc42S7RLiUOadODB4hG55dL6miRa+7Emtx+nmWsm711ZKqSVFkt3SuXwXyxPT7c2HRuN8/kenxzmPyxje5+NLLEwuiKbXNZ4szqQzm5YNq0jPAy77lUHugK+TbEok++yo6+r9YrXho5+RL5d0igDgPaQ0gMywH/40PRQJX2iG4+S8yLzj8lPkQLhRgf02l7PWsJHeJcgBuqG5BApV3p456xmjFzemzMgYnX4fIV1ZfxKHlpHlNE3KIPDlFviymE+skTdux/DeJLLtGJTNLn7ZkLfgZ7lx8UBcyBBghexYsrlTE/kqJO/5Ehv6s8WdBRskOSS1xfzmAZNzzNVNd3iIB/qhMa7Iq1LAzeUyOfWNaZJd7C78JuI/6rjlimIjhV4QYIGm2JIWbDazGfEwcBbRWmblntpUSTRChQE5VuG/zQTaCWcCNUb3ZLo143QAMKzjCI7CQo63h7nYhXW0G5RXYiZNDVXeSC60JbXBYO8FbWepGuEkiiYNDOHzRIoo1BXovwj/meI+c7jkvxYAvJem7+Bbou3ekRZoq25xBsWZlmaRFyR6xz1ZATAx2697rAp2zVLRiaU=
Please give a SELF CONTAINED code. So that we can replay your code.
Best
Pierre
2018-01-17 0:14 GMT+01:00 Ramkumar Ramachandra
<artagnon AT gmail.com>:
> 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
- [Coq-Club] [HELP] Recovering information after the `generalize` tactic, Ramkumar Ramachandra, 01/16/2018
- Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic, Guillaume Melquiond, 01/16/2018
- Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic, Pierre Courtieu, 01/16/2018
- Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic, Ramkumar Ramachandra, 01/17/2018
- Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic, Pierre Courtieu, 01/17/2018
- Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic, Ramkumar Ramachandra, 01/18/2018
- Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic, Pierre Courtieu, 01/18/2018
- Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic, Ramkumar Ramachandra, 01/18/2018
- Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic, Pierre Courtieu, 01/17/2018
- Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic, Ramkumar Ramachandra, 01/17/2018
- Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic, Pierre Courtieu, 01/16/2018
- Re: [Coq-Club] [HELP] Recovering information after the `generalize` tactic, Guillaume Melquiond, 01/16/2018
Archive powered by MHonArc 2.6.18.