everyInstructionPlan
Checks if every instruction plan in the tree satisfies the given predicate.
This function performs a depth-first traversal through the instruction plan tree,
returning true only if the predicate returns true for every plan in the tree
(including the root plan and all nested plans).
Parameters
| Parameter | Type | Description |
|---|---|---|
instructionPlan | InstructionPlan | The instruction plan tree to check. |
predicate | (plan) => boolean | A function that returns true if the plan satisfies the condition. |
Returns
boolean
true if every plan in the tree satisfies the predicate, false otherwise.
Examples
Checking if all plans are divisible.
Checking if all single instructions use a specific program.