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

[ fix #698 ] Safe reflection module #799

Merged
merged 23 commits into from
Jun 15, 2019
Merged

Conversation

gallais
Copy link
Member

@gallais gallais commented Jun 3, 2019

Now that Agda internalises all the properties we need, we should be able to
finally turn the --safe option on in the Reflection module.

@gallais gallais force-pushed the safe-reflection branch from ce028af to 9f7ddc6 Compare June 3, 2019 15:42
@gallais gallais force-pushed the safe-reflection branch from 53773bc to 18be8a9 Compare June 3, 2019 15:59
@MatthewDaggitt MatthewDaggitt modified the milestones: v1.1, agda-v2.6.1 Jun 6, 2019
@gallais gallais added the status: blocked-by-issue Progress on this issue or PR is blocked by another issue. label Jun 6, 2019
@L-TChen
Copy link
Member

L-TChen commented Jun 6, 2019

Defining a function over Term, Clause, etc. by structural recursion is painfully tedious, so I come up with a partial solution by packing every case in a record type and pre-cooking some instances like identity and an any instance for Term, etc.

Then, to define functions over them, one can use the record update syntax to change the necessary part leaving other cases as they are. For example, to check if a term contains some Meta, the only interesting case is meta : (x : Meta) → List (Arg Term) → Term so one only need to update the meta case in the any instance.

PS. I call it partial because

The above point can be done via Traversable or a general fold function.

  • recursor and eliminator should be generated by the reflection mechanism
  • the record update does not support copattern syntax, and I haven't figured out a suitable change for it.

@gallais
Copy link
Member Author

gallais commented Jun 6, 2019

I am not planning to write any additional traversals, I am just redistributing
and refactoring the existing functions and renaming them to be closer to conventions.

@gallais gallais removed the status: blocked-by-issue Progress on this issue or PR is blocked by another issue. label Jun 6, 2019
@gallais
Copy link
Member Author

gallais commented Jun 6, 2019

Last thing missing: the deprecated names moved to Reflection.Term.

@MatthewDaggitt MatthewDaggitt merged commit 7eb3cc0 into experimental Jun 15, 2019
@MatthewDaggitt MatthewDaggitt deleted the safe-reflection branch June 15, 2019 08:42
@MatthewDaggitt MatthewDaggitt modified the milestones: agda-v2.6.1, v1.3 Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants