My Coq solution appears in the book that I'm working on:
http://adam.chlipala.net/cpdt/html/MoreDep.html#lab49
You can define a test for whether a key is in a tree ("present" in my
solution), and the property to prove is that any value x is in the
result of inserting y into a tree T iff x = y or x is in T.
>>You can define a test for whether a key is in a tree ("present" in my
>>solution), and the property to prove is that any value x is in the
>>result of inserting y into a tree T iff x = y or x is in T.
I see. I assume that this does not imply that a binary search always
finds x in T if x is in T, right?
I'm not sure what you mean. My solution doesn't even have a lookup
function defined.
I am trying to see if the code still typechecks if I change
le_lt_dec x y
into
le_lt_dec y x
The insert function still type-checks. My solution doesn't verify that
the trees being constructed are binary search trees. That would be easy
to prove as an additional after-the-fact theorem.