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

TBT: Bug in size preservation regarding postulates #7270

Open
andreasabel opened this issue May 15, 2024 · 0 comments
Open

TBT: Bug in size preservation regarding postulates #7270

andreasabel opened this issue May 15, 2024 · 0 comments
Labels
postulate Concerning postulates. type: bug Issues and pull requests about actual bugs type-based-termination Concerning `--type-based-termination`
Milestone

Comments

@andreasabel
Copy link
Member

andreasabel commented May 15, 2024

TBT accepts this, but this is questionable, since it seems to assume too much about postulates:

{-# OPTIONS --type-based-termination #-}

record U : Set where
  coinductive
  field force : U
open U

postulate d : U  U

-- f is classified as size preserving, but is not, since d is unknown
-- Counterexamples: d = id; d u = u .force
f : U  U
f u = d u .force

-- This should not pass:
u : U
u .force = f u

I failed to exploit this bug, because TBT does not accept the same if we replace d by a module parameter (which we later could instantiate to something evil).
ATTN: @knisht

@andreasabel andreasabel added type: bug Issues and pull requests about actual bugs postulate Concerning postulates. type-based-termination Concerning `--type-based-termination` labels May 15, 2024
@andreasabel andreasabel added this to the 2.7.0 milestone May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postulate Concerning postulates. type: bug Issues and pull requests about actual bugs type-based-termination Concerning `--type-based-termination`
Projects
None yet
Development

No branches or pull requests

1 participant