true — enables all automatic normalizations (backward compatible).
false — disables all automatic normalizations (backward compatible).
TAutoNormalizeConfig — granular control over individual behaviors:
wrapInsertFormula: auto-insert formula buffers in addExpression,
insertExpression, and wrapExpression.
negationInsertFormula: auto-insert a formula buffer when
toggleNegation wraps a non-not operator in NOT.
collapseDoubleNegation: collapse NOT(NOT(x)) → x during
toggleNegation and normalize.
collapseEmptyFormula: auto-collapse operators with 0/1 children
and formulas whose bounded subtree has no binary operator after
removeExpression.
repositionOnCollision: auto-redistribute sibling positions when
a midpoint collision is detected.
absorbSameOperator: when an operator swap via updateExpression
produces a same-operator nesting through a formula (e.g., AND →
formula → AND), absorb the inner operator's children into the
outer operator and remove the formula and inner operator.
Formula collapse rule: A formula node is only justified if its bounded
subtree (stopping at the next nested formula) contains a binary operator
(and or or). Formulas wrapping only variables, not chains, or other
non-binary subtrees are automatically collapsed when collapseEmptyFormula
(or autoNormalize: true) is enabled.
Grammar enforcement configuration for expression trees.
Controls which structural rules are enforced and whether violations are automatically corrected.
autoNormalizescope: Acceptsboolean | TAutoNormalizeConfig.true— enables all automatic normalizations (backward compatible).false— disables all automatic normalizations (backward compatible).TAutoNormalizeConfig— granular control over individual behaviors:wrapInsertFormula: auto-insert formula buffers inaddExpression,insertExpression, andwrapExpression.negationInsertFormula: auto-insert a formula buffer whentoggleNegationwraps a non-not operator in NOT.collapseDoubleNegation: collapse NOT(NOT(x)) → x duringtoggleNegationandnormalize.collapseEmptyFormula: auto-collapse operators with 0/1 children and formulas whose bounded subtree has no binary operator afterremoveExpression.repositionOnCollision: auto-redistribute sibling positions when a midpoint collision is detected.absorbSameOperator: when an operator swap viaupdateExpressionproduces a same-operator nesting through a formula (e.g., AND → formula → AND), absorb the inner operator's children into the outer operator and remove the formula and inner operator.Formula collapse rule: A formula node is only justified if its bounded subtree (stopping at the next nested formula) contains a binary operator (
andoror). Formulas wrapping only variables,notchains, or other non-binary subtrees are automatically collapsed whencollapseEmptyFormula(orautoNormalize: true) is enabled.