mortberg / cubicaltt

Experimental implementation of Cubical Type Theory
https://arxiv.org/abs/1611.02108
MIT License
567 stars 76 forks source link

Evaluation priority idea #93

Open PaulGustafson opened 6 years ago

PaulGustafson commented 6 years ago

At his talk in San Diego yesterday, @guillaumebrunerie showed that making certain functions opaque can help with evaluating nasty terms. The problem is that sometimes the opaque functions have to be unfolded.

Here's my idea: annotate functions with evaluation priority levels. Using the convention that higher numbers correspond to higher priorities and that the default priority level is 0, we can replace opaque functions with priority level (-1) functions. Then the evaluator would treat them as opaque until it gets stuck, then try to evaluate them.

We can also play with partial evaluation by setting everything below a certain priority level as opaque.