h$5*o      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                         (c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela None3{G extrapolateLike ) but uses holes for unrepeated variables.H extrapolateLike ) but uses holes for unrepeated variables.J 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  GHIJGHIJ(c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela NoneKK extrapolateGiven 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. ) All according to a given function that lists ground expressions. 9> counterExampleGeneralizations (groundsFor not) false [] > counterExampleGeneralizations (groundsFor not) (false -&&- true) [False && p :: Bool] > counterExampleGeneralizations (groundsFor not) (false -||- true) [] > counterExampleGeneralizations (groundsFor not) (false -/=- false) [p /= p :: Bool] > counterExampleGeneralizations (groundsFor not) (false -&&- true -&&- false) [ (False && _) && _ :: Bool , p && False :: Bool ]L extrapolate;Returns candidate generalizations for an expression. (cf. N)This 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 ]M extrapolateLike L but faster because result is not canonicalized. Variable names will be repeated across different types.N extrapolateReturns candidate generalizations for an expression by replacing values with holes. (cf. L) > 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 ]  GHIJKLMNKLMN(c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela NoneyOPQRSTUVWXYZ[\]^_`abcdefghijOPQRSTUVWXYZ[\]^_`abcdefghij(c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela  Safe-Inferredklmnopqrstuvwxyz{|}~nmlkopqrstuvwxyz{|}~n5(c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela None] EFF E(c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela None extrapolateExtrapolate 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.There 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 instance Generalizable a => Generalizable (Stack a) where subInstances s = instances (argTy1of1 s) To declare : it may be useful to use type binding operators such as: V, W and X..Instances can be automatically derived using  * which will also automatically derivate D,  and   when needed. extrapolateList of symbols allowed to appear in side-conditions. Defaults to []. See . extrapolate=Computes a list of reified subtype instances. Defaults to  . See . extrapolateUsed in the definition of  in  typeclass instances.  DBCGHIJDBC (c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela None33 (c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela None extrapolate Derives a  instance for a given type .7If needed, this function also automatically derivates D,  and  instances using respectively deriveListable,  and .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 None S(c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela None3    !"#$%&'()*+,-./0123456789:;<=>?@ADBCEFGHIJKLMN8 !"#$%&'()*+,-./0123456789:;<=>?@ADBC (c) 2017-2019 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela 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 ()! extrapolateAllows 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.There 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 None)+  !"#$%&'()*+,-./0123456789:;<=>?@ADBCOPQRSTUVWXYZ[\]^_`abcdefghij   !"#$%&'()*+,-./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_`ab`cdefghijklmnopqrstuvwxyz{|}~                                         "``````````````````````````````````````%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$(extrapolate-0.4.6-9jc5ZdQ9DeiJHWAazrRPCYTest.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.14-4R7dkqdk56TDsS4Qnf6moHData.Express.Fixtures-&&-falseData.Express.Instances reifyEqOrdreifyOrdreifyEqData.Express.ExpressexprExpressData.Express.Corevalvalue:$ValueExprData.Express.NamenameName'leancheck-0.9.10-8h9G6xmR1toBCesz0EouenTest.LeanCheck.Tiers listsOfLengthsetsOfbagsOf noDupListsOf normalizeTdeleteTproductslistsOfproductMaybeWith product3With noDupListConsmapConssetConsbagConsTest.LeanCheck.DerivederiveListableCascadingderiveListableTest.LeanCheck.Basic addWeightofWeightcons12cons11cons10cons9cons8cons7cons6Test.LeanCheck.Core==>existsfailswitness witnesses><\\//\/+|suchThatresetdelaycons5cons4cons3cons2cons1cons0 concatMapTconcatTfilterTmapT tiersFloatingtiersFractional listIntegraltoTierslisttiersListable'speculate-0.4.10-KLa1UOU13rTHy8BRhksZZfTest.Speculate.EngineclassesFromSchemasAndVariablesTest.Speculate.ReasonThycanonicalizeUsingHolescanonicalizeUsingHolesWithunand 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 compareIndextheoryAndReprConds 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:~~:HReflfastMostSpecificVariationfastMostGeneralVariationfastCanonicalVariationsmostSpecificCanonicalVariationmostGeneralCanonicalVariationcanonicalVariations isCanonicalcanonicalizationisCanonicalWithcanonicalizationWithpreludeNameInstances findValidApp validApps listVarsWith lookupNames lookupNamemkComparisonLEmkComparisonLT mkEquation mkComparisonisEqOrdisOrdisEqisEqOrdTisOrdTisEqTlookupComparison mkNameWithmkNamemkOrdLessEqualmkOrdmkEq reifyNameData.Express.Match isSubexprOf hasInstanceOf encompasses isInstanceOf matchWithmatchData.Express.Express.DerivederiveExpressCascadingderiveExpressIfNeeded deriveExpressData.Express.Foldunfoldfold unfoldTriofoldTrio unfoldPairfoldPairfoldAppData.Express.HolefilllistVarsAsTypeOflistVars isCompletehasHolenubHolesholesisHolehole holeAsTypeOf varAsTypeOfData.Express.Map renameVarsBy////- mapSubexprs mapConstsmapVars mapValuesheightdepthsizearitynubVarsvars nubConstsconsts nubValuesvalues nubSubexprssubexprsisAppisValueisVarisConstisGroundhasVar unfoldAppcompareQuicklycompareLexicographicallycompareComplexityshowExpr showPrecExpr showOpExpr toDynamicevlevalevaluateisFun isWellTyped isIllTypedmtypetyptypvar$$Data.Express.Utils.Typeable->:: typesInListtypesIn mkCompareTymkComparisonTy countListTyisFunTyfunTyCon orderingTyintTyboolTy elementTyresultTy argumentTyunFunTy finalResultTytyArity compareTyData.Express.Name.DerivederiveNameCascadingderiveNameIfNeeded deriveNamenamesData.Express.Utils.StringvariableNamesFromTemplateTest.Speculate.Expr.GroundisFalseisTrue trueRatioinequalless lessOrEqual condEqualM condEqualequal groundBindsgroundsTest.Speculate.Expr.EquateunConditionalEquationmkConditionalEquation unComparison isEquation unEquationTest.Speculate.Expr.InstancepreludeInstances maybeHoleOfTyholeOfTy lookupTiersT lookupTiers isListableT isListable mkListable reifyListablereifyInstancesreifyInstances1 InstancesTest.Speculate.Expr.CorehasCanonInstanceOfisCanonInstanceOf unificationunifyisConstantNamed isAssignmentunrepeatedVarscompareComplexityThenIndexcompareLexicographicallyByBinds Test.LeanCheck.Utils.TypeBindinguint4uint3uint2uint1word4word3word2word1int4int3int2int1natnaturaleithmayborderingstringcharboolrationaldoublefloatintegerintund>-->>>>>>>>>>>>:->>>>>>>>>>>:> ->>>>>>>>>>>: ->>>>>>>>>>:> ->>>>>>>>>>: ->>>>>>>>>:> ->>>>>>>>>: ->>>>>>>>:> ->>>>>>>>: ->>>>>>>:> ->>>>>>>: ->>>>>>:>->>>>>>:->>>>>:>->>>>>:->>>>:>->>>>:->>>:>->>>:->>:>->>:->:>->:-:>-:GHC.Baseidtemplate-haskellLanguage.Haskell.TH.Syntax$True