summaryrefslogtreecommitdiff
path: root/test-suite/output/Notations2.v
diff options
context:
space:
mode:
Diffstat (limited to 'test-suite/output/Notations2.v')
-rw-r--r--test-suite/output/Notations2.v33
1 files changed, 31 insertions, 2 deletions
diff --git a/test-suite/output/Notations2.v b/test-suite/output/Notations2.v
index ceb29d1b..bcb24687 100644
--- a/test-suite/output/Notations2.v
+++ b/test-suite/output/Notations2.v
@@ -36,8 +36,9 @@ Check fun P:nat->nat->Prop => fun x:nat => ex (P x).
(* Test notations with binders *)
-Notation "∃ x .. y , P":= (ex (fun x => .. (ex (fun y => P)) ..))
- (x binder, y binder, at level 200, right associativity).
+Notation "∃ x .. y , P":= (ex (fun x => .. (ex (fun y => P)) ..))
+ (x binder, y binder, at level 200, right associativity,
+ format "'[ ' ∃ x .. y ']' , P").
Check (∃ n p, n+p=0).
@@ -78,6 +79,13 @@ Notation plus2 n := (S (S n)).
(* plus2 was not correctly printed in the two following tests in 8.3pl1 *)
Print plus2.
Check fun n => match n with list1 => 0 | _ => 2 end.
+Unset Printing Allow Match Default Clause.
+Check fun n => match n with list1 => 0 | _ => 2 end.
+Unset Printing Factorizable Match Patterns.
+Check fun n => match n with list1 => 0 | _ => 2 end.
+Set Printing Allow Match Default Clause.
+Set Printing Factorizable Match Patterns.
+
End A.
(* This one is not fully satisfactory because binders in the same type
@@ -145,3 +153,24 @@ Check .a≡.
Notation ".α" := nat.
Check nat.
Check .α.
+
+(* A test for #6304 *)
+
+Module M6304.
+Notation "'for' m 'from' 0 'to' N 'updating' ( s1 ) {{ b }} ;; rest" :=
+ (let s1 :=
+ (fix rec(n: nat) := match n with
+ | 0 => s1
+ | S m => let s1 := rec m in b
+ end) N
+ in rest)
+ (at level 20).
+
+Check fun (a b : nat) =>
+ let res := 0 in
+ for i from 0 to a updating (res) {{
+ for j from 0 to b updating (res) {{ S res }};;
+ res
+ }};; res.
+
+End M6304.