Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

bladyjoker
Copy link
Contributor

@bladyjoker bladyjoker commented Mar 21, 2023

DONE

  • Removed CycledGoals error because it makes
sum Rec = MkRec Rec | Int

derive Eq Rec

fail because of the cycle.

Talking to @Saizan and @Anniepoo made me realize that we actually want p :- p to be true, which after digging a bit more seems like it's a form of logic called co-inductive logic.
Intuitively, I adjusted the resolution procedure to find ancestor goals that 'unify' with the current one, and if one was found, just return the shared bindings after 'ancestor' unified with 'current'. This seems to match the operational semantics of co-inductive goal resolution.

Not entirely sure what the implications of this whole thing is, tried thinkering with it and provide some tests, so far it seems to behave exactly as one would expect from a type class system.

References:

@bladyjoker bladyjoker added the compiler Work related to the Lambda Buffers Compiler label Mar 21, 2023
@bladyjoker bladyjoker self-assigned this Mar 21, 2023
@bladyjoker bladyjoker merged commit 17b604c into main Mar 21, 2023
@bladyjoker bladyjoker deleted the bladyjoker/compiler branch March 21, 2023 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Work related to the Lambda Buffers Compiler
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant