!/)      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  (c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None2BE extrapolateLike ) but uses holes for unrepeated variables.F extrapolateLike ) but uses holes for unrepeated variables.H extrapolateO(n)&. Replaces the function in the given  . replaceFun timesE (plusE :$ one :$ two) = timesE :$ one :$ two replaceFun absE (idE :$ one) = absE :$ one replaceFun two (one) = two      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQR STUVWXYZ[\]^_`abcdefg hijklmnopqrstuvwxyz{|}~EFGHEFGH(c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None3sI extrapolatemGiven boolean expression representing a counter-example, returns all possible unconditional generalizations.]If more than one generalization is returned, they are _not_ instances of one another. (cf. C) All according to a given function that lists ground expressions. 9> counterExampleGeneralizations (groundsFor not) false [] W> counterExampleGeneralizations (groundsFor not) (false -&&- true) [False && p :: Bool] E> counterExampleGeneralizations (groundsFor not) (false -||- true) [] T> counterExampleGeneralizations (groundsFor not) (false -/=- false) [p /= p :: Bool] > counterExampleGeneralizations (groundsFor not) (false -&&- true -&&- false) [ (False && _) && _ :: Bool , p && False :: Bool ]J extrapolate;Returns candidate generalizations for an expression. (cf. L)PThis takes a function that returns whether to generalize a given subexpression. > import Data.Express.Fixtures > candidateGeneralizations (\e -> typ e == typ one) (one -+- two) [ _ :: Int , _ + _ :: Int , x + x :: Int , _ + 2 :: Int , 1 + _ :: Int ] > candidateGeneralizations (const True) (one -+- two) [ _ :: Int , _ _ :: Int , _ _ _ :: Int , _ x x :: Int , _ 1 _ :: Int , _ + _ :: Int , x + x :: Int , _ 2 :: Int , _ _ 2 :: Int , _ 1 2 :: Int , _ + 2 :: Int , 1 + _ :: Int ]K extrapolateLike Jj but faster because result is not canonicalized. Variable names will be repeated across different types.L extrapolateZReturns candidate generalizations for an expression by replacing values with holes. (cf. J) > import Data.Express.Fixtures > candidateHoleGeneralizations (\e -> typ e == typ one) (one -+- two) [ _ :: Int , _ + _ :: Int , _ + 2 :: Int , 1 + _ :: Int ] > candidateHoleGeneralizations (const True) (one -+- two) [ _ :: Int , _ _ :: Int , _ _ _ :: Int , _ 1 _ :: Int , _ + _ :: Int , _ 2 :: Int , _ _ 2 :: Int , _ 1 2 :: Int , _ + 2 :: Int , 1 + _ :: Int ]      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQR STUVWXYZ[\]^_`abcdefg hijklmnopqrstuvwxyz{|}~EFGHIJKLIJKL(c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None8PMNOPQRSTUVWXYZ[\]^_`abcdefghMNOPQRSTUVWXYZ[\]^_`abcdefgh(c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Safe;ijklmnopqrstuvwxyz{|}~lkjimnopqrstuvwxyz{|}~l5(c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None>m  (c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>NoneQ extrapolateCExtrapolate can generalize counter-examples of any types that are .! types must first be instances ofD/, so Extrapolate knows how to enumerate values;6, so Extrapolate can represent then manipulate values; -, so Extrapolate knows how to name variables.AThere are no required functions, so we can define instances with: instance Generalizable OurType(However, it is desirable to define both  and .8The following example shows a datatype and its instance: (data Stack a = Stack a (Stack a) | Empty finstance Generalizable a => Generalizable (Stack a) where subInstances s = instances (argTy1of1 s) To declare : it may be useful to use type binding operators such as: T, U and V..Instances can be automatically derived using  * which will also automatically derivate D,  and   when needed. extrapolateEList of symbols allowed to appear in side-conditions. Defaults to []. See . extrapolate=Computes a list of reified subtype instances. Defaults to  . See . extrapolateUsage: ins "x" (undefined :: Type) extrapolateUsed in the definition of  in  typeclass instances.      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQR STUVWXYZ[\]^_`abcdefg hDBCijklmnopqrstuvwxyz{|}~EFGHDBC (c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None2W (c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Noneg extrapolate Derives a  instance for a given type .7If needed, this function also automatically derivates D,  and  instances using respectively deriveListable,  and f.Consider the following Stack datatype: (data Stack a = Stack a (Stack a) | EmptyWriting deriveGeneralizable ''Stack(will automatically derive the following  instance: instance Generalizable a => Generalizable (Stack a) where instances s = this "s" s $ let Stack x y = Stack undefined undefined `asTypeOf` s in instances x . instances yThis function needs the TemplateHaskell extension. extrapolateSame as 4 but does not warn when instance already exists ( is preferable). extrapolate Derives a  instance for a given type 3 cascading derivation of type arguments as well. (c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Noneh(c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None2j<      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQR STUVWXYZ[\]^_`abcdefg h !"#$%&'()*+,-./0123456789:;<=>?@ADBCijklmnopqrstuvwxyz{|}~EFGHIJKL8 !"#$%&'()*+,-./0123456789:;<=>?@ADBC (c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None extrapolateUse / to configure the number of tests performed by check. ]> check `for` 10080 $ \xs -> sort (sort xs) == sort (xs :: [Int]) +++ OK, passed 10080 tests.Don't forget the dollar ()! extrapolatefAllows the user to customize instance information available when generalized. (For advanced users.) extrapolateUse > to provide additional functions to appear in side-conditions. check `withBackground` [value "isSpace" isSpace] $ \xs -> unwords (words xs) == xs *** Failed! Falsifiable (after 4 tests): " " Generalization: ' ':_ Conditional Generalization: c:_ when isSpace c extrapolateUse 1 to configure the maximum condition size allowed. extrapolate&Checks a property printing results on stdout > check $ \xs -> sort (sort xs) == sort (xs::[Int]) +++ OK, passed 360 tests. > check $ \xs ys -> xs `union` ys == ys `union` (xs::[Int]) *** Failed! Falsifiable (after 4 tests): [] [0,0] Generalization: [] (x:x:_) extrapolate(Check a property printing results on stdout and returning  on success.JThere is no option to silence this function: for silence, you should use .(c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Nonee  !"#$%&'()*+,-./0123456789:;<=>?@ADBCMNOPQRSTUVWXYZ[\]^_`abcdefghP   !"#$%&'()*+,-./0123456789:;<=>?@ADBC !"#"$%&'%&(%&)%&*%&+%&,%&-%&.%&/%&0%&1%&2%&3%&4%56%57%89%8:%8;%8<%8=%8>%8?%8@%8A%BC%BD%BE%B%BF%BG%BH%BI%BJ%BK%BL%BM%BN%BO%BP%BQ%BR%BS%BT%BU%BV%BW%BX%BY%BZ%B[%B\%B]%B^%B_`abcdefghijklmnopqrstuvwxyz{|}~                !"#$%&'()*+,-./012345678797:7;7<=>=?=@ABACADAEAFAGAHIJIKILIMINIOIPIQRSRTRURVRWRXRYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}|~|||||||||||||||"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$(extrapolate-0.4.1-EbsRR4hp6TG8fGlgq4t0jKTest.Extrapolate.ExprTest.ExtrapolateTest.Extrapolate.SpeculationTest.Extrapolate.CoreTest.Extrapolate.GeneralizableTest.Extrapolate.GeneralizationTest.Extrapolate.TypeBindingTest.Extrapolate.UtilsTest.Extrapolate.Testable%Test.Extrapolate.Generalizable.Derive*Test.Extrapolate.ConditionalGeneralizationTest.Extrapolate.IOTest.Extrapolate.DerivederiveGeneralizableTest.LeanCheckholds$express-0.1.1-6e6PprmuuMwHXFvA6dCLO5Data.Express.Fixtures-&&-falseData.Express.Instances reifyEqOrdreifyOrdreifyEqData.Express.ExpressexprExpressData.Express.Corevalvalue:$ValueExprData.Express.NamenameName&leancheck-0.9.1-1FbGFs7QjX79TPcPwvEfzWTest.LeanCheck.Tiers listsOfLengthsetsOfbagsOf noDupListsOf normalizeTdeleteTproductslistsOfproductMaybeWith product3With noDupListConsmapConssetConsbagConsTest.LeanCheck.DerivederiveListableCascadingderiveListableTest.LeanCheck.Basic addWeightofWeightcons12cons11cons10cons9cons8cons7cons6Test.LeanCheck.Core==>existsfailswitness witnesses><\\//\/+|suchThatresetdelaycons5cons4cons3cons2cons1cons0 concatMapTconcatTfilterTmapT tiersFloatingtiersFractional listIntegraltoTierslisttiersListablecanonicalizeUsingHolescanonicalizeUsingHolesWithunand replaceFuncounterExampleGeneralizationscandidateGeneralizationsfastCandidateGeneralizationscandidateHoleGeneralizationsarg1arg2arg3arg4arg5arg6==: argTy1of1 argTy1of2 argTy2of2 argTy1of3 argTy2of3 argTy3of3 argTy1of4 argTy2of4 argTy3of4 argTy4of4 argTy1of5 argTy2of5 argTy3of5 argTy4of5 argTy5of5 argTy1of6 argTy2of6 argTy3of6 argTy4of6 argTy5of6 argTy6of6 nubMergeBy nubMergeOnnubMerge+++foldr0fromLeft fromRightelemBylistEqlistOrdmaybeEqmaybeOrdeitherEq eitherOrdpairEqpairOrdtripleEq tripleOrd quadrupleEq quadrupleOrd minimumOn maximumOn takeBound nubMergeMap compareIndex&speculate-0.4.1-GQ8UwirXWT12FI8i2gEYb4Test.Speculate.EngineclassesFromSchemasAndVariablesTest.Speculate.ReasonThytheoryAndReprConds Generalizable background subInstancesmkEq1mkEq2mkEq3mkEq4mkOrd1mkOrd2mkOrd3mkOrd4 instances*==**/=**<=**<*$fGeneralizable(,,,,,,,)$fGeneralizable(,,,,,,)$fGeneralizable(,,,,,)$fGeneralizable(,,,,)$fGeneralizableRatio$fGeneralizableOrdering$fGeneralizable[]$fGeneralizable(,,,)$fGeneralizable(,,)$fGeneralizable(,)$fGeneralizableEither$fGeneralizableMaybe$fGeneralizableChar$fGeneralizableInteger$fGeneralizableInt$fGeneralizableBool$fGeneralizable() WithOptionWithpropertyoptionOptionMaxTestsExtraInstancesMaxConditionSizeTestable resultiers tinstancesoptionsresultslimitedResultscounterExamplecounterExamplestestableMaxTeststestableMaxConditionSizetestableExtraInstancestestableGroundstestableMkEquation testableNamestestableBackground testableAtoms $fTestable->$fTestableBool$fTestableWithOptionderiveGeneralizableIfNeededderiveGeneralizableCascading(conditionalCounterExampleGeneralizationscandidateConditionsvalidConditions!counterExampleWithGeneralizationsfor withInstanceswithBackgroundwithConditionSizecheck checkResult $fEqResult $fShowResultData.Express.Canon canonicalizecanonicalizeWithbaseData.Typeable.InternalTypeableghc-prim GHC.TypesTyCon Data.TypeabletypeOf7typeOf6typeOf5typeOf4typeOf3typeOf2typeOf1 rnfTypeReptypeRepFingerprint typeRepTyCon typeRepArgs splitTyConAppmkFunTy funResultTygcast2gcast1gcasteqTcast showsTypeReptypeReptypeOfTypeReprnfTyContyConFingerprint tyConName tyConModule tyConPackage Data.ProxyProxyData.Type.Equality:~:Refl:~~:HReflfastCanonicalVariationscanonicalVariations isCanonicalcanonicalizationisCanonicalWithcanonicalizationWithpreludeNameInstances findValidApp validApps listVarsWith lookupNames lookupNamemkComparisonLEmkComparisonLT mkEquation mkComparisonisEqOrdisOrdisEqisEqOrdTisOrdTisEqTlookupComparison mkNameWithmkNamemkOrdLessEqualmkOrdmkEq reifyNameData.Express.Match isSubexprOf hasInstanceOf isInstanceOf matchWithmatchData.Express.Express.DerivederiveExpressCascadingderiveExpressIfNeeded deriveExpressData.Express.Foldunfoldfold unfoldTriofoldTrio unfoldPairfoldPairfoldAppData.Express.HolelistVarsAsTypeOflistVarsnubHolesholesisHolehole holeAsTypeOf varAsTypeOfData.Express.Map renameVarsBy////- mapSubexprs mapConstsmapVars mapValuesheightdepthsizearitynubVarsvars nubConstsconsts nubValuesvalues nubSubexprssubexprsisAppisValueisVarisConstisGroundhasVar unfoldAppcompareComplexityshowExpr showPrecExpr showOpExpr toDynamicevlevalevaluate isWellTyped isIllTypedmtypetyptypvar$$Data.Express.Utils.Typeable->:: typesInListtypesIn mkCompareTymkComparisonTyisFunTyfunTyCon orderingTyintTyboolTy elementTyresultTy argumentTyunFunTy finalResultTytyArity compareTyData.Express.Name.DerivederiveNameCascadingderiveNameIfNeeded deriveNamenamesData.Express.Utils.StringvariableNamesFromTemplateTest.Speculate.Expr.CorefillhasCanonInstanceOf isAssignmentisCanonInstanceOfisConstantNamed lexicompare lexicompareBy unificationunifyunrepeatedVarsTest.Speculate.Expr.Equate isEquationmkConditionalEquation unComparisonunConditionalEquation unEquationTest.Speculate.Expr.Ground condEqual condEqualMequal groundBindsgroundsinequalisFalseisTrueless lessOrEqual trueRatioTest.Speculate.Expr.InstanceholeOfTy isListable isListableT lookupTiers lookupTiersT maybeHoleOfTy mkListablepreludeInstancesreifyInstancesreifyInstances1 reifyListableBinds Instances Test.LeanCheck.Utils.TypeBindinguint4uint3uint2uint1word4word3word2word1int4int3int2int1natnaturaleithmayborderingstringcharboolrationaldoublefloatintegerintund>-->>>>>>>>>>>>:->>>>>>>>>>>:> ->>>>>>>>>>>: ->>>>>>>>>>:> ->>>>>>>>>>: ->>>>>>>>>:> ->>>>>>>>>: ->>>>>>>>:> ->>>>>>>>: ->>>>>>>:> ->>>>>>>: ->>>>>>:>->>>>>>:->>>>>:>->>>>>:->>>>:>->>>>:->>>:>->>>:->>:>->>:->:>->:-:>-:GHC.Baseidinstemplate-haskellLanguage.Haskell.TH.Syntax$True