Debian Codegraph @

test-suite/ssr/set_pattern.v

raw
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
15 Axiom daemon : False. Ltac myadmit := case: daemon.
16
17 Ltac T1 x := match goal with |- _ => set t := (x in X in _ = X) end.
18 Ltac T2 x := first [set t := (x in RHS)].
19 Ltac T3 x := first [set t := (x in Y in _ = Y)|idtac].
20 Ltac T4 x := set t := (x in RHS); idtac.
21 Ltac T5 x := match goal with |- _ => set t := (x in RHS) | |- _ => idtac end.
22
23 Require Import ssrbool TestSuite.ssr_mini_mathcomp.
24
25 Open Scope nat_scope.
26
27 Lemma foo x y : x.+1 = y + x.+1.
28 set t := (_.+1 in RHS). match goal with |- x.+1 = y + t => rewrite /t {t} end.
29 set t := (x in RHS). match goal with |- x.+1 = y + t.+1 => rewrite /t {t} end.
30 set t := (x in _ = x). match goal with |- x.+1 = t => rewrite /t {t} end.
31 set t := (x in X in _ = X).
32 match goal with |- x.+1 = y + t.+1 => rewrite /t {t} end.
33 set t := (x in RHS). match goal with |- x.+1 = y + t.+1 => rewrite /t {t} end.
34 set t := (y + (1 + x) as X in _ = X).
35 match goal with |- x.+1 = t => rewrite /t addSn add0n {t} end.
36 set t := x.+1. match goal with |- t = y + t => rewrite /t {t} end.
37 set t := (x).+1. match goal with |- t = y + t => rewrite /t {t} end.
38 set t := ((x).+1 in X in _ = X).
39 match goal with |- x.+1 = y + t => rewrite /t {t} end.
40 set t := (x.+1 in RHS). match goal with |- x.+1 = y + t => rewrite /t {t} end.
41 T1 (x.+1). match goal with |- x.+1 = y + t => rewrite /t {t} end.
42 T2 (x.+1). match goal with |- x.+1 = y + t => rewrite /t {t} end.
43 T3 (x.+1). match goal with |- x.+1 = y + t => rewrite /t {t} end.
44 T4 (x.+1). match goal with |- x.+1 = y + t => rewrite /t {t} end.
45 T5 (x.+1). match goal with |- x.+1 = y + t => rewrite /t {t} end.
46 rewrite [RHS]addnC.
47 match goal with |- x.+1 = x.+1 + y => rewrite -[RHS]addnC end.
48 rewrite -[in RHS](@subnK 1 x.+1) //.
49 match goal with |- x.+1 = y + (x.+1 - 1 + 1) => rewrite subnK // end.
50 have H : x.+1 = y by myadmit.
51 set t := _.+1 in H |- *.
52 match goal with H : t = y |- t = y + t => rewrite /t {t} in H * end.
53 set t := (_.+1 in X in _ + X) in H |- *.
54 match goal with H : x.+1 = y |- x.+1 = y + t => rewrite /t {t} in H * end.
55 set t := 0. match goal with t := 0 |- x.+1 = y + x.+1 => clear t end.
56 set t := y + _. match goal with |- x.+1 = t => rewrite /t {t} end.
57 set t : nat := 0. clear t.
58 set t : nat := (x in RHS).
59 match goal with |- x.+1 = y + t.+1 => rewrite /t {t} end.
60 set t : nat := RHS. match goal with |- x.+1 = t => rewrite /t {t} end.
61 (* set t := 0 + _. *)
62 (* set t := (x).+1 in X in _ + X in H |-. *)
63 (* set t := (x).+1 in X in _ = X.*)
64 Admitted.