Debian Codegraph @

test-suite/ssr/tc.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
16 Class foo (A : Type) : Type := mkFoo { val : A }.
17 #[export] Instance foo_pair {A B} {f1 : foo A} {f2 : foo B} : foo (A * B) | 2 :=
18 {| val := (@val _ f1, @val _ f2) |}.
19 #[export] Instance foo_nat : foo nat | 3 := {| val := 0 |}.
20
21 Definition id {A} (x : A) := x.
22 Axiom E : forall A {f : foo A} (a : A), id a = (@val _ f).
23
24 Lemma test (x : nat) : id true = true -> id x = 0.
25 Proof.
26 Fail move=> _; reflexivity.
27 Timeout 2 rewrite E => _; reflexivity.
28 Qed.
29
30 Definition P {A} (x : A) : Prop := x = x.
31 Axiom V : forall A {f : foo A} (x:A), P x -> P (id x).
32
33 Lemma test1 (x : nat) : P x -> P (id x).
34 Proof.
35 move=> px.
36 Timeout 2 Fail move/V: px.
37 Timeout 2 move/V : (px) => _.
38 move/(V nat) : px => H; exact H.
39 Qed.