-
Notifications
You must be signed in to change notification settings - Fork 642
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR #13317: [ssr] intro pattern extensions for dup, swap and apply
Reviewed-by: gares Ack-by: Zimmi48
- Loading branch information
Showing
6 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- **Added:** | ||
SSReflect intro pattern ltac views ``/[dup]``, ``/[swap]`` and ``/[apply]`` | ||
(`#13317 <https://github.com/coq/coq/pull/13317>`_, | ||
by Cyril Cohen). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Require Import ssreflect. | ||
|
||
Section Apply. | ||
|
||
Variable P : nat -> Prop. | ||
Lemma test_apply A B : forall (f : A -> B) (a : A), B. | ||
|
||
Proof. | ||
move=> /[apply] b. | ||
exact. | ||
Qed. | ||
|
||
End Apply. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Require Import ssreflect. | ||
|
||
Section Dup. | ||
|
||
Variable P : nat -> Prop. | ||
|
||
Lemma test_dup1 : forall n : nat, P n. | ||
Proof. move=> /[dup] m n; suff: P n by []. Abort. | ||
|
||
Lemma test_dup2 : let n := 1 in False. | ||
Proof. move=> /[dup] m n; have : m = n := eq_refl. Abort. | ||
|
||
End Dup. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Require Import ssreflect. | ||
|
||
Section Swap. | ||
|
||
Definition P n := match n with 1 => true | _ => false end. | ||
|
||
Lemma test_swap1 : forall (n : nat) (b : bool), P n = b. | ||
Proof. move=> /[swap] b n; suff: P n = b by []. Abort. | ||
|
||
Lemma test_swap1 : let n := 1 in let b := true in False. | ||
Proof. move=> /[swap] b n; have : P n = b := eq_refl. Abort. | ||
|
||
End Swap. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters