Debian Codegraph @

test-suite/ssr/ltac_have.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 Require Import ssrbool TestSuite.ssr_mini_mathcomp.
15
16 Ltac SUFF1 h t := suff h x (p := x < 0) : t.
17 Ltac SUFF2 h t := suff h x (p := x < 0) : t by apply h.
18 Ltac HAVE1 h t u := have h x (p := x < 0) : t := u.
19 Ltac HAVE2 h t := have h x (p := x < 0) : t by [].
20 Ltac HAVE3 h t := have h x (p := x < 0) : t.
21 Ltac HAVES h t := have suff h : t.
22 Ltac SUFFH h t := suff have h : t.
23
24 Lemma foo z : z < 0.
25 SUFF1 h1 (z+1 < 0).
26 Undo.
27 SUFF2 h2 (z < 0).
28 Undo.
29 HAVE1 h3 (z = z) (refl_equal z).
30 Undo.
31 HAVE2 h4 (z = z).
32 Undo.
33 HAVE3 h5 (z < 0).
34 Undo.
35 HAVES h6 (z < 1).
36 Undo.
37 SUFFH h7 (z < 1).
38 Undo.
39 Admitted.