wmpy.core.weights.Weights¶
- class Weights(weight_func, env)[source]¶
Bases:
objectThis class encodes a piecewise weight function.
- weight_func¶
the weight function in pysmt format
- env¶
the pysmt environment
- atoms_finder¶
TODO: add a bit of documentation for this
- evaluator¶
internal class for function evaluation
Default constructor.
- Parameters:
weight_func (
FNode) – the pysmt expression representing the weight functionenv (
Environment) – the pysmt environment
Methods
Computes the "skeleton", a SMT formula that encodes the structure of the weight function.
Returns the atoms contained in the (conditions of the) weight expressions.
Evaluates the weight function given a total truth assignment to its conditions.
- compute_skeleton()[source]¶
Computes the “skeleton”, a SMT formula that encodes the structure of the weight function. Conjoining the skeleton with the support formula can be advantageous when using partial enumeration.
- Return type:
FNode- Returns:
A pysmt formula that encodes the structure of the weight.
- get_atoms()[source]¶
Returns the atoms contained in the (conditions of the) weight expressions.
- Return type:
Collection[FNode]