Skip to content

Instantly share code, notes, and snippets.

@mietek
Last active July 21, 2019 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mietek/910b030087b96f27f0e6ed0f89f98c6d to your computer and use it in GitHub Desktop.
Save mietek/910b030087b96f27f0e6ed0f89f98c6d to your computer and use it in GitHub Desktop.
Breaking subject reduction in Coq, and not breaking it in Agda (any more)
-- More information:
-- http://coq-club.inria.narkive.com/3zS9pwcc/coinductive-types-and-type-preservation
-- https://lists.chalmers.se/pipermail/agda/2008/000383.html
module CoTest where
open import Prelude public
{-
CoInductive tick := Tick : tick -> tick.
CoFixpoint loop := Tick loop.
Definition etaeq : loop = loop :=
match loop with | Tick t => eq_refl (Tick t) end.
Definition BOOM :=
Eval compute in (etaeq : loop = loop).
-}
record tick : Set where
constructor Tick
coinductive
field
τ : tick
open tick public
loop : tick
τ loop = loop
etaeq : loop ≡ loop
etaeq = refl
test : (l : tick) l ≡ l
test l = {!refl {A = Tick (τ l)}!}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment