| 1 |
(************************************************************************) |
| 2 |
(* * The Rocq Prover / The Rocq Development Team *) |
| 3 |
(* v * Copyright INRIA, CNRS and contributors *) |
| 4 |
(* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 |
(* \VV/ **************************************************************) |
| 6 |
(* // * This file is distributed under the terms of the *) |
| 7 |
(* * GNU Lesser General Public License Version 2.1 *) |
| 8 |
(* * (see LICENSE file for the text of the license) *) |
| 9 |
(************************************************************************) |
| 10 |
|
| 11 |
(* (c) Copyright 2006-2016 Microsoft Corporation and Inria. *) |
| 12 |
|
| 13 |
Require Import ssreflect. |
| 14 |
Require Import ssrbool TestSuite.ssr_mini_mathcomp. |
| 15 |
|
| 16 |
Lemma test (x : bool) : True. |
| 17 |
have H1 x := x. |
| 18 |
have (x) := x => H2. |
| 19 |
have H3 T (x : T) := x. |
| 20 |
have ? : bool := H1 _ x. |
| 21 |
have ? : bool := H2 _ x. |
| 22 |
have ? : bool := H3 _ x. |
| 23 |
have ? (z : bool) : forall y : bool, z = z := fun y => refl_equal _. |
| 24 |
have ? w : w = w := @refl_equal nat w. |
| 25 |
have ? y : true by []. |
| 26 |
have ? (z : bool) : z = z. |
| 27 |
exact: (@refl_equal _ z). |
| 28 |
have ? (z w : bool) : z = z by exact: (@refl_equal _ z). |
| 29 |
have H w (a := 3) (_ := 4) : w && true = w. |
| 30 |
by rewrite andbT. |
| 31 |
exact I. |
| 32 |
Qed. |
| 33 |
|
| 34 |
Lemma test1 : True. |
| 35 |
suff (x : bool): x = x /\ True. |
| 36 |
by move/(_ true); case=> _. |
| 37 |
split; first by exact: (@refl_equal _ x). |
| 38 |
suff H y : y && true = y /\ True. |
| 39 |
by case: (H true). |
| 40 |
suff H1 /= : true && true /\ True. |
| 41 |
by rewrite andbT; split; [exact: (@refl_equal _ y) | exact: I]. |
| 42 |
match goal with |- is_true true /\ True => idtac end. |
| 43 |
by split. |
| 44 |
Qed. |
| 45 |
|
| 46 |
Lemma foo n : n >= 0. |
| 47 |
have f i (j := i + n) : j < n. |
| 48 |
match goal with j := i + n |- _ => idtac end. |
| 49 |
Undo 2. |
| 50 |
suff f i (j := i + n) : j < n. |
| 51 |
done. |
| 52 |
match goal with j := i + n |- _ => idtac end. |
| 53 |
Undo 3. |
| 54 |
done. |
| 55 |
Qed. |