Subject: Ssreflect Users Discussion List
List archive
- From: Robbert Krebbers <>
- To: "" <>
- Subject: Re: [ssreflect] [rewrite foo in hyp] weirdness
- Date: Wed, 13 Jan 2016 21:06:44 +0100
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=None ; spf=None
- Ironport-phdr: 9a23:EtCSsB+zwQCRDf9uRHKM819IXTAuvvDOBiVQ1KB92u0cTK2v8tzYMVDF4r011RmSDdudu60P0rCJ+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuStCU35v8jrrts7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cY6Lod8JsKSr7gcqo8QLdEJDE9KSU04tfqvF/CSxGO7z0SSC9exgFTGQXL6BzxQr/0qTG/t+xn2SDcPMvsTLlyVy70vIlxTxq9siANPTMj7Cn0kMF6hq9Bu1r1ohV+x4/Sb4WUL+ZlVrnad9kXX3ZCRMtbXSFbGcW6a91cXKI6Ie9Eotyl9BM1phykCFz0CQ==
Dear Georges,
thanks a lot for your detailed analysis of the problem.
Could you explain a bit more about the need for the "hack retrofitting support for context management into the Coq proof engine API.", possibly by an example.
Robbert
On 01/13/2016 06:05 PM, Georges Gonthier wrote:
Dear all,
It is, indeed a bug, but unfortunately not one that can be readily fixed in the ssreflect plugin alone, as
the blame is shared between the Coq proof engine, the setoid code, and the ssreflect "in" tactical.
Here's what "do [<tactic>] in <hyps>" does:
1) unless there is a *, it replaces the goal with a new manifest constant
_the_hidden_goal_
2) it discharges (reverts) Hi in <hyps> using forall/let _discharged_Hi_.
3) it runs <tactic>
4) it introduces the discharged context for each main subgoal derived
from the initial goal, and undoes 1); nothing is done for side subgoals.
The "tampering" diagnostic indicates step 4) has encountered a goal that
has remnants of steps 1) or 2), but no longer has the same shape, which is usually a
sign that step 3) has interfered. The check is needed because of the flimsy connection
via bound names between the two phases of the tactical, which is a hack retrofitting
support for context management into the Coq proof engine API.
The "bug" below manifests itself because the setoid implementation does
gratuitous alpha-conversion in the goal, erasing any trace of step 2), so that step 4)
will either complain if it still detects step 1), or mistake the goal for a side condition
(and skip introductions) if there was a *. (To be fair, setoid rewrite in H can only work
for goals of the form H -> ... where the bound name is not displayed.)
As for the other issues you raise:
- It's not obvious to insert introduced definitions in their original positions in the context which
<tactic> can modify: using "set " to abbreviate subexpressions is common enough, and
forces all introductions to occur at the end (or after the set); even plain rewrite can insert
assumption or constants that are lower in the context. We could just try our best, at the expense of
underspecifying "in", but I must say that I've often found the current behaviour quite useful
in large proofs, as it prevents the assumption(s) you are working on from scrolling out of view.
- We use a function provided by the setoid API to determine whether
arguments to rewrite are valid relations; it has a history of falling back
behind the rest of the setoid library, unfortunately...
Cheers,
Georges
-----Original Message-----
From:
[mailto:]
On Behalf Of Robbert Krebbers
Sent: 13 January 2016 14:44
To:
Subject: Re: [ssreflect] [rewrite foo in hyp] weirdness
Dear Emilio,
Thanks for your reply.
On 01/13/2016 01:16 PM, Emilio Jesús Gallego Arias wrote:
However it has some particularities, as your next example shows:From the ref man:
This may be avoided using:rewrite H1 in H2.
(* Error: tampering with discharged assumptions of "in" tactical *)
The manual does a better job than I could ever do in explaining "in *".rewrite H1 in H2 *.
The operation described by tactic is
performed in the facts listed in ident +
and in the goal if a * ends the list.
I do not necessarily want the rewrite to be performed in the goal as well, so
always using * seems not to be the solution.
As Assia remarked here
https://github.com/math-comp/math-comp/issues/16#issuecomment-171295569
, it is probably a bug.
Best,
Robbert
- [ssreflect] [rewrite foo in hyp] weirdness, Robbert Krebbers, 01/13/2016
- Re: [ssreflect] [rewrite foo in hyp] weirdness, Emilio Jesús Gallego Arias, 01/13/2016
- Re: [ssreflect] [rewrite foo in hyp] weirdness, Robbert Krebbers, 01/13/2016
- RE: [ssreflect] [rewrite foo in hyp] weirdness, Georges Gonthier, 01/13/2016
- Re: [ssreflect] [rewrite foo in hyp] weirdness, Robbert Krebbers, 01/13/2016
- Re: [ssreflect] [rewrite foo in hyp] weirdness, Enrico Tassi, 01/14/2016
- Re: [ssreflect] [rewrite foo in hyp] weirdness, Robbert Krebbers, 01/14/2016
- Re: [ssreflect] [rewrite foo in hyp] weirdness, Enrico Tassi, 01/14/2016
- Re: [ssreflect] [rewrite foo in hyp] weirdness, Robbert Krebbers, 01/14/2016
- Re: [ssreflect] [rewrite foo in hyp] weirdness, Enrico Tassi, 01/14/2016
- RE: [ssreflect] [rewrite foo in hyp] weirdness, Georges Gonthier, 01/14/2016
- Re: [ssreflect] [rewrite foo in hyp] weirdness, Robbert Krebbers, 01/14/2016
- RE: [ssreflect] [rewrite foo in hyp] weirdness, Georges Gonthier, 01/13/2016
- Re: [ssreflect] [rewrite foo in hyp] weirdness, Robbert Krebbers, 01/13/2016
- Re: [ssreflect] [rewrite foo in hyp] weirdness, Emilio Jesús Gallego Arias, 01/13/2016
Archive powered by MHonArc 2.6.18.