Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite rules for functions with irrelevant arguments is broken #2300

Closed
jespercockx opened this issue Nov 9, 2016 · 2 comments
Assignees
Milestone

Comments

@jespercockx
Copy link
Member

@jespercockx jespercockx commented Nov 9, 2016

The following doesn't work:

{-# OPTIONS --rewriting #-}

open import Agda.Builtin.Equality
{-# BUILTIN REWRITE _≡_ #-}

postulate
  A : Set
  f : A  A
  h : .A  A  A
  rew :  {x}  h (f x) x ≡ x

test : (x : A)  h (f x) x ≡ x
test x = ? refl

This is clearly insane. More generally, I'd expect the following to work as well, since irrelevant arguments should be, well, irrelevant:

test2 : (x : A) → h x x ≡ x
test2 x = refl
@jespercockx

This comment has been minimized.

Copy link
Member Author

@jespercockx jespercockx commented Nov 9, 2016

D'oh, I forgot to add the {-# REWRITE rew #-}, so the first example is invalid. Still, I think the second example should work as well.

@jespercockx

This comment has been minimized.

Copy link
Member Author

@jespercockx jespercockx commented Nov 10, 2016

Hm, my fix broke something else. The following used to work:

postulate
  r : .A → A
  s : .A → A
  rewr : ∀ x → r x ≡ s x
{-# REWRITE rewr #-}

It would be nice to have some way to bind irrelevant arguments without actually requiring them to be equal.

@jespercockx jespercockx reopened this Nov 10, 2016
@asr asr added this to the 2.5.2 milestone Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.