aboutsummaryrefslogtreecommitdiff
path: root/mathcomp/ssrtest
diff options
context:
space:
mode:
authorEnrico Tassi2016-12-06 15:48:31 +0100
committerEnrico Tassi2016-12-06 16:31:01 +0100
commit30c25338db99c34c43587a004afc65094ddf32bc (patch)
treea3a6fa8b05b42e2d912ff05e2c22e862d399c8c0 /mathcomp/ssrtest
parent41916775e9f68ddfa78040a803a2426415137c94 (diff)
add test for unfolding primitive projections
Diffstat (limited to 'mathcomp/ssrtest')
-rw-r--r--mathcomp/ssrtest/Make1
-rw-r--r--mathcomp/ssrtest/primproj.v60
2 files changed, 61 insertions, 0 deletions
diff --git a/mathcomp/ssrtest/Make b/mathcomp/ssrtest/Make
index ab4c666..6033c13 100644
--- a/mathcomp/ssrtest/Make
+++ b/mathcomp/ssrtest/Make
@@ -26,6 +26,7 @@ move_after.v
multiview.v
occarrow.v
patnoX.v
+primproj.v
rewpatterns.v
set_lamda.v
set_pattern.v
diff --git a/mathcomp/ssrtest/primproj.v b/mathcomp/ssrtest/primproj.v
new file mode 100644
index 0000000..25afb28
--- /dev/null
+++ b/mathcomp/ssrtest/primproj.v
@@ -0,0 +1,60 @@
+From mathcomp Require Import ssreflect.
+
+
+Set Primitive Projections.
+
+Module T1.
+
+Record foo A := Foo { foo_car : A }.
+
+Definition bar : foo _ := Foo nat 10.
+
+Goal foo_car _ bar = 10.
+match goal with
+| |- foo_car _ bar = 10 => idtac
+end.
+rewrite /foo_car.
+Fail match goal with
+| |- foo_car _ bar = 10 => idtac
+end.
+Admitted.
+
+End T1.
+
+
+Module T2.
+
+Record foo {A} := Foo { foo_car : A }.
+
+Definition bar : foo := Foo nat 10.
+
+Goal foo_car bar = 10.
+match goal with
+| |- foo_car bar = 10 => idtac
+end.
+rewrite /foo_car.
+Fail match goal with
+| |- foo_car bar = 10 => idtac
+end.
+Admitted.
+
+End T2.
+
+
+Module T3.
+
+Record foo {A} := Foo { foo_car : A }.
+
+Definition bar : foo := Foo nat 10.
+
+Goal foo_car bar = 10.
+rewrite -[foo_car _]/(id _).
+match goal with |- id _ = 10 => idtac end.
+Admitted.
+
+Goal foo_car bar = 10.
+set x := foo_car _.
+match goal with |- x = 10 => idtac end.
+Admitted.
+
+End T3. \ No newline at end of file