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

Add the notion of a DeepThunk and generation for this #35

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Equilibris
Copy link
Collaborator

@Equilibris Equilibris commented Jul 25, 2024

When it comes to expressing co-recursive functions, a state type is required to seed the progress. This state often also stores at what point the expression is in. This can be for a corec function on streams that repeats each element once more can have a state of a boolean and the stream that flips the boolean every other emission. This behaviour can be a bit funny to encode correctly in general corec functions so we use DeepThunk (the trace) to construct it instead. Generation of these objects takes a bit of work as seen in Ind.lean but the general categorical object resides in DeepThunk.lean.

Additionally, to this we split some files out and move some code around. This might be worth doing in a separate PR though.

@Equilibris Equilibris requested a review from alexkeizer as a code owner July 25, 2024 14:40
@alexkeizer
Copy link
Owner

See comments on the other PR, they also apply here

@alexkeizer alexkeizer marked this pull request as draft July 26, 2024 12:07
@Equilibris Equilibris changed the title Codef 3 deep thunk Add the notion of a DeepThunk and generation for this Aug 8, 2024
@@ -0,0 +1,66 @@
import Qpf.Macro.Data.Replace
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this maybe be a separate PR?

Copy link
Contributor

@AtticusKuhn AtticusKuhn Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. It seems like this functionality was just lifted from another file ("Ind.lean") and so it is a non-functional refactoring. I think it would be good to make a small pr of the form "[NFC] Chore: refactor Recursive form functionality into a separate file".

Copy link
Contributor

@AtticusKuhn AtticusKuhn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand this code at a deep level. There seem to be a lot of macros and quotations and syntaxes.

I think at a high level, this PR would be easier to understand if you split this PR up into at least three separate PRs:

  1. Refactor "RecursionForm" into a separate file
  2. Add the notion of a "DeepThunk"
  3. Add syntax support for Deepthunks in the quotations.

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

Successfully merging this pull request may close these issues.

3 participants