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

Record inheritance #42

Open
re-xyr opened this issue Jun 14, 2021 · 6 comments
Open

Record inheritance #42

re-xyr opened this issue Jun 14, 2021 · 6 comments

Comments

@re-xyr
Copy link
Member

re-xyr commented Jun 14, 2021

How to do this? In Lean, if structure a extends b, then we can build a by either { to_b := some_b_instance, <fields of a> } or { <fields of b>, <fields of a> }. When accessing some b field in an a instance, we can either use a.field or a.to_b.field.

@ice1000
Copy link
Member

ice1000 commented Jun 14, 2021

We need to implement aya-prover/aya-prover-proto#150 (which, I guess, is related to aya-prover/aya-prover-proto#128) first

@re-xyr
Copy link
Member Author

re-xyr commented Jun 14, 2021

So we should implement in this order:

  • typeclass w/o inheritance
  • coercion as typeclass
  • record inheritance through coercion
  • typeclass inheritance through record inheritance

@ice1000
Copy link
Member

ice1000 commented Jun 14, 2021

... and built-in definitions.

@ice1000
Copy link
Member

ice1000 commented Jun 14, 2021

I mean pragmas that make definitions interact with built-in features

@ice1000
Copy link
Member

ice1000 commented Jun 14, 2021

So we should implement in this order:

  • typeclass w/o inheritance
  • coercion as typeclass
  • record inheritance through coercion
  • typeclass inheritance through record inheritance

No, in this order:

@ice1000
Copy link
Member

ice1000 commented Jun 14, 2021

In Arend, they have this:

class Functor F
 | bleh

class Monad F extends Functor
 | blah

instance ok : Functor Bla
 | bleh

instance ko : Monad Bla
 | Functor => ok
 | bleh => *&^%$#$%^&

@ice1000 ice1000 transferred this issue from aya-prover/aya-prover-proto Sep 28, 2021
@mio-19 mio-19 mentioned this issue Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants