Re: [Haskell] Abusing quickcheck to check existential properties

2008-10-22 Thread Norman Ramsey
> > I guess what I would like is to reuse most of the mechanisms in > > QuickCheck to have it say one of these two things: > > > > 1. Found an satisfying instance after 73 tries: [gives instance] > > > > 2. After 100 tries, could not find a satisfying instance. > > > > Like failure,

Re: [Haskell] Abusing quickcheck to check existential properties

2008-10-22 Thread Colin Runciman
Norman, I guess what I would like is to reuse most of the mechanisms in QuickCheck to have it say one of these two things: 1. Found an satisfying instance after 73 tries: [gives instance] 2. After 100 tries, could not find a satisfying instance. Like failure, the first tells you something

Re: [Haskell] Abusing quickcheck to check existential properties

2008-10-21 Thread Rickard Nilsson
On Sun, 19 Oct 2008 00:39:32 +0200, Norman Ramsey <[EMAIL PROTECTED]> wrote: I guess what I would like is to reuse most of the mechanisms in QuickCheck to have it say one of these two things: 1. Found an satisfying instance after 73 tries: [gives instance] 2. After 100 tries, could not fin

Re: [Haskell] Abusing quickcheck to check existential properties

2008-10-18 Thread Norman Ramsey
> The answer is that QuickCheck can't correctly constructively verify an > existential condition without a constructive mechanism to generate the > existential (i.e. the Skolem function mentioned before). I agree but don't think it's relevant. QuickCheck can't verify a universal either. > If

Re: [Haskell] Abusing quickcheck to check existential properties

2008-10-14 Thread Ben Moseley
> there are similar > scenarios on which I've already given up in despair, such as writing a > generator for creating well-typed terms in a nontrivial language. This is something I've also struggled with. I'm coming to the conclusion that it'd really be useful for the "Gen" monad to be par

Re: [Haskell] Abusing quickcheck to check existential properties

2008-10-14 Thread Edward Kmett
The answer is that QuickCheck can't correctly constructively verify an existential condition without a constructive mechanism to generate the existential (i.e. the Skolem function mentioned before). If you think about it from a plausible reasoning and constructive logic sense, QuickCheck should no

Re: [Haskell] Abusing quickcheck to check existential properties

2008-10-14 Thread Norman Ramsey
> > But how do I use QuickCheck to check an existential? > > The "standard" method in QuickCheck is to be constructive, and > actually implement the function that constructs for the value. So, > instead of > > forAll x . exists y . P(x,y) > > you write > > forAll x . P(x, find_y(

Re: [Haskell] Abusing quickcheck to check existential properties

2008-10-13 Thread Koen Claessen
Hi Norman, > But how do I use QuickCheck to check an existential? The "standard" method in QuickCheck is to be constructive, and actually implement the function that constructs for the value. So, instead of forAll x . exists y . P(x,y) you write forAll x . P(x, find_y(x)) for a suitably i

[Haskell] Abusing quickcheck to check existential properties

2008-10-12 Thread Norman Ramsey
I recently used QuickCheck to check on some calculations for image compression. (I love exact rational arithmetic!) But I thought only to check for inverse properties, and I realized afterward I had failed to check for ranges. For example I should have checked that boundedB block = -1 <= b &&