Debian Codegraph @

test-suite/bugs/bug_20719.v

raw
1 CoInductive strm := { hd : nat; tl : strm }.
2
3 Definition foobar (i : unit) :=
4 cofix seq n := {| hd := match i with tt => n end; tl := seq (S n) |}.
5
6 CoFixpoint seq n := {| hd := n; tl := seq (S n) |}.
7
8 Check (@eq_refl (nat -> strm) seq) <<: foobar tt = seq.
9 Check (@eq_refl (nat -> strm) seq) <: foobar tt = seq.
10
11 Check eq_refl 5 <<: hd (foobar tt 5) = 5.
12 Check eq_refl 5 <: hd (foobar tt 5) = 5.
13
14 Check eq_refl 5 <<: hd (seq 5) = 5.
15 Check eq_refl 5 <: hd (seq 5) = 5.
16
17 CoFixpoint dummy (i : bool) := {| hd := 0; tl := dummy i |}.
18
19 Fail Check (eq_refl (dummy true)) <: (dummy true) = (dummy false).
20 Fail Check (eq_refl (dummy true)) <<: (dummy true) = (dummy false).
21
22 Set Warnings "-non-recursive".
23
24 CoInductive lazy T := Lazy : T -> lazy T.
25 CoFixpoint of_fun {T} f := Lazy T (f tt).
26 Definition force {T} v : T := match v with Lazy _ v => v end.
27
28 Check eq_refl 42 <<: (force (of_fun (fun _ => 42))) = 42.
29 Check eq_refl 42 <: (force (of_fun (fun _ => 42))) = 42.