Dead Features
Description: Identifies features that cannot be included in any valid product configuration due to constraints and dependencies in the model. These are typically indicative of errors in the feature model.
Application: Helps in debugging and ensuring the correctness of the feature model.
Example: A feature that is excluded by all other features or cannot be selected due to contradictory constraints.
Code Examples
Command line usage
flamapy dead_features "path/to/feature/model"
Python easy to use facade usage
from flamapy.interfaces.python.flamapy_feature_model import FLAMAFeatureModel
# Load the feature model
fm = FLAMAFeatureModel("path/to/feature/model")
# Pass backend="sat" | "bdd" | "z3" to choose the analysis plugin (use "sat" to force pysat in WASM environments)
result = fm.dead_features()
print(result)
Python flamapy framework usage
from flamapy.core.discover import DiscoverMetamodels
# Initiallize the dicover metamodel
dm = DiscoverMetamodels()
# Call the operation. Transformations will be automatically executed
# Use BDDDeadFeatures, Z3DeadFeatures or SDDDeadFeatures to rely on other solvers
result = dm.use_operation_from_file("PySATDeadFeatures","path/to/feature/model")
print(result)
Python flamapy framework ADVANCED usage
from flamapy.core.discover import DiscoverMetamodels
# Initiallize the dicover metamodel
dm = DiscoverMetamodels()
# Get the fm metamodel representation using the transformation
# required to get to the fm metamodel
feature_model = dm.use_transformation_t2m("path/to/feature/model",'fm')
# Manually call a M2M transformation to Pysat
sat_model = dm.use_transformation_m2m(feature_model,"pysat")
# Get the operation
operation = dm.get_operation(sat_model,'PySATDeadFeatures')
# Execute the operation
operation.execute(sat_model)
# Get and print the result
result = operation.get_result()
print(result)
Facade signature: dead_features(self, backend: Optional[str] = None, *, allow_approximate: Optional[bool] = None)
Default backend: sat (selectable via backend=)
Implemented by:
| plugin | exact | scale limit |
|---|---|---|
| z3_metamodel | yes | — |
| sdd_metamodel | yes | 2000 |
| pysat_metamodel | yes | — |
| bdd_metamodel | yes | 1000 |