pub enum Output<'a> {
Function,
Count,
WeightedCount {
weights: RationalWeights,
arithmetic: Arithmetic,
},
ProjectedCount(&'a [VarId]),
ProjectedFunction(&'a [VarId]),
}Expand description
What a compile produces.
Variants§
Function
The formula’s Boolean diagram.
Count
A counting diagram: each level is marginalized as soon as the last
clause mentioning its variables lands, so the diagram’s model_count is
the formula’s and memory is freed as the compile climbs.
WeightedCount
Output::Count with literal weights: the marginalization carries
values in arithmetic instead of integers, and the result holds the
store [tididi::Engine::weighted_value] reads the weighted count from.
Fields
weights: RationalWeightsThe weight of each literal, covering every formula variable.
arithmetic: ArithmeticThe domain the values are computed in.
ProjectedCount(&'a [VarId])
Output::Count of the formula with these variables ∃-forgotten during
the compile, each at its completion node, so the diagram never
materializes the projected cone. A forgotten variable is left free and
counts ×2, so a caller divides the count by 2^Compiled::forgotten.
Every leaf level stays Boolean, so a later forget can read its label.
ProjectedFunction(&'a [VarId])
The Boolean diagram of the formula with these variables ∃-forgotten
during the compile, as Output::ProjectedCount forgets them, each
left free. No level is marginalized, so a weighted fold can read the
whole result.