Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Issues mixing Ltac, anonymous tactics, eta-expansion

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Issues mixing Ltac, anonymous tactics, eta-expansion


Chronological Thread 
  • From: Valentin Robert <valentin.robert.42 AT gmail.com>
  • To: "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: [Coq-Club] Issues mixing Ltac, anonymous tactics, eta-expansion
  • Date: Fri, 31 Mar 2017 22:18:51 +0000
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=valentin.robert.42 AT gmail.com; spf=Pass smtp.mailfrom=valentin.robert.42 AT gmail.com; spf=None smtp.helo=postmaster AT mail-ua0-f180.google.com
  • Ironport-phdr: 9a23:lD9fARS0eRhy0z9aiBbGaWOWgdpsv+yvbD5Q0YIujvd0So/mwa69YhKN2/xhgRfzUJnB7Loc0qyN4vymATRIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSijewZbx/IA+qoQnNq8IbnZZsJqEtxxXTv3BGYf5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM30u683wqRbDVwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xymp4qF2QxHqlSgHLSY0/27XhMJ+j6xVvQyvqABkzoHOfI2YLuBzcr/Bcd4YQ2dKQ8ZfVzZGAoO5d4YAAPAOPeJGoIn7u1sOrB2+DhSwCuPo0TBHmGX23bEn2OkmDwHJxgggEMwIsHTIrdX1Mr0eUfqyzKbT0zrDde9W1S3y5YTWaR0hrvSMUqhxccrV00UgCwTFjlCJpIHjIjib1fwNvnCF4+Z8Ue+jkW0qpgFrrjSx28shiJPFip8Wx1zY8yhy3Zw7KseiSEFhZN6pCJtQuD+eN4txWs4iRntnuCc+yrEfpJ60ZjQGxI0pxxLCaPGLb5KE4h3kVOaWLjd4gGxqdKijiBa19Eis0uz8Vs+q31ZWtidJjMXAu3QX2xHQ6sWLUOVx8lqj1DqVygze6f1ILVgxlaXBKp4hxrAwloAUsUTGBiL2hl/5jKuIeUUi5uio6uLnbq/8pp+bLIB7lBv+Mrg0lsGwH+g1KQcOX22B9uS90L3v51H2QLJPjvEuiKnWrIjaJdgHpq6+GwJazoEj6w+mAzi61NQYgGIIIUleeBOHiojpI0vBLOr5Dfe5mVSskS1ky+rIPr37Ud3xKS2Jm7D4OL159kR0yQwpzNkZ6YgeQuUKJ+u2UUvsvvTZCAU4Okq62bC0Js9609YgUGaCBLOYNuvotlWF/P5nd/eFYIITpDf7beIi7fP0kTllw3cSeKCo2d0cb3XuTacuGFmQfXe52oRJKmwNpAdrFOE=

Hello,

I was essentially trying to write some tactic combinator that would accept a one-argument tactic as input, and call this tactic with some hypothesis. My problem is that I have managed to make it work with pre-defined tactics, but not with on-the-fly anonymous tactics. See:

Ltac idtac' := idtac.

Ltac idtac'' x := idtac x.

Ltac silly tactic arg := tactic arg.

Goal forall (T : Type), False.
  intros.

  (* 0: Illegal tactic application *)
  Fail silly idtac T.

  (* 1: Illegal tactic application *)
  Fail silly idtac' T.

  (* 2: OK *)
  silly idtac'' T.

  (* 3: The reference idtac was not found in the current environment. *)
  Fail silly (fun x => idtac x) T.

  (* 4: x not found *)
  Fail silly (fun x => ltac:(idtac x)) T.

  (* 5: The reference idtac' was not found in the current environment. *)
  Fail silly (fun x => idtac' x) T.

  (* 6: Illegal tactic application *)
  Fail silly (fun x => ltac:(idtac' x)) T.

  (* 7: The reference idtac'' was not found in the current environment. *)
  Fail silly (fun x => idtac'' x) T.

  (* 8: Cannot infer the type of x in environment:
     T : Type *)
  Fail silly (fun x => ltac:(idtac'' x)) T.

  (* 9: Cannot infer an internal placeholder of type "Type" in environment:
     T : Type
     x : Type *)
  Fail silly (fun (x : Type) => ltac:(idtac'' x)) T.

I think by the end of this (attempts 8 and 9), I'm actually confused as to what I am manipulating, and what the internal placeholder is.

Is there a way to make such a combinator so that I can call:

silly (fun x => ltac:(someTactic x)).

Or is there some fundamental issue with manipulating anonymous tactics?

Best regards,
- Valentin



Archive powered by MHonArc 2.6.18.

Top of Page