mietek / epigram2

Mirror of Epigram 2, by Conor McBride, et al.
https://code.google.com/p/epigram
MIT License
47 stars 7 forks source link

definitionsToImpl and magicImplName #58

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
(This issue is for documentation purposes, I don't fully understand the point 
of these functions yet. They just look very odd.)

In ProofState.Edition.Scope, there is a function called |definitionsToImpl| 
that filters the definitions in scope which name is |magicImplName|. This is an 
abuse of the naming scheme, with the risks you can expect.

Maybe there is no cleaner solution for the moment, or maybe (that's what I hope 
for) we can clean this up when we have a high-level system. Anyway, it's worth 
documenting here.

Original issue reported on code.google.com by pedag...@gmail.com on 26 Aug 2010 at 4:43

GoogleCodeExporter commented 8 years ago
The point of definitionsToImpl is to determine the local context for 
elimination with a motive: it allows us to drop all parameters above the 
implementation of a 'let' definition. The function, or something like it, may 
also be useful for relabelling (issue 23). Using the name of the goal to 
identify the relevant definition is a cheap and unproblematic hack; we could 
store a flag in the proof state if we wanted to be more principled.

Original comment by adamgundry on 31 Aug 2010 at 2:12