YT~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxy z { | } Safe 69:;AQRTThis class covers algebraic datatypes that can be transformed into Trees. subTypes is the main method, placing values into trees.)for a datatype with constructors A and C, =subTypes (A (C 0) 1) [Node {rootLabel = C 0, subForest = []}]2Turns algebraic data into a forest representation.-Base types (e.g., Int, Char) aren't analyzed.Generically replace child i in m with value s. A total function: returns Nothing if you try to replace a child with an ill-typed child s. (Returns Just (the original data) if your index is out of bounds). 1Get the string representation of the constructor. 6showForest generically shows a value while preserving its structure (in a Tree). Always returns either a singleton list containing the tree (a degenerate forest) or an empty list for baseTypes. An invariant is that the shape of the tree produced by showForest is the same as the one produced by subTypes.&Keep or substitue a value in the tree.Index into a Tree/Forest, where level is the depth from the root and column is the distance d is the dth value on the same level. Thus, all left-most nodes are in column 0. This is a "matrix view" of tree-structured data.Possible results of iterateArb.Base type. Won't analyze.=Couldn't satisfy the precondition of a QuickCheck propertydFailed the property---either we expect failure and it passes or we expect to pass it and we fail.(Satisfied it, with the satisfying value.SNominally, a list for value generalization indexes and existential generalization.@0Sort in order of depth first then left to right.I~  !"#$%&'()*+,-./0123456789:;<=>?@ABCD  #  1~    !"#$%&'()*+,-./0123456789:;<=>?@ABCDSafe#ATOpOur SmartCheck reimplementation of the main QuickCheck driver. We want to distinguish the first argument to a  property to be SmartChecked. In particular: the first argument will not be shrunk (even if there are default shrink instances for the type). However, the argument will be grown according to the the ~ argument to QuickCheck, in accordance with its generator. Other arguments will be shrunk, if they have shrinking instances.OOOOSafeT oReplace everything in the path from the root to here. Used as breadcrumbs to the value. Chop the subforest.+Replace a value and all of its subchildren.P}Return the list of values at each level in a Forest Not like levels in Data.Tree (but what I imagined it should have done!).@Return the elements at level i from a forest. 0-based indexing.QBGet the depth of a Forest. 0-based (an empty Forest has depth 0).,How many members are at level i in the Tree?RHGet the tree at idx in a forest. Nothing if the index is out-of-bounds.SPReturns the value at index idx. Returns nothing if the index is out of bounds.VXMake a substitution Forest (all proper children). Initially we don't replace anything.WFReplace a value at index idx generically in a Tree/Forest generically.PQRSValue Index of hole Maximum depth we want to extractTUVW Parent valueIndex of hole to replaceValue to replace withPQRSTUVWUSWRPVQT PQRSTUVWSafeT[Driver for iterateArb.\Replace the hole in d indexed by idx with a bunch of random values, and test the new d against the property. Returns the first new d (the full d but with the hole replaced) that succeeds. Succeeds is determined by the call to resultify---if we're expecting failure, then we succeed by getting a value that passes the precondition but fails the property; otherwise we succeed by getting a value that passes the precondition and satisfies the property. If no value ever satisfies the precondition, then we return FailedPreCond. (Thus, there's an implied linear order on the Result type: FailedPreCond < FailedProp < Result a.)kMake a new random value given a generator and a max size. Based on the value's type's arbitrary instance.]pPut a value v into a another value d at a hole idx, if v is well-typed. Return Nothing if dynamic typing fails.^wMake a QuickCheck Result by applying a property function to a value and then get out the Result using our result type.Get the maximum depth of a value, where depth is measured in the maximum depth of the tree representation, not counting base types (defined in Types.hs). [\Counterexample. Sub-value in the counterexample.Index of sub-value.Maximum number of iterations."Maximum size of value to generate. Property.<Number of times precondition is passed and returned result.]^_ Failed value Test to useWhat to do after the testPropertyMax depth to analyzeOnly evaluate at True indexes.Starting index to extrapolateList of generalized indices[\]^_[\^]_ [\]^_SafeT`CTrue if d matches any ds. Assume all ds are unequal to each other.At each index that we generalize (either value generalization or constructor generalization), we replace that value from b into a. At this point, we check for constructor equality between the two values, decending their structures.````Safe c How to show extrapolated formuladQuickCheck argumentse{Maximum size of data to generate, in terms of the size parameter of QuickCheck's Arbitrary instance for your data.fHow many levels into the structure of the failed value should we descend when reducing or generalizing? Nothing means we go down to base types.gJHow hard (number of rounds) to look for failure in the reduction stage.hShould we extrapolate?iVHow hard (number of rounds) to look for failures during the extrapolation stage.jTMinimum number of times a property's precondition must be passed to generalize it.k,Should we try to generalize constructors?lHow hard (number of rounds) to look for failing values with each constructor. For "wide" sum types, this value should be increased.abcdefghijklmnopabcdefghijklmnopabcdefghijklpmnoa bcdefghijklmnopSafeEAt each index into d from idxs, replace the whole with a fresh value.Make a string out a Tree of Strings. Put parentheses around complex subterms, where "complex" means we have two or more items (i.e., there's a space).vwvwwvvwSafe:xEntry point to generalize constructors. We pass in a list of indexes from value generalizations so we don't try to generalize those constructors (or anything below).2Return True if we can generalize; False otherwise.For a value a (used just for typing), and a list of representations of constructors cs, arbSubset generages a new value b, if possible, such that b has the same type as a, and b's constructor is not found in cs.3Assumes there is some new constructor to test with.%Get the constructor at an index in x.xxxx SafeTyTest d with arbitrary values replacing its children. For anything we get 100% failure for, we claim we can generalize it---any term in that hole fails.We extrapolate if there exists at least one test that satisfies the precondition, and for all tests that satisfy the precondition, they fail.y ArgumentsCurrent failed valueOriginal propertyyyy SafeTBreadth-first traversal of d, trying to shrink it with *strictly* smaller children. We replace d whenever a successful shrink is found and try again.Get the maximum depth of d's subforest at idx. Intuitively, it's the maximum number of constructors you have *below* the constructor at idx. So for a unary constructor C, the value [C, C, C](:) C (:) C (:) C []At (Idx 0 0) in v, we're at C, so subValSize v (Idx 0 0) == 0. At (Idx 0 1) in v, we're at (C : C : []), so subValSize v (Idx 0 1) == 2, since we have the constructors :, C (or :, []) in the longest path underneath. Base-types have subValSize 0. So subValSize [1,2,3] idx == 0 for any idx. Note that if we have subValSize d idx == 0, then it is impossible to construct a *structurally* smaller value at hole idx.zzzz Safe9:;T{Main interface function.}Run QuickCheck, to get a counterexamples for each argument, including the one we want to focus on for SmartCheck, which is the first argument. That argument is never shrunk by QuickCheck, but others may be shrunk by QuickCheck. Returns the value (if it exists) and a Property (by applying the property method to the Testable value). In each iteration of }<, non-SmartCheck arguments are not necessarily held constantReturns % if a counterexample is returned and  otherwise. {|}  abcdefghijklmnop{|}{|}  {|}  !"# $$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijjklmnopqrstuvwxyz{|}~     'smartcheck-0.2.4-8nhB6Ez7Pvy1sD6tqVS4I1Test.SmartCheck.TestTest.SmartCheck.TypesTest.SmartCheck.DataToTreeTest.SmartCheck.SmartGenTest.SmartCheck.MatchesTest.SmartCheck.ArgsTest.SmartCheck.RenderTest.SmartCheck.ConstructorGenTest.SmartCheck.ExtrapolateTest.SmartCheck.ReduceTest.SmartCheck'QuickCheck-2.8.2-Lc9M67xSkgd1rELb7JNJD3Test.QuickCheck.TeststdArgsgstgrcgtcgsfSubTypessubTypesbaseType replaceChildtoConstr showForestSubTunSubTSubstKeepIdxlevelcolumnResultBaseType FailedPreCond FailedPropReplaceunVals unConstrssubTerrorMsg$fSubTypes(,,,,)$fSubTypes(,,,)$fSubTypes(,,) $fSubTypes(,)$fSubTypesEither$fSubTypesMaybe$fSubTypesComplex$fSubTypesRatio $fSubTypes[] $fSubTypes()$fSubTypesWord64$fSubTypesWord32$fSubTypesWord16$fSubTypesWord8$fSubTypesWord$fSubTypesInt64$fSubTypesInt32$fSubTypesInt16$fSubTypesInt8$fSubTypesInteger $fSubTypesInt$fSubTypesFloat$fSubTypesDouble$fSubTypesChar$fSubTypesBool$fGSTK1$fGSTM1$fGSTM10$fGST:+:$fGST:*:$fGSTU1 $fShowSubT$fOrdIdx $fShowIdx$fApplicativeResult $fMonadResult$fFunctorResult $fShowReplace $fReadReplace $fEqReplace $fShowResult $fReadResult $fEqResult$fEqIdx $fShowSubst $fEqSubst $fReadSubstscQuickCheckWithResult breadthLevelsdepth getIdxForestgetAtIdxtooDeepforestReplaceChildren mkSubstForest replaceAtIdx$fShowSubStrat$fReadSubStrat $fEqSubStrat iterateArbIdx iterateArbreplace resultifyiter matchesShapesScArgsformatqcArgs scMaxSize scMaxDepth scMaxReduce runForall scMaxForall scMinForall runExists scMaxExistsFormat PrintTree PrintString scStdArgs $fEqFormat $fReadFormat $fShowFormat $fShowScArgs $fReadScArgs smartPrtLnrenderWithVars constrsGen extrapolatesmartRun smartChecksmartCheckInputrunQCGSTgsz toConstr' replaceChild' showForest'Test.QuickCheck.PropertyTestablemaxSizetest doneTestinggiveUprunATestsummarysuccesslabelPercentage foundFailurelocalMin localMin' localMinFoundcallbackPostTestcallbackPostFinalFailuresafelyParentChildrengetLevel levelLengthSubStratforestReplaceParentsubnewValvalDepthNextTest matchesShapereplaceWithVars stitchTreeVarRepl smartPrefixextrapolateConstrs arbSubset subConstr smartShrink subValSize resultToMaybe failureResghc-prim GHC.TypesTrueFalse smartCheckRun existsExtrap forallExtrapshowExtrapOutput runAgainMsg