code-conjure 0.2.0 → 0.2.2
raw patch · 11 files changed
+35/−32 lines, 11 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Conjure: [maxSearchTests] :: Args -> Int
+ Conjure.Engine: [maxSearchTests] :: Args -> Int
- Conjure: Args :: Int -> Int -> Int -> Int -> Int -> Args
+ Conjure: Args :: Int -> Int -> Int -> Int -> Int -> Int -> Args
- Conjure.Engine: Args :: Int -> Int -> Int -> Int -> Int -> Args
+ Conjure.Engine: Args :: Int -> Int -> Int -> Int -> Int -> Int -> Args
Files
- bench/runtime/zero/eg/arith.runtime +1/−1
- bench/runtime/zero/eg/bools.runtime +1/−1
- bench/runtime/zero/eg/factorial.runtime +1/−1
- bench/runtime/zero/eg/ints.runtime +1/−1
- bench/runtime/zero/eg/list.runtime +1/−1
- bench/runtime/zero/eg/tapps.runtime +1/−1
- code-conjure.cabal +2/−2
- src/Conjure/Engine.hs +12/−9
- test/model/eg/ints.out +6/−6
- test/model/eg/list.out +6/−6
- test/model/eg/tapps.out +3/−3
bench/runtime/zero/eg/arith.runtime view
@@ -1,1 +1,1 @@-0.82+1.16
bench/runtime/zero/eg/bools.runtime view
@@ -1,1 +1,1 @@-7.31+7.68
bench/runtime/zero/eg/factorial.runtime view
@@ -1,1 +1,1 @@-7.68+7.75
bench/runtime/zero/eg/ints.runtime view
@@ -1,1 +1,1 @@-2.42+2.39
bench/runtime/zero/eg/list.runtime view
@@ -1,1 +1,1 @@-8.59+8.56
bench/runtime/zero/eg/tapps.runtime view
@@ -1,1 +1,1 @@-1.24+1.20
code-conjure.cabal view
@@ -3,7 +3,7 @@ -- Copyright (C) 2021 Rudy Matela -- Distributed under the 3-Clause BSD licence (see the file LICENSE). name: code-conjure-version: 0.2.0+version: 0.2.2 synopsis: conjure Haskell functions out of partial definitions description: Conjure is a tool that produces Haskell functions out of partial definitions.@@ -64,7 +64,7 @@ source-repository this type: git location: https://github.com/rudymatela/conjure- tag: v0.2.0+ tag: v0.2.2 library exposed-modules: Conjure
src/Conjure/Engine.hs view
@@ -41,20 +41,22 @@ -- | Arguments to be passed to 'conjureWith' or 'conjpureWith'. -- See 'args' for the defaults. data Args = Args- { maxTests :: Int -- ^ defaults to 60- , maxSize :: Int -- ^ defaults to 9, keep greater than maxEquationSize- , maxRecursiveCalls :: Int -- ^ defaults to 1- , maxEquationSize :: Int -- ^ defaults to 5, keep smaller than maxSize- , maxRecursionSize :: Int -- ^ defaults to 60+ { maxTests :: Int -- ^ maximum number of tests to each candidate+ , maxSize :: Int -- ^ maximum size of candidate bodies+ , maxRecursiveCalls :: Int -- ^ maximum number of allowed recursive calls+ , maxEquationSize :: Int -- ^ maximum size of equation operands+ , maxRecursionSize :: Int -- ^ maximum size of a recursive expression expansion+ , maxSearchTests :: Int -- ^ maximum number of tests to search for defined values } -- | Default arguments to conjure. -- -- * 60 tests--- * functions of up to 9 symbols+-- * functions of up to 12 symbols -- * maximum of 1 recursive call -- * pruning with equations up to size 5--- * recursion up to 60 symbols.+-- * recursion up to 60 symbols+-- * search for defined applications for up to 100000 combinations args :: Args args = Args { maxTests = 60@@ -62,6 +64,7 @@ , maxRecursiveCalls = 1 , maxEquationSize = 5 , maxRecursionSize = 60+ , maxSearchTests = 100000 } -- | Like 'conjure' but in the pure world.@@ -100,8 +103,8 @@ gs = take maxTests . grounds (conjureTiersFor f) bss, dbss :: [[(Expr,Expr)]]- bss = take maxTests $ groundBinds (conjureTiersFor f) ffxx- dbss = [bs | bs <- bss, errorToFalse . eval False $ e //- bs]+ bss = take maxSearchTests $ groundBinds (conjureTiersFor f) ffxx+ dbss = take maxTests [bs | bs <- bss, errorToFalse . eval False $ e //- bs] where e = ffxx -==- ffxx
test/model/eg/ints.out view
@@ -1,12 +1,12 @@ second :: [Int] -> Int--- testing 47 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 2 candidates of size 2 -- looking through 3 candidates of size 3 second xs = head (tail xs) third :: [Int] -> Int--- testing 34 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 2 candidates of size 2 -- looking through 3 candidates of size 3@@ -14,7 +14,7 @@ third xs = head (tail (tail xs)) sum :: [Int] -> Int--- testing 37 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 2 candidates of size 2 -- looking through 3 candidates of size 3@@ -28,7 +28,7 @@ sum xs = if null xs then 0 else head xs + sum (tail xs) product :: [Int] -> Int--- testing 37 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 2 candidates of size 2 -- looking through 3 candidates of size 3@@ -42,7 +42,7 @@ product xs = if null xs then 1 else head xs * product (tail xs) sum :: [Int] -> Int--- testing 37 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 2 candidates of size 2 -- looking through 3 candidates of size 3@@ -50,7 +50,7 @@ sum xs = foldr (+) 0 xs product :: [Int] -> Int--- testing 37 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 2 candidates of size 2 -- looking through 3 candidates of size 3
test/model/eg/list.out view
@@ -1,5 +1,5 @@ length :: [Int] -> Int--- testing 38 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 1 candidates of size 2 -- looking through 2 candidates of size 3@@ -12,7 +12,7 @@ length xs = if null xs then 0 else 1 + length (tail xs) reverse :: [Int] -> [Int]--- testing 38 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 4 candidates of size 2 -- looking through 9 candidates of size 3@@ -27,7 +27,7 @@ reverse xs = if null xs then xs else reverse (tail xs) ++ unit (head xs) sort :: [Int] -> [Int]--- testing 30 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 4 candidates of size 2 -- looking through 6 candidates of size 3@@ -41,7 +41,7 @@ sort xs = if null xs then xs else insert (head xs) (sort (tail xs)) length :: [Int] -> Int--- testing 38 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 1 candidates of size 2 -- looking through 1 candidates of size 3@@ -51,7 +51,7 @@ length xs = foldr (const (1 +)) 0 xs reverse :: [Int] -> [Int]--- testing 38 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 2 candidates of size 2 -- looking through 1 candidates of size 3@@ -62,7 +62,7 @@ reverse xs = foldr (flip (++) . unit) [] xs sort :: [Int] -> [Int]--- testing 30 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 2 candidates of size 2 -- looking through 0 candidates of size 3
test/model/eg/tapps.out view
@@ -1,5 +1,5 @@ third :: [Int] -> Int--- testing 34 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 2 candidates of size 2 -- looking through 3 candidates of size 3@@ -7,7 +7,7 @@ third xs = head (tail (tail xs)) product :: [Int] -> Int--- testing 37 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 2 candidates of size 2 -- looking through 3 candidates of size 3@@ -21,7 +21,7 @@ product xs = if null xs then 1 else head xs * product (tail xs) product :: [Int] -> Int--- testing 37 combinations of argument values+-- testing 60 combinations of argument values -- looking through 2 candidates of size 1 -- looking through 2 candidates of size 2 -- looking through 3 candidates of size 3