Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
What's the motivation behind this kata? I don't understand why we're proving equality of a bunch of proof terms.
n
with a concrete value (e.g.S (S O)
), butn
is not being matched, so still no reduction is available. So, e.g.,strange 0
andstrange 1
are obviously not alpha-convertible. (Try using "Compute strange 0" to see.)u
withtt
does enable match-reduction, yielding(fun _ => tt) n
, followed by beta-reduction, to give justtt
.I loved the simplicity of this kata. Very cool.
Thanks, that's very helpful. (FYI, the "Insert Example" kata still uses the old-style tests, which is why this kata originally used that style.)
It's not a problem for the proof, but isn't it a bit odd that the optimized version uses
minus
? I would have expected something more along the lines ofThis way the same implementation can be used for types that support some form of addition but not subtraction. (e.g. You could compute all suffixes of a list.) It also uses fewer arithmetic operations because of not making the initial call to
sum
.Thanks! It should be fixed now. (The reason it slipped through is that I didn't realize that clicking "Validate Solution" only checks whichever test tab is currently selected.)