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

Sized data type analysis brittle, does not reduce size #2477

Closed
andreasabel opened this issue Feb 26, 2017 · 2 comments
Closed

Sized data type analysis brittle, does not reduce size #2477

andreasabel opened this issue Feb 26, 2017 · 2 comments
Assignees
Labels
sized types Sized types, termination checking with sized types, size inference type: bug Issues and pull requests about actual bugs
Milestone

Comments

@andreasabel
Copy link
Member

This should work, but Agda does not reduce i + 1 to ↑ i when analysing Nat. Subtyping fails silently.

open import Agda.Builtin.Size
open import Agda.Builtin.Nat using (suc) renaming (Nat to ℕ)

_+_ : Size  Size
s + 0 = s
s + suc n = ↑ (s + n)

data Nat : Size  Set where
  zero  :   i  Nat (i + 1)
  suc   :   i  Nat i  Nat (i + 1)

pred :  i  Nat i  Nat i
pred .(i + 1) (zero i)   =  zero i
pred .(i + 1) (suc i x)  =  x
@andreasabel andreasabel added type: bug Issues and pull requests about actual bugs sized types Sized types, termination checking with sized types, size inference labels Feb 26, 2017
@andreasabel andreasabel added this to the 2.5.3 milestone Feb 26, 2017
@andreasabel andreasabel self-assigned this Feb 26, 2017
andreasabel added a commit that referenced this issue Feb 26, 2017
@asr
Copy link
Member

asr commented Feb 27, 2017

From closing issues via commit messages:

To close an issue in the same repository, use one of the keywords in the list below followed by a reference to the issue number in the commit message.

@andreasabel, the commit message "Fixed issue #2477" didn't follow the above instructions, so I'm manually closing the issue.

@asr asr closed this as completed Feb 27, 2017
@andreasabel
Copy link
Member Author

Ah, yes that was stupid of me. It was late in the evening...

@asr asr changed the title Sized data type analysis brittle, does not reduce size Sized data type analysis brittle, does not reduce size Aug 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sized types Sized types, termination checking with sized types, size inference type: bug Issues and pull requests about actual bugs
Projects
None yet
Development

No branches or pull requests

2 participants