Replace use of impossible idiom with proof by reflection#409
Conversation
…uctor for lookup which uses proof by reflection in Lambda.
wadler
left a comment
There was a problem hiding this comment.
Nice!
I like the use of monus as an example.
"it is very painful to use" --> "it is painful to use"
"know the two numbers statically" --> "at the point minus is called"
"The trick is ..." Recall the definition of T (as a sentence, not code) and give a backwards reference to the place it is defined.
"For instance, _n≤m_254 : ⊥." --> "For instance, if we call 3 - 5 we get "
"We obtain ..." Same for toWitness. Possibly restructure, to do this for T and toWitness together.
"as long as we statically know the two numbers" --> "as long as we provide known numbers"
Explain how you can write x - y where x and y are known variables. I presume we can write something like
minus : (m n : ℕ) (n≤m : n ≤ m) → ℕ
minus m n n≤m = - m n {f n≤m}
for a suitable choice of f?
The exercise refers to True, but the text refers to T.
This technique is really only useful when both arguments to Furthermore,
True is defined just before the exercise and is distinct from T. |
|
@wadler This is now done. Could you review the changes? |
The purpose of this WIP pull request is to slowly remove all usage of the
impossibleidiom by proof-by-reflection. A new development in Agda has made it possible to do this without using instance search.Truein Decidable;Falsein Decidable;Sconstructor in Lambda with a version which checks the inequality implicitly;