Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] How do you use a gallina def in an Ltac fnc?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] How do you use a gallina def in an Ltac fnc?


Chronological Thread 
  • From: Adam Chlipala <adamc AT csail.mit.edu>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] How do you use a gallina def in an Ltac fnc?
  • Date: Tue, 24 Sep 2013 11:24:58 -0400

On 09/24/2013 11:10 AM, Mike Kaplan wrote:

--------------------------------------------------------------------------
Ltac poseList ls :=
match ls with
| nil => idtac
| ?i :: ?ls' => pose i ; poseList ls'
end.

[...]
--------------------------------------------------------------------------

When I try to use:

-------------------------------------------------------------------------
Definition vals := (1 :: 2 :: 3 :: nil) .
Goal True .
poseList vals .
Abort.
--------------------------------------------------------------------------

I get an error:

All this makes perfect sense, since Ltac matching is purely syntactic, and [vals] is neither [nil] nor a [cons]!

Many options are possible to do reduction in Ltac, and I do think CPDT introduces them at various points, but one option that would work here is replacing
match ls with
with
match eval hnf in ls with




Archive powered by MHonArc 2.6.18.

Top of Page