Skip to Content.
Sympa Menu

ssreflect - [ssreflect] Scopes and rewrite patterns

Subject: Ssreflect Users Discussion List

List archive

[ssreflect] Scopes and rewrite patterns


Chronological Thread 
  • From: Ralf Jung <>
  • To:
  • Subject: [ssreflect] Scopes and rewrite patterns
  • Date: Fri, 12 Feb 2016 14:39:30 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:+0EHOxL3yKl4pCW4K9mcpTZWNBhigK39O0sv0rFitYgULvzxwZ3uMQTl6Ol3ixeRBMOAu60C0LSd7vuocFdDyKjCmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBybrysXNWC0ILsiavvoNX6WEZhunmUWftKNhK4rAHc5IE9oLBJDeIP8CbPuWZCYO9MxGlldhq5lhf44dqsrtY4q3wD86Fpy8kVSr7gcqo8QLdEJDE9KSU04tfqvF/CSxGO7z0SSDY4iB1NVjLM6B+yfIr3vWOutPd71wGfJcyzVq8vHzO44PE4G1fTlC4bOmthoynsgctqgfcDrQ==

Hi all,

We are formalizing a shallow embedding of a logic in Coq, and we are
using scopes such that we can use the same notation for logic-level and
Coq-level assertions. However, unfortunately, this does not work well
with the ssreflect rewrite patterns: If, for example, "_ ★ _" is
registered as notation in a scope delimited by M, I have to write

rewrite [(a ★ _)%M]lemma.

These additional parenthesis get very tedious. Is there any alternative
available? Or, if not, is there any chance that a syntax like

rewrite [a ★ _]lemma%M.

could be supported?

I attached a simple file demonstrating the issue.

Kind regards,
Ralf
Require Import mathcomp.ssreflect.ssreflect Setoid.

Delimit Scope my_scope with M.
Notation "a ★ b" := (a /\ b) (at level 40) : my_scope.

Lemma sep_comm a b : (a ★ b <-> b ★ a)%M.
Proof. tauto. Qed.

Goal forall a b, (a ★ b <-> b ★ a)%M.
Proof.
  move=>a ?.
  (* Need nested parentheses to give a rewrite pattern. *)
  rewrite [(a ★ _)%M]sep_comm.



Archive powered by MHonArc 2.6.18.

Top of Page