h$H9      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(c) 2021 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela  Safe-Inferred(c) 2021 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela None* code-conjureO(n)". Compares the simplicity of two s. An expression e1 is strictly simpler than another expression e2 if the first of the following conditions to distingish between them is: e1 is smaller in size/length than e2 , e.g.: x + y < x + (y + z);or, e1$ has less variable occurrences than e2,or, e1# has fewer distinct constants than e2 , e.g.:  1 + 1 < 0 + 1.9They're otherwise considered of equal complexity, e.g.: x + y and y + z. 9> (xx -+- yy) `compareComplexity` (xx -+- (yy -+- zz)) LT 0> (xx -+- yy) `compareComplexity` (xx -+- xx) EQ 1> (xx -+- xx) `compareComplexity` (one -+- xx) GT 5> (one -+- one) `compareComplexity` (zero -+- one) LT 0> (xx -+- yy) `compareComplexity` (yy -+- zz) EQ 6> (zero -+- one) `compareComplexity` (one -+- zero) EQ code-conjure/Makes the function in an application a variable code-conjureExpands recursive calls on an expression until the given size limit is reached. )> recursexpr 6 (ff xx) (ff xx) f x :: Int > recursexpr 6 (ff xx) (one -+- ff xx) 1 + (1 + (1 + (1 + f x))) :: Int > recursexpr 6 (ff xx) (if' pp one (xx -*- ff xx)) (if p then 1 else x * (if p then 1 else x * f x)) :: Int > recursexpr 6 (ff xx) (if' pp one (xx -*- ff (gg xx))) (if p then 1 else x * (if p then 1 else g x * f (g (g x)))) :: Int code-conjureChecks if the given recursive call apparently terminates. The first argument indicates the functional variable indicating the recursive call. (> apparentlyTerminates ffE (ff xx) False 5> apparentlyTerminates ffE (if' pp zero (ff xx)) True7This function only allows recursion in the else clause: 6> apparentlyTerminates ffE (if' pp (ff xx) zero) False apparentlyTerminates ffE (if' (odd' (ff xx)) zero zero) False code-conjureChecks if the given functional expression may refrain from evaluating its next argument. +> mayNotEvaluateArgument (plus :$ xx) False *> mayNotEvaluateArgument (andE :$ pp) TrueThis returns false for non-funcional value even if it involves an application which may not evaluate its argument. 1> mayNotEvaluateArgument (andE :$ pp :$ qq) False;This currently works by checking if the function is an if,  or . code-conjureCreates an if  of the type of the given proxy. :> ifFor (undefined :: Int) if :: Bool -> Int -> Int -> Int > ifFor (undefined :: String) if :: Bool -> [Char] -> [Char] -> [Char]You need to provide this as part of your building blocks on the primitives if you want recursive functions to be considered and produced. code-conjure0Application cross-product between lists of Exprs  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(c) 2021 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela None23!I code-conjure Class of  types. Functions are  if all their arguments are ,  and able.For atomic types that are , instances are defined as: >instance Conjurable Atomic where conjureTiers = reifyTiersFor atomic types that are both  and , instances are defined as: instance Conjurable Atomic where conjureTiers = reifyTiers conjureEquality = reifyEquality3For types with subtypes, instances are defined as: instance Conjurable Composite where conjureTiers = reifyTiers conjureEquality = reifyEquality conjureSubTypes x = conjureType y . conjureType z . conjureType w where (Composite ... y ... z ... w ...) = xAbove x, y, z and w are just proxies. The Proxy. type was avoided for backwards compatibility.Please see the source code of Conjure.Conjurable for more examples.(cf. , , ) code-conjureReturns  the  function encoded as an  when available or  otherwise. code-conjureReturns   of values encoded as s when possible or  otherwise. code-conjure)A reification over a collection of types.4Represented as a transformation of a list to a list. code-conjure4Single reification of some functions over a type as s.7A hole, an if function, an equality function and tiers. code-conjure1Reifies equality to be used in a conjurable type.)This is to be used in the definition of  of  typeclass instances: instance ... => Conjurable where ... conjureEquality = reifyEquality ... code-conjure1Reifies equality to be used in a conjurable type.)This is to be used in the definition of  of  typeclass instances: instance ... => Conjurable where ... conjureTiers = reifyTiers ...(c) 2021 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela None#$* code-conjureArguments to be passed to  or  . See  for the defaults. code-conjure)maximum number of tests to each candidate code-conjure maximum size of candidate bodies code-conjure)maximum number of allowed recursive calls code-conjure!maximum size of equation operands code-conjure0maximum size of a recursive expression expansion code-conjure4maximum number of tests to search for defined values code-conjure force tests code-conjure;Conjures an implementation of a partially defined function.Takes a  with the name of a function, a partially-defined function from a conjurable type, and a list of building blocks encoded as s.For example, given: square :: Int -> Int square 0 = 0 square 1 = 1 square 2 = 4 primitives :: [Expr] primitives = [ val (0::Int) , val (1::Int) , value "+" ((+) :: Int -> Int -> Int) , value "*" ((*) :: Int -> Int -> Int) ](The conjure function does the following: > conjure "square" square primitives square :: Int -> Int -- testing 3 combinations of argument values -- looking through 3 candidates of size 1 -- looking through 3 candidates of size 2 -- looking through 5 candidates of size 3 square x = x * x$The primitives list is defined with  and . code-conjureLike  but allows setting the maximum size of considered expressions instead of the default value of 12. /conjureWithMaxSize 10 "function" function [...] code-conjureDefault arguments to conjure.60 testsfunctions of up to 12 symbolsmaximum of 1 recursive call#pruning with equations up to size 5recursion up to 60 symbols=search for defined applications for up to 100000 combinations code-conjureLike $ but allows setting options through /. 8conjureWith args{maxSize = 11} "function" function [...] code-conjureLike  but in the pure world.Returns a triple with: tiers of implementations&tiers of candidate bodies (right type))tiers of candidate expressions (any type)a list of tests code-conjureLike $ but allows setting options through  and .  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(c) 2021 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela None8M  code-conjure;A partial specification of a function with three arguments.(To be passed as one of the arguments to  code-conjure9A partial specification of a function with two arguments: appSpec :: Spec2 [Int] [Int] [Int] appSpec = [ (,) [] [0,1] -= [0,1] , (,) [2,3] [] -= [2,3] , (,) [4,5,6] [7,8,9] -= [4,5,6,7,8,9] ](To be passed as one of the arguments to . code-conjure8A partial specification of a function with one argument: sumSpec :: Spec1 [Int] Int sumSpec = [ [] -= 0 , [1,2] -= 3 , [3,4,5] -= 12 ](To be passed as one of the arguments to . code-conjure0To be used when constructing specifications: ,  and . code-conjure6Conjures a one argument function from a specification.Given: sumSpec :: Spec1 [Int] Int sumSpec = [ [] -= 0 , [1,2] -= 3 , [3,4,5] -= 12 ] sumPrimitives :: [Expr] sumPrimitives = [ value "null" (null :: [Int] -> Bool) , val (0::Int) , value "+" ((+) :: Int -> Int -> Int) , value "head" (head :: [Int] -> Int) , value "tail" (tail :: [Int] -> [Int]) ]Then: > conjure1 "sum" sumSpec sumPrimitives sum :: [Int] -> Int -- testing 3 combinations of argument values -- ... -- looking through 189/465 candidates of size 10 xs ++ ys = if null xs then ys else head xs:(tail xs ++ ys)(cf. , ) code-conjure6Conjures a two argument function from a specification.Given: appSpec :: Spec2 [Int] [Int] [Int] appSpec = [ (,) [] [0,1] -= [0,1] , (,) [2,3] [] -= [2,3] , (,) [4,5,6] [7,8,9] -= [4,5,6,7,8,9] ] appPrimitives :: [Expr] appPrimitives = [ value "null" (null :: [Int] -> Bool) , value ":" ((:) :: Int -> [Int] -> [Int]) , value "head" (head :: [Int] -> Int) , value "tail" (tail :: [Int] -> [Int]) ]Then: > conjure2 "++" appSpec appPrimitives (++) :: [Int] -> [Int] -> [Int] -- testing 3 combinations of argument values -- ... -- looking through 26166/57090 candidates of size 11 xs ++ ys = if null xs then ys else head xs:(tail xs ++ ys)(cf. , ) code-conjure8Conjures a three argument function from a specification.(cf. , ) code-conjureLike $ but allows setting options through /. code-conjureLike $ but allows setting options through /. code-conjureLike $ but allows setting options through /.  (c) 2021 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela None8''      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~)code-conjure-0.2.8-2sZb1DXpeupEnvJj95BQDu Conjure.ExprConjure.ConjurableConjure.Engine Conjure.Utils Conjure.SpecConjure%express-0.1.10-5qKvUIySI7ZLOZKdoBSF9SData.Express.Fixturesproduct'sum'or'and'qqsppsbs_sixtuple quintuple quadrupletriplecommapair-|-justjustBooljustInt nothingBool nothingIntnothingcompare'if'-<--<=--/=--$-elem'insert'sort'length'null'tail'head'-++- appendInt-:-unitconsCharconsBoolconsIntconsnilCharnilBoolnilInt emptyStringnilyysxxsis_ordEord' lineBreakspacedeeceebeeaeccsddccc_even'odd'absEabs'negateEnegate'const'idStringidBoolsidIntsidCharidBoolidIntidEid'times-*-plus-+-ggE-?-ggffEffminusTwominusOnethreetwoonezeronnmmllii'kkjjiixx'zzyyxxi_-||--&&-not'implies-==>-orEandEnotEtruefalsepp'rrqqppb_Data.Express.CanonfastMostSpecificVariationfastMostGeneralVariationfastCanonicalVariationsmostSpecificCanonicalVariationmostGeneralCanonicalVariationcanonicalVariations isCanonicalcanonicalization canonicalizeisCanonicalWithcanonicalizationWithcanonicalizeWithData.Express.InstancespreludeNameInstances findValidApp validApps listVarsWith lookupNames lookupNamemkComparisonLEmkComparisonLT mkEquation mkComparisonisEqOrdisOrdisEqisEqOrdTisOrdTisEqTlookupComparison mkNameWithmkNamemkOrdLessEqualmkOrdmkEq reifyName reifyEqOrdreifyOrdreifyEqData.Express.Match isSubexprOf hasInstanceOf encompasses isInstanceOf matchWithmatchData.Express.Express.DerivederiveExpressCascadingderiveExpressIfNeeded deriveExpressData.Express.ExpressexprExpressData.Express.Foldunfoldfold unfoldTriofoldTrio unfoldPairfoldPairfoldAppData.Express.HolefilllistVarsAsTypeOflistVars isCompletehasHolenubHolesholesisHolehole holeAsTypeOf varAsTypeOfData.Express.Map renameVarsBy////- mapSubexprs mapConstsmapVars mapValuesData.Express.CoreheightdepthsizearitynubVarsvars nubConstsconsts nubValuesvalues nubSubexprssubexprsisAppisValueisVarisConstisGroundhasVar unfoldAppcompareQuicklycompareLexicographicallycompareComplexityshowExpr showPrecExpr showOpExpr toDynamicevlevalevaluateisFun isWellTyped isIllTypedmtypetyptypvar$$valvalue:$ValueExprData.Express.Name.DerivederiveNameCascadingderiveNameIfNeeded deriveNameData.Express.NamenamesnameNameData.Express.Utils.StringvariableNamesFromTemplate%leancheck-0.9.6-3Yykg1cPQjH4vu6hMnjzbTest.LeanCheck.Utils.TypesABCDEF&speculate-0.4.6-5RPNdfuJ5SQ4zLcer30ZV3Test.Speculate.EnginetheoryFromAtomsTest.Speculate.Reason isRootNormalETest.Speculate.Expr.Ground groundBindscountnubOn iterateUntilmzipcompareSimplicityfunToVar recursexprapparentlyTerminatesmayNotEvaluateArgumentapplicationOldifFor>$$<primitiveHolesprimitiveApplications valuesBFSholesBFSfillBFSshowEqlhsrhs$$**$$|< ConjurableconjureArgumentHolesconjureEquality conjureTiersconjureSubTypes Reification Reification1 conjureType reifyEquality reifyTiers conjureHoles conjureIfsconjureMkEquationconjureAreEqualconjureTiersForconjureApplicationconjureVarApplication$fConjurable(,,,,,,)$fConjurable(,,,,,)$fConjurable(,,,,)$fConjurable(,,,) $fConjurableF $fConjurableE $fConjurableD $fConjurableC $fConjurableB $fConjurableA$fConjurableComplex$fConjurableRatio$fConjurableWord64$fConjurableWord32$fConjurableWord16$fConjurableWord8$fConjurableWord$fConjurableInt64$fConjurableInt32$fConjurableInt16$fConjurableInt8$fConjurableDouble$fConjurableFloat$fConjurableOrdering$fConjurable->$fConjurableEither$fConjurableMaybe$fConjurable(,,)$fConjurable(,)$fConjurable[]$fConjurableChar$fConjurableInteger$fConjurableInt$fConjurableBool$fConjurable()ArgsmaxTestsmaxSizemaxRecursiveCallsmaxEquationSizemaxRecursionSizemaxSearchTests forceTestsconjureconjureWithMaxSizeargs conjureWithconjpure conjpureWithcandidateExprsSpec3Spec2Spec1-=conjure1conjure2conjure3 conjure1With conjure2With conjure3WithbaseGHC.Base++GHC.Listfilterzip Data.Tuplefstsndmap$Data.Typeable.InternalTypeable Data.Foldableelemminimummaximumfoldr1productsumfoldl1foldl'nullfoldlfoldrlength<>Monoidmconcatmemptymappend GHC.MaybeMaybeNothingJustghc-prim GHC.TypesTyCon Data.ListisSubsequenceOfData.Traversable mapAccumR mapAccumL Data.TypeabletypeOf7typeOf6typeOf5typeOf4typeOf3typeOf2typeOf1 rnfTypeReptypeRepFingerprint typeRepTyCon typeRepArgs splitTyConAppmkFunTy funResultTygcast2gcast1gcasteqTcast showsTypeReptypeReptypeOfTypeReprnfTyContyConFingerprint tyConName tyConModule tyConPackagefindnotElem minimumBy maximumByallanyorand concatMapconcat Data.MonoidFirstgetFirstLastgetLastApgetApData.Semigroup.InternalDualgetDualEndoappEndoAllgetAllAnygetAnySumgetSumProduct getProductAltgetAlt Data.OldListunwordswordsunlineslinesunfoldrsortOnsortBysort permutations subsequencestailsinitsgroupBygroupdeleteFirstsByunzip7unzip6unzip5unzip4zipWith7zipWith6zipWith5zipWith4zip7zip6zip5zip4genericReplicate genericIndexgenericSplitAt genericDrop genericTake genericLengthinsertByinsert partition transpose intercalate intersperse intersectBy intersectunionByunion\\deleteBydeletenubBynub isInfixOf isSuffixOf isPrefixOf findIndices findIndex elemIndices elemIndex stripPrefix dropWhileEnd Data.ProxyProxyData.Type.Equality:~:Refl:~~:HReflunzip3unzipzipWith3zipWithzip3!!lookupreversebreakspansplitAtdroptake dropWhile takeWhilecycle replicaterepeatiterate'iteratescanr1scanrscanl'scanl1scanlfoldl1'initlasttailunconshead Data.MaybemapMaybe catMaybes listToMaybe maybeToList fromMaybefromJust isNothingisJustmaybe Data.Function&onfixswapuncurrycurryflip.constid GHC.Classes&&||Test.LeanCheck.CoreListableGHC.ShowShowEq==tiersString