Copyright | (c) 2021-2025 Rudy Matela |
---|---|
License | 3-Clause BSD (see the file LICENSE) |
Maintainer | Rudy Matela <rudy@matela.com.br> |
Safe Haskell | None |
Language | Haskell2010 |
Conjure.Settings
Description
An internal module of Conjure, a library for Conjuring function implementations from tests or partial definitions. (a.k.a.: functional inductive programming)
This contains the settings for functions in Conjure.Engine.
Synopsis
- maxTests :: Int -> Ingredient
- maxSize :: Int -> Ingredient
- target :: Int -> Ingredient
- maxRecursions :: Int -> Ingredient
- maxEquationSize :: Int -> Ingredient
- maxSearchTests :: Int -> Ingredient
- maxDeconstructionSize :: Int -> Ingredient
- maxConstantSize :: Int -> Ingredient
- maxPatternSize :: Int -> Ingredient
- maxPatternDepth :: Int -> Ingredient
- showCandidates :: Ingredient
- showTheory :: Ingredient
- singlePattern :: Ingredient
- showTests :: Ingredient
- showPatterns :: Ingredient
- showDeconstructions :: Ingredient
- carryOn :: Ingredient
- dontRewrite :: Ingredient
- dontRequireDescent :: Ingredient
- omitAssortedPruning :: Ingredient
- omitEarlyTests :: Ingredient
- dontCopyBindings :: Ingredient
- nonAtomicNumbers :: Ingredient
- uniqueCandidates :: Ingredient
- actual :: [Ingredient] -> [Ingredient]
- maxTestsI :: [Ingredient] -> Int
- targetAndMaxSizeI :: [Ingredient] -> (Int, Int)
- maxRecursionsI :: [Ingredient] -> Int
- maxEquationSizeI :: [Ingredient] -> Int
- maxSearchTestsI :: [Ingredient] -> Int
- maxDeconstructionSizeI :: [Ingredient] -> Int
- maxConstantSizeI :: [Ingredient] -> Int
- maxPatternSizeI :: [Ingredient] -> Int
- maxPatternDepthI :: [Ingredient] -> Int
- showCandidatesI :: [Ingredient] -> Bool
- showTheoryI :: [Ingredient] -> Bool
- singlePatternI :: [Ingredient] -> Bool
- showTestsI :: [Ingredient] -> Bool
- showPatternsI :: [Ingredient] -> Bool
- showDeconstructionsI :: [Ingredient] -> Bool
- carryOnI :: [Ingredient] -> Bool
- rewriteI :: [Ingredient] -> Bool
- requireDescentI :: [Ingredient] -> Bool
- assortedPruningI :: [Ingredient] -> Bool
- earlyTestsI :: [Ingredient] -> Bool
- copyBindingsI :: [Ingredient] -> Bool
- atomicNumbersI :: [Ingredient] -> Bool
- uniqueCandidatesI :: [Ingredient] -> Bool
Basic settings
maxTests :: Int -> Ingredient Source #
By default,
conjure
tests candidates up to a maximum of 360 tests.
This configures the maximum number of tests to each candidate,
when provided in the list of ingredients:
conjure "..." ... [ ... , maxTests 1080 , ... ]
maxSize :: Int -> Ingredient Source #
target :: Int -> Ingredient Source #
By default, conjure
targets testing 10080 candidates.
This configures a different target when
provided in the list of ingredients:
conjure "..." ... [ ... , target 5040 , ... ]
Advanced settings
maxRecursions :: Int -> Ingredient Source #
By default,
conjure
evaluates candidates for up to 60 recursive calls.
This allows overriding the default when provided in the ingredient list.
maxEquationSize :: Int -> Ingredient Source #
By default,
conjure
considers equations of up to 5 symbols
for pruning-through-rewriting.
This allows overriding the default: 6 or 7 are also good values for this depending on the number of ingredients.
conjure ... ... [ ... , maxEquationSize 6 , ... ]
Internally, this is the maximum size passed to the Speculate tool.
maxSearchTests :: Int -> Ingredient Source #
By default,
conjure
enumerates up to 110880 argument combinations
while reifying the partial definition passed by the user.
This allows configuring a higher default when provided in the ingredient list.
Increasing this setting is useful when the partial definition is not exercised enough.
maxDeconstructionSize :: Int -> Ingredient Source #
By default
conjure
allows deconstruction expressions
of up to 4 symbols.
This allows overriding the default when provided in the ingredient list.
maxConstantSize :: Int -> Ingredient Source #
Configures a maximum size of constant sub-expressions
when provided in the ingredient list
of conjure
or conjureFromSpec
.
maxPatternSize :: Int -> Ingredient Source #
By default,
conjure
places no limit in the LHS pattern sizes.
This allows configuring a limit when provided in the ingredient list
maxPatternDepth :: Int -> Ingredient Source #
By default,
conjure
enumerates pattern breakdowns of the outernmost constructor
of depth 1.
This allows overriding the default when provided in the ingredient list: a depth of 2 allows breakdowns of the two outernmost constructors; a depth of 3, three outernmost constructors; etc.
Debug options
showCandidates :: Ingredient Source #
(Debug option) When provided in the ingredients list, this enables showing enumerated candidates.
conjure ... ... [ ... , showCandidates , ... ]
Warning: activating this will likely produce a humongous wall-of-text.
showTheory :: Ingredient Source #
(Debug option). Shows the underlying theory used in pruning when this is provided in the ingredient list.
singlePattern :: Ingredient Source #
(Debug option) When provided in the ingredient list, this reverts to a legacy enumeration that contains candidates with a single LHS matching everything.
showTests :: Ingredient Source #
(Debug option)
When provided in the ingredients list,
conjure
will print the tests reified from the partial definition.
(cf. maxTests
, maxSearchTests
)
showPatterns :: Ingredient Source #
(Debug option)
When this option is provided in the ingredients list,
conjure
will print the enumrated LHS patterns.
(cf. maxPatternSize
, maxPatternDepth
)
showDeconstructions :: Ingredient Source #
(Debug option)
Makes conjure
print enumerated deconstructions
when provided in its ingredient list.
carryOn :: Ingredient Source #
Carry on after finding a suitable candidate. To be provided as a setting in the list of ingredients.
Pruning options
dontRewrite :: Ingredient Source #
Disables rewriting-as-pruning
when provided in the ingredient list
of conjure
or conjureFromSpec
.
dontRequireDescent :: Ingredient Source #
Disables the recursive descent requirement
when provided in the ingredient list
of conjure
or conjureFromSpec
.
omitAssortedPruning :: Ingredient Source #
Disables assorted pruning rules
when provided in the ingredient list
of conjure
or conjureFromSpec
.
omitEarlyTests :: Ingredient Source #
Omits early tests
when provided in the ingredient list
of conjure
or conjureFromSpec
.
dontCopyBindings :: Ingredient Source #
Disables the copy-bindings rule
when provided in the ingredient list
of conjure
or conjureFromSpec
.
nonAtomicNumbers :: Ingredient Source #
Disables the requirement of atomic numeric expressions
when provided in the ingredient list
of conjure
or conjureFromSpec
.
(cf. maxConstantSize
)
uniqueCandidates :: Ingredient Source #
Enables expensive unique-modulo-testing candidates
when provided in the ingredient list
of conjure
or conjureFromSpec
.
Warning: this makes conjure
very slow,
it is only intended for approximating the theoretical
limits of pruning in toy examples.
Filtering settings
actual :: [Ingredient] -> [Ingredient] Source #
Lists actual incredients in the list
Read basic settings
maxTestsI :: [Ingredient] -> Int Source #
Finds the set maximum number of tests or set the default of 360
targetAndMaxSizeI :: [Ingredient] -> (Int, Int) Source #
Computes the target and maxSize.
When none is provided, we default to a target of 10080.
Read advanced settings
maxRecursionsI :: [Ingredient] -> Int Source #
maxEquationSizeI :: [Ingredient] -> Int Source #
maxSearchTestsI :: [Ingredient] -> Int Source #
maxDeconstructionSizeI :: [Ingredient] -> Int Source #
maxConstantSizeI :: [Ingredient] -> Int Source #
maxPatternSizeI :: [Ingredient] -> Int Source #
maxPatternDepthI :: [Ingredient] -> Int Source #
Read debug options
showCandidatesI :: [Ingredient] -> Bool Source #
showTheoryI :: [Ingredient] -> Bool Source #
singlePatternI :: [Ingredient] -> Bool Source #
showTestsI :: [Ingredient] -> Bool Source #
showPatternsI :: [Ingredient] -> Bool Source #
showDeconstructionsI :: [Ingredient] -> Bool Source #
carryOnI :: [Ingredient] -> Bool Source #
Read pruning options
rewriteI :: [Ingredient] -> Bool Source #
requireDescentI :: [Ingredient] -> Bool Source #
assortedPruningI :: [Ingredient] -> Bool Source #
earlyTestsI :: [Ingredient] -> Bool Source #
copyBindingsI :: [Ingredient] -> Bool Source #
atomicNumbersI :: [Ingredient] -> Bool Source #
uniqueCandidatesI :: [Ingredient] -> Bool Source #