Permalink
Browse files

Notes updates.

  • Loading branch information...
leepike committed Sep 16, 2012
1 parent 6aa85cc commit 25d6ce31f03d50ef5c80dba6368106430e53b4c1
Showing with 67 additions and 0 deletions.
  1. +67 −0 refs/README.txt
View
@@ -20,6 +20,72 @@
* GenCheck https://github.com/JacquesCarette/GenCheck
+* Dart-check: http://code.google.com/p/dart-immutable/ (and G+ post by Paul
+ Brauner)
+
+* Feat: Functional Enumeration of Algebraic Types: http://wiki.portal.chalmers.se/cse/pmwiki.php/FP/Testing-Feat
+
+-- notes -----------------------------------------------------------------------
+
+We'd love to just say that we can't further reduce some hole in a datatype if at
+the hole, we have a depth of 0. However, consider the following. In d0, the
+hole (D0 (H I)) has three constructors. But there is no possible smaller value
+to put in here. So we just have to test if we can make something smaller.
+
+We could do a static analysis to figure this out, if we can get the arity of
+constructors at compile-time.
+
+data I = I
+ deriving (Show, Read, Typeable, Generic)
+
+instance SubTypes I
+
+instance Arbitrary I where
+ arbitrary = undefined
+
+data H = H I
+ deriving (Show, Read, Typeable, Generic)
+
+instance SubTypes H
+
+instance Arbitrary H where
+ arbitrary = undefined
+
+data D = D0 H
+ | D1 D
+ | D2 D D
+-- | D3 String
+ deriving (Show, Read, Typeable, Generic)
+
+instance SubTypes D
+
+instance Arbitrary D where
+ arbitrary = undefined
+
+d0 = D2 (D0 (H I)) (D1 (D1 (D0 (H I))))
+
+samples generates values based on arbitrary, using sized to control size.
+This may have no relation to how many constructors there are in the depth of
+the value, although it'll likely strongly coorelate with it. There are a few
+options: (1) Ask the user to ensure that the definition of the arbitrary
+instance satisfies our invariant. (2) Try to make an infinite (or
+sufficiently long) list of values in ascending size and dynamicly ensure we
+take a value sufficiently small. (3) Try to overapproximate the size and
+still do a dynamic check.
+
+(1) Is very hard for the user to check. (2) is also difficult, because the
+very definition of arbitrary randomly generates values in a range of sizes.
+So we really want to sort this list, which can only be done if it's finite.
+(3) is an approximate solution insofar as it requires some computation we'd
+like to avoid.
+
+Finally, it'd be good to generate values lazily, to avoid generating
+intermediate values.
+
+What I really want is a bijection from a set of sized value to values, and a
+function taking a value, and telling me what sized was used.
+
+
-- xmonad ----------------------------------------------------------------------
* internals overview:
@@ -69,3 +135,4 @@ or to test individual props:
constructors.
* Kinds of type coverage: exists some contructor to fail...
+

0 comments on commit 25d6ce3

Please sign in to comment.