Skip to main content

Module generate

Module generate 

Source
Expand description

Deterministic test-case generation (A-03, issue #26).

Ports ac-test’s Level-1 generation semantics (spike #6 §2.3–§2.5) onto the domain model: integer scalars and one-dimensional integer arrays, boundary values plus fixed-seed pseudo-random cases, and conservative skipping whenever valid input cannot be proven.

[spec] parses the input-format block and constraint lines into a GenSpec; prng holds the xorshift32 generator; this module drives the five generation modes.

Modules§

prng
xorshift32 pseudo-random generator (spike #6 §2.5).

Structs§

GenOutcome
Result of Generator::generate.
GenSpec
The merged generation spec: input format plus constraint bounds.
GeneratedCase
One generated case: deterministic input text plus its provenance.
Generator
Runs a parsed GenSpec through the five modes.
InputFormat
Parsed input-format block.
SkippedCase
A mode that could not produce a case (e.g. array length cap).
VarBounds
Lower/upper bound expressions for one variable. Multiple constraints on the same variable accumulate; generation takes the tightest resolved bound.

Enums§

Expr
A parsed safe-integer expression. Variables resolve against the scalar values chosen earlier in generation order.
FormatLine
One recognized input-format line.
GenMode
The five ac-test generation modes, in emission order.
SpecError
Why a spec cannot drive generation.
VarKey
What a constraint line bounds.

Constants§

DEFAULT_SEED_BASE
ac-test’s default seed base (0xac7e57).
MAX_ARRAY_LENGTH
Maximum array length; longer arrays discard the case (spike #6 §2.5).

Functions§

generate_cases
Convenience: parse a spec and generate in one call.