coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Mike Kaplan <michael.n.kaplan AT gmail.com>
- To: coqclub <coq-club AT inria.fr>
- Subject: [Coq-Club] How do you use a gallina def in an Ltac fnc?
- Date: Tue, 24 Sep 2013 11:10:41 -0400
I was working through CPDT, the Match chapter, and created an Ltac to pose a list of vals based off of the "Ltac length" function therein:
--------------------------------------------------------------------------
Ltac poseList ls :=
match ls with
| nil => idtac
| ?i :: ?ls' => pose i ; poseList ls'
end.
Goal True .
poseList (1 :: 2 :: 3 :: nil) .
Abort.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
The above works as expected, adding n, n0 and n1 to the hyopthesis.
When I try to use:
-------------------------------------------------------------------------
Definition vals := (1 :: 2 :: 3 :: nil) .
--------------------------------------------------------------------------
When I try to use:
-------------------------------------------------------------------------
Definition vals := (1 :: 2 :: 3 :: nil) .
Goal True .
poseList vals .
Abort.--------------------------------------------------------------------------
I get an error:
No matching clauses for match
Am I approaching this the wrong way, or am I missing some bit of syntax to make it work?
I also tried using:
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Goal True.
pose vals.
match goal with
| [ H : (_ : list nat) |- _ ] =>
let v' := eval unfold H in H in
poseList v'
end .
let v' := eval unfold H in H in
poseList v'
end .
--------------------------------------------------------------------------
to try to unwrap the vals, but it fails with a similar error.
No matching clauses for match goal
No matching clauses for match goal
Thanks,
Mike Kaplan
Mike Kaplan
- [Coq-Club] How do you use a gallina def in an Ltac fnc?, Mike Kaplan, 09/24/2013
- Re: [Coq-Club] How do you use a gallina def in an Ltac fnc?, Adam Chlipala, 09/24/2013
- Re: [Coq-Club] How do you use a gallina def in an Ltac fnc?, Mike Kaplan, 09/24/2013
- Re: [Coq-Club] How do you use a gallina def in an Ltac fnc?, Adam Chlipala, 09/24/2013
Archive powered by MHonArc 2.6.18.