FeatureIDE / FeatureIDE

An extensible framework for feature-oriented software development
https://featureide.github.io/
GNU Lesser General Public License v3.0
129 stars 97 forks source link

Wrong DIMACS export for some feature models #1487

Open st-vi opened 1 week ago

st-vi commented 1 week ago

Prerequisitives

Issue description

Exporting a UVL featuremodel to dimacs results in a wrong cnf. Example: The feature model

features
    "__Root__"
        optional
            CONFIG_DEFAULT_SETFONT_DIR
            CONFIG_SETFONT

results in the dimacs

c 1 __Root__
c 2 CONFIG_DEFAULT_SETFONT_DIR
c 3 CONFIG_SETFONT
p cnf 3 0

which is wrong, since the root feature is not forced to be true here. When we remove the underscores from the root feature name, everything works as expected:

features
    "Root"
        optional
            CONFIG_DEFAULT_SETFONT_DIR
            CONFIG_SETFONT

results in the dimacs

c 1 Root
c 2 CONFIG_DEFAULT_SETFONT_DIR
c 3 CONFIG_SETFONT
p cnf 3 3
1 0
1 -2 0
1 -3 0

which is correct. A common feature model with this issue is busybox (https://github.com/Universal-Variability-Language/uvl-models/blob/main/Feature_Models/Operating_Systems/BusyBox/busybox_2010-05-02_14-17-07.uvl).

h3ssto commented 1 week ago

Can confirm this issue. Does this also affect mandatory children (which would not be core, if the mandatory root feature is enforced)? This could threaten the validity of previous evaluation results.