Drafts
opulse.generation.drafts ¶
Candidate definitions ("drafts") for simple and branch operators.
A draft is the definition as a syntax tree plus the new operator's surface
shape. It has no code yet; :mod:opulse.generation.pipeline compiles,
checks and registers it.
Branch conditions partition the input space into axis-aligned regions:
- unary: thresholds
t1 < ... < tnonagive regionsa < t1,t1 <= a < t2, ...,a >= tn; - binary: thresholds on
aand onbgive a grid of rectangles; - three or more parameters: the binary grid on two parameters chosen at random.
Thresholds are distinct, so every region is non-empty (the legacy generator
could emit dead branches such as b >= 15 and b < 15). Regions are shuffled,
the first k-1 become if branches and the last body is the else.
With probability operators.partial_probability the definition is partial
instead: all k bodies get a region and there is no else, so inputs in
the remaining regions are undefined (docs/reference/semantics.md section 4, rule 3).