Universal-Variability-Language / uvl-parser

GNU Lesser General Public License v3.0
10 stars 8 forks source link

Conversion of aggregate functions results in faulty constraints #16

Closed SundermannC closed 1 year ago

SundermannC commented 1 year ago

When converting an aggregate function, the expansion refers to the features instead of the attributes. For example, this UVL model

 features
    Root {Weight 2}
        optional
            Child1 {Weight 3}
            Child2 {Weight 2}

constraints
    sum(Weight) < 5

converts to the following invalid UVL model.

features
        Root {Weight 2}
                optional
                        Child1 {Weight 3}
                        Child2 {Weight 2}

constraints
        Root + Child1 + Child2 < 5

The correct converted model should instead have a contraint Root.Weight + Child1.Weight + Child2.Weight < 5