Skip to main content

normalization_distance

Function normalization_distance 

Source
pub fn normalization_distance(
    expression: &Expression,
    dnf: bool,
    max_distance: i64,
) -> i64
Expand description

Calculate the normalization distance for an expression.

This estimates the cost of converting to normal form. The conversion is exponential in complexity, so this helps decide whether to attempt it.

§Arguments

  • expression - The expression to analyze
  • dnf - Whether checking distance to DNF (true) or CNF (false)
  • max_distance - Early exit if distance exceeds this

§Returns

The estimated normalization distance.