coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Ramkumar Ramachandra <artagnon AT gmail.com>
- To: coq-club AT inria.fr
- Subject: [Coq-Club] [HELP] Tactics to reduce `fix` terms
- Date: Fri, 12 Jan 2018 13:05:57 -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-yw0-f173.google.com
- Ironport-phdr: 9a23:7U4dbRc0xTQ5cyeiCR9eL6pOlGMj4u6mDksu8pMizoh2WeGdxcu6Yx7h7PlgxGXEQZ/co6odzbaO6ua4ASQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTahfL9+Ngm6oRnMvcQKnIVuLbo8xAHUqXVSYeRWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLns65Nb3uhnZTAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD+v6bpgRh31hycdLzM38G/ZhM9tgqxFvB2svAZwz5LObYyPKPZyYqHQcNUHTmRBRMZRUClBD5ugYYQVCuoBPvtYr4znqFsUsBCwGROjBOb1xTBUhn/5x6s63Pk7EQ7cwQctGMgBsG7IrNrvO6cSV+e1zK/TwDXMavNZwzb96IzSfh89pvGMWKt9fMzMwkcsDwPIlkucpZDhMj+P1ekAs3KX4/dhWO6ykWIrtgN8rzapy8wxkIfGnJgVxUrB9ShhwIY6O9m4SEljbN6hCpRQtiWaO5J2Q8IsX21koSg6xqAEtJO1ZiQKx5MnxxnQa/yDbYeE+A7sVOGUITtghXJlfqywhwqq/ES+1uHxUtO43VVKoyZfj9XBt20B2wbO5sWFRPZx5kKh1iyO1wDX5OFEO0c0la/DJpE72L4wioAcsUvFHi/xnkX7l6CWdkA+9eip7+TreKnpppiZN4NskAHxLrwumtCjAeQ/KgUBQ2+b+f2l2LL/+U35Xa5Fg+YtkqjZtZDaPd4UqrS4Aw9TyIYj6gywAy2o0NQCzjE7KwdOfwvChIz0MXnPJur5BLGxmQeCijBuksrPO778B5zXZkLKlb7qfb9751RVgF4618xW6JRTDJkOJfvyXgn6s9mOXUxxCBC93+uyUIY17YgZQ2/aWvbIYpOXikeB46cUG8fJYYYUvDjnLP18vqzhiHY4nRkWeqz7hMJLOkD9JexvJgCiWVSpms0ISD5YsQ83Teisg1qHA2YKOiSCGpkk7zR+M7qISIfOQof33u6E1Sa/W4xJPiVIUw/XV3jvcIqAVrEHbyfAesI=
Hi folks,
This is my code:
(* 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.
Theorem readEvalLoop_ind : forall steps blk t,
let blk' := augmentBlk (blk ++ issueVerdicts t) t in
readEvalLoop (steps + 3) propose blk t =
readEvalLoop steps propose blk' (commitBlock blk' (updateRunningCounters blk' t)).
Proof.
intros.
unfold readEvalLoop; unfold stageHandler.
fix readEvalLoop 1.
Abort.
If I have `steps` fixed at O, the proof completes pretty easily. However, in this case, I get:
Ltac call to "fix (ident) (natural)" failed. Ltac call to "fix (ident) (natural)" failed. Not enough products.
What does this mean, and how am I supposed to reduce `fix` terms? None of the other tactics seem to work.
Thanks.
Ram
This is my code:
(* 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.
Theorem readEvalLoop_ind : forall steps blk t,
let blk' := augmentBlk (blk ++ issueVerdicts t) t in
readEvalLoop (steps + 3) propose blk t =
readEvalLoop steps propose blk' (commitBlock blk' (updateRunningCounters blk' t)).
Proof.
intros.
unfold readEvalLoop; unfold stageHandler.
fix readEvalLoop 1.
Abort.
If I have `steps` fixed at O, the proof completes pretty easily. However, in this case, I get:
Ltac call to "fix (ident) (natural)" failed. Ltac call to "fix (ident) (natural)" failed. Not enough products.
What does this mean, and how am I supposed to reduce `fix` terms? None of the other tactics seem to work.
Thanks.
Ram
- [Coq-Club] [HELP] Tactics to reduce `fix` terms, Ramkumar Ramachandra, 01/12/2018
- Re: [Coq-Club] [HELP] Tactics to reduce `fix` terms, Gaëtan Gilbert, 01/12/2018
Archive powered by MHonArc 2.6.18.