aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite/failure
diff options
context:
space:
mode:
authorGravatar Matthieu Sozeau <mattam@mattam.org>2013-12-17 16:12:50 +0100
committerGravatar Matthieu Sozeau <mattam@mattam.org>2013-12-17 16:12:50 +0100
commit35e47b6be8d9e97b58464daccc28d179951b5e47 (patch)
tree09fd0f336e1fdd774ebbcd41d2849dfb54c76cb9 /test-suite/failure
parentfb59652405d0e6a9d1100142d473374cd82ae16b (diff)
Tentative fix of the guardedness checker by Christine and me. All stdlib and test-suite pass.
Diffstat (limited to 'test-suite/failure')
-rw-r--r--test-suite/failure/subterm.v45
1 files changed, 45 insertions, 0 deletions
diff --git a/test-suite/failure/subterm.v b/test-suite/failure/subterm.v
new file mode 100644
index 000000000..3798bc48f
--- /dev/null
+++ b/test-suite/failure/subterm.v
@@ -0,0 +1,45 @@
+Module Foo.
+ Inductive True2:Prop:= I2: (False->True2)->True2.
+
+ Axiom Heq: (False->True2)=True2.
+
+ Fail Fixpoint con (x:True2) :False :=
+ match x with
+ I2 f => con (match Heq with @eq_refl _ _ => f end)
+ end.
+End Foo.
+
+Require Import ClassicalFacts.
+
+Inductive True1 : Prop := I1 : True1
+with True2 : Prop := I2 : True1 -> True2.
+
+Section func_unit_discr.
+
+Hypothesis Heq : True1 = True2.
+
+Fail Fixpoint contradiction (u : True2) : False :=
+contradiction (
+ match u with
+ | I2 Tr =>
+ match Heq in (_ = T) return T with
+ | eq_refl => Tr
+ end
+ end).
+
+End func_unit_discr.
+
+Require Import Vectors.VectorDef.
+
+About caseS.
+About tl.
+Open Scope vector_scope.
+Local Notation "[]" := (@nil _).
+Local Notation "h :: t" := (@cons _ h _ t) (at level 60, right associativity).
+Definition is_nil {A n} (v : t A n) : bool := match v with [] => true | _ => false end.
+
+Fixpoint id {A n} (v : t A n) : t A n :=
+ match v in t _ n' return t A n' with
+ | (h :: t) as v' => h :: id (tl v')
+ |_ => []
+ end.