Pre-calculate and filter out combinations of unfortunate orderings, especially given indices #145
Labels
code: enhancement
New feature or improvement
derive: least-effort
Relates to the `LeastEffort` derivation algorithm
issue: compilation error
When compilation error raises because of the library
issue: performance
When work takes too much resources
part: derivation
Related to automated derivation of generators
part: generators
Related to generators
status: feature request
Request for new functionality or improvement
In the case when we have a data type with a constructor with (at least) two arguments that depend on one, say
we treat both types
Y
andZ
equally, and try bothand
in usual
LeastEffort
, and arbitrary one of those two whensimplificationHack
option it turned on.But in case when, say,
Y
hasn
as index, andZ
hasn
as a parameter, it's much better to prefer first generation ofY
and only afterZ
with the givenn
. The same is applicable when, say,Y
has only constructors and free variables in its indices, whenZ
has both constructors, free variables and calls non-reversible functions -- in this case, we should first generate value forZ
along with somen
, and have given arguments forY
-- because we can't generate a generator forZ
with the givenn
because of those non-reversible functions.To do this, we could filter out unfortunate orders in the
LeastEffort
. First we should try to filter out those orders, when any given parameter is actually an index. If we get an empty list of orders, then we should start from the begining and filter out only those, which contains calls to non-reversible functions in indices. And only after that, we should apply the simplification hack, if this option is turned on.This both would increase generation time, because of reduced runtime filtering, and in some cases it would allow some functions in indices where in other cases we how get an error of unsupported data type.
I wonder if this is actually always fixed by solution of #55 or not.
The text was updated successfully, but these errors were encountered: