code-conjure-0.7.2: synthesize Haskell functions out of partial definitions
Copyright(c) 2021-2025 Rudy Matela
License3-Clause BSD (see the file LICENSE)
MaintainerRudy Matela <rudy@matela.com.br>
Safe HaskellNone
LanguageHaskell2010

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

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 #

By default, conjure imposes no limit on the size of candidates.

This configures a different maximum when provided in the list of ingredients.

If only one of maxSize and target is defined, it is used. If none, target is used.

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

Read debug options

Read pruning options