coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Ben Sherman <sherman AT csail.mit.edu>
- To: coq-club AT inria.fr
- Subject: [Coq-Club] How does tactic-in-term interact with notation?
- Date: Mon, 4 Jul 2016 16:57:11 -0400
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=sherman AT csail.mit.edu; spf=Pass smtp.mailfrom=sherman AT csail.mit.edu; spf=None smtp.helo=postmaster AT outgoing-stata.csail.mit.edu
- Ironport-phdr: 9a23:hrOTxROuojb2hJea0Lsl6mtUPXoX/o7sNwtQ0KIMzox0KP/5rarrMEGX3/hxlliBBdydsKMczbCM+Pm9ACQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd+KyZ7tnLnvotX6WEZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu5blitCLFOXmAvgtI/rpMYwu3cYh/V0/MlZFK7+Yq4QTLpCDT1gPXpmytfssEzpQA3H3XsRSGAflFIcGAjI9hTzWL/6qSL7sqx42TXcMMHrG+NnEQ++5rtmHUe7wBwMMCQ0pTna
Hi all,
My general understanding of Coq notations is that they first are "desugared"
and then the resulting term is interpreted (including inference and
ltac-in-term). However, I cannot explain the following behavior, where a
tactic-in-term in notation breaks inference:
> Inductive term {var : bool -> Type} : bool -> Type :=
> | Var : forall A : bool, var A -> term A
> | Const : forall A : bool, term A.
>
> Arguments term : clear implicits.
>
> Record WfTerm {A} :=
> { WfT_Term : forall var, term var A
> ; WfT_Ok : True
> }.
>
> Arguments WfTerm : clear implicits.
> Arguments Build_WfTerm {A} _ _.
>
> Axiom undefined : forall A, A.
>
> Ltac proveWF := exact (undefined _).
>
> Notation "[ e ]" := (Build_WfTerm (fun _ => e) (ltac:(proveWF))).
> Notation "<< e >>" := (Build_WfTerm (fun _ => e) (undefined _)).
>
> Definition konst {A : bool} : WfTerm A :=
> Build_WfTerm (fun _ => Const A) (ltac:(proveWF)).
>
> Definition konst1 {A : bool} : WfTerm A :=
> << Const A >> .
>
> (* Why doesn't this work? It looks like it should just
> "desugar" to the definition of 'konst', and is also similar
> to 'konst1'. *)
> Fail Definition konst2 {A : bool} : WfTerm A :=
> [ Const A ] .
> (*
> Cannot infer the implicit parameter var of Const whose type is
> "bool -> Type" in environment:
> A : bool
> *)
Is there some way to understand what it is about the combination of the
notation and the tactic-in-term that's breaking type inference? Or is it
possible that this is a bug?
Thanks,
Ben
- [Coq-Club] How does tactic-in-term interact with notation?, Ben Sherman, 07/04/2016
- Re: [Coq-Club] How does tactic-in-term interact with notation?, Jonathan Leivent, 07/04/2016
- Re: [Coq-Club] How does tactic-in-term interact with notation?, Jason Gross, 07/05/2016
- Re: [Coq-Club] How does tactic-in-term interact with notation?, Jonathan Leivent, 07/04/2016
Archive powered by MHonArc 2.6.18.