Debian Codegraph @

test-suite/ssr/misc_extended.v

raw
1 Require Import ssreflect.
2
3 (* Require Import List. *)
4
5 Lemma test_elim_pattern_1 : forall A (l:list A), app l nil = l.
6 Proof.
7 intros A.
8 elim/list_ind => [^~ 1 ].
9 by [].
10 match goal with |- app (cons a1 l1) nil = cons a1 l1 => idtac end.
11 Abort.
12
13 Lemma test_elim_pattern_2 : forall A (l:list A), app l nil = l.
14 Proof.
15 intros. elim: l => [^~ 1 ].
16 by [].
17 match goal with |- app (cons a1 l1) nil = cons a1 l1 => idtac end.
18 Abort.
19
20 Lemma test_elim_pattern_3 : forall A (l:list A), app l nil = l.
21 Proof.
22 intros. elim: l => [ | x l' IH ].
23 by [].
24 match goal with |- app (cons x l') nil = cons x l' => idtac end.
25 Abort.
26
27
28 Generalizable Variables A.
29
30 Class Inhab (A:Type) : Type :=
31 { arbitrary : A }.
32
33 Lemma test_intro_typeclass_1 : forall A `{Inhab A} (l1 l2:list A), l2 = nil -> app l1 l2 = l1.
34 Proof.
35 move =>> H.
36 match goal with |- _ = _ => idtac end.
37 Abort.
38
39 Lemma test_intro_typeclass_2 : forall A `{Inhab A} (x:A), x = arbitrary -> x = arbitrary.
40 Proof.
41 move =>> H.
42 match goal with |- _ = _ => idtac end.
43 Abort.
44
45 Lemma test_intro_temporary_1 : forall A (l1 l2:list A), l2 = nil -> app l1 l2 = l1.
46 Proof.
47 move => A + l2.
48 match goal with |- forall l1, l2 = nil -> app l1 l2 = l1 => idtac end.
49 Abort.
50
51 Lemma test_intro_temporary_2 : forall A `{Inhab A} (l1 l2:list A), l2 = nil -> app l1 l2 = l1.
52 Proof.
53 move => > E.
54 match goal with |- _ = _ => idtac end.
55 Abort.
56
57 Lemma test_dispatch : (forall x:nat, x= x )/\ (forall y:nat, y = y).
58 Proof.
59 intros. split => [ a | b ].
60 match goal with |- a = a => by [] end.
61 match goal with |- b = b => by [] end.
62 Abort.
63
64 Lemma test_tactics_as_view_1 : forall A (l1:list A), app nil l1 = l1.
65 Proof.
66 move => /ltac:(simpl).
67 Abort.
68
69 Lemma test_tactics_as_view_2 : forall A, (forall (l1:list A), app nil l1 = l1) /\ (app nil nil = @nil A).
70 Proof.
71 move => A.
72 (* TODO: I want to do [split =>.] as a temporary step in setting up my script,
73 but this syntax does not seem to be supported. Can't we have an empty ipat?
74 Note that I can do [split => [ | ]]*)
75 split => [| /ltac:(simpl)].
76 Abort.
77
78 Notation "%%" := (ltac:(simpl)) (only parsing) : ssripat_scope.
79
80 Lemma test_tactics_as_view_3 : forall A, (forall (l1:list A), app nil l1 = l1) /\ (app nil nil = @nil A).
81 Proof.
82 move => /ltac:(split) [ | /%% ].
83 Abort.