Expand description
Expression generation
Generates valid postfix expressions by enumerating “forms” (stack effect patterns).
§Streaming Architecture
For high complexity levels, the traditional approach of generating ALL expressions into memory before matching can cause memory exhaustion. This module provides both:
- Batch generation:
generate_all()returns all expressions (backward compatible) - Streaming generation:
generate_streaming()processes expressions via callbacks
Streaming reduces memory from O(expressions) to O(depth) by processing expressions as they’re generated rather than accumulating them.
Structs§
- Expression
Constraint Options - Options for additional expression constraints
- GenConfig
- Configuration for expression generation
- Generated
Exprs - Result of expression generation
- Streaming
Callbacks - Callbacks for streaming expression generation
Functions§
- expression_
respects_ constraints - Check if an expression respects the configured structural and numeric constraints.
- generate_
all - Generate all valid expressions up to the configured limits
- generate_
all_ parallel - Generate expressions in parallel using Rayon
- generate_
all_ parallel_ with_ context - Generate expressions in parallel using Rayon with an explicit evaluation context.
- generate_
all_ with_ context - Generate all valid expressions up to the configured limits using an explicit evaluation context.
- generate_
all_ with_ limit - Generate expressions with an early-abort limit on total count.
- generate_
all_ with_ limit_ and_ context - Generate expressions with an early-abort limit using an explicit evaluation context.
- generate_
streaming - Generate expressions with streaming callbacks for memory-efficient processing
- generate_
streaming_ with_ context - Generate expressions with streaming callbacks using an explicit evaluation context.
- quantize_
value - Uses ~8 significant digits for deduplication
Type Aliases§
- LhsKey
- Quantize a value to reduce floating-point noise Key for LHS deduplication: (quantized value, quantized derivative)