Skip to content
Snippets Groups Projects
Commit 1de37fd6 authored by Ralf Jung's avatar Ralf Jung
Browse files

improve inv_vec to force the length of the vector

parent cb021200
No related branches found
No related tags found
No related merge requests found
...@@ -189,11 +189,14 @@ Defined. ...@@ -189,11 +189,14 @@ Defined.
Ltac inv_vec v := Ltac inv_vec v :=
let T := type of v in let T := type of v in
match eval hnf in T with match eval hnf in T with
| vec _ 0 => | vec _ ?n =>
revert dependent v; match goal with |- v, @?P v => apply (vec_0_inv P) end match eval hnf in n with
| vec _ (S ?n) => | 0 => revert dependent v; match goal with |- v, @?P v => apply (vec_0_inv P) end
revert dependent v; match goal with |- v, @?P v => apply (vec_S_inv P) end; | S ?n =>
try (let x := fresh "x" in intros x v; inv_vec v; revert x) revert dependent v; match goal with |- v, @?P v => apply (vec_S_inv P) end;
(* Try going on recursively. *)
try (let x := fresh "x" in intros x v; inv_vec v; revert x)
end
end. end.
(** The following tactic performs case analysis on all hypotheses of the shape (** The following tactic performs case analysis on all hypotheses of the shape
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment