[Haskell-cafe] is proof by testing possible?
jfredett at gmail.com
Mon Oct 12 13:57:27 EDT 2009
Really? How? That sounds very interesting, I've got a fair knowledge
of basic topology, I'd love to see an application
On Oct 12, 2009, at 1:55 PM, Eugene Kirpichov wrote:
> It is possible for functions with compact domain, not just finite.
> 2009/10/12 Joe Fredette <jfredett at gmail.com>:
>> In general? No- If we had an implementation of the `sin` function,
>> how can
>> testing a finite number of points along it determine
>> if that implementation is correct for every point?
>> For specific functions (particularly those with finite domain), it is
>> possible. If you know the 'correct' output of every input, then
>> testing each
>> input and ensuring correct output will work. Consider the
>> definition of the
>> `not` function on booleans. The domain only has two elements (True
>> False) and the range has only two outputs (True and False), so if I
>> every input, and insure it maps appropriately to the specified
>> output, we're
>> all set.
>> Basically, if you can write your function as a big case statement
>> covers the whole domain, and that domain is finite, then the
>> function can be
>> tested to prove it's correctness.
>> Now, I should think the Muad'Dib would know that, perhaps you
>> should go back
>> to studying with the Mentats. :)
>> On Oct 12, 2009, at 1:42 PM, muad wrote:
>>> Is it possible to prove correctness of a functions by testing it?
>>> I think
>>> tests would have to be constructed by inspecting the shape of the
>>> View this message in context:
>>> Sent from the Haskell - Haskell-Cafe mailing list archive at
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe at haskell.org
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
> Eugene Kirpichov
> Web IR developer, market.yandex.ru
More information about the Haskell-Cafe