Debian Codegraph @

test-suite/bugs/bug_3282.v

raw
1 (* Check let-ins in fix and Fixpoint *)
2
3 Definition foo := fix f (m : nat) (o := true) (n : nat) {struct n} :=
4 match n with 0 => 0 | S n' => f 0 n' end.
5
6 Fixpoint f (m : nat) (o := true) (n : nat) {struct n} :=
7 match n with 0 => 0 | S n' => f 0 n' end.
8
9 Definition foo' := fix f {m : nat} (o := true) (n : nat) {struct n} :=
10 match n with 0 => 0 | S n' => f (m:=0) n' end.
11 Check foo' (m:=0) 0.
12
13 Fixpoint f' {m : nat} (o := true) (n : nat) {struct n} :=
14 match n with 0 => 0 | S n' => f' (m:=0) n' end.
15 Check f' (m:=0) 0.
16
17 CoInductive Stream := { hd : nat; tl : Stream }.
18
19 Definition cofoo := cofix f (o := true) {m} := {| hd := 0; tl := f (m:=0) |}.
20 Check cofoo (m:=0).
21
22 CoFixpoint cof (o := true) {m} := {| hd := 0; tl := cof (m:=0) |}.
23 Check cof (m:=0).
24
25 Definition cofoo' := cofix f {m} (o := true) := {| hd := 0; tl := f (m:=0) |}.
26 Check cofoo' (m:=0).
27
28 CoFixpoint cof' {m} (o := true) := {| hd := 0; tl := cof' (m:=0) |}.
29 Check cof' (m:=0).