Skip to content

Conversation

DSaatz
Copy link

@DSaatz DSaatz commented Feb 25, 2025

@JuliaF9 will add the report in the comments

@JuliaF9
Copy link

JuliaF9 commented Feb 25, 2025

Description

We extended the HAnS feature model editor by adding support for cross-tree constraints, optional features (?), and OR/XOR relationships in Clafer. These modifications improve the expressiveness of the feature model and allow for more precise constraints and configuration rules.

Related Issue

#42

Motivation and Context

Feature models are a core part of software product lines, allowing users to define feature relationships and constraints. However, the existing feature model editor lacked support for:
Cross-tree constraints (e.g., [B => A]), which enforce dependencies between non-hierarchical features.
Optional features (?), making feature selection more flexible.
OR/XOR groups, which define feature variability beyond strict parent-child structures.

By adding these capabilities, we improve configuration flexibility, correctness, and automation, making the feature model editor more powerful and user-friendly.

Implemented Functionality

  1. Grammar (FeatureModel.bnf)
    • We extended syntax rules to support:
    • Optional features (A ?)
    • OR/XOR groups (or A1 A2, xor B1 B2)
    • Cross-tree constraints ([B => A])
    • We defined logical expressions (=>, <=>) for feature dependencies.

  2. Lexer (FeatureModel.flex)
    • We added token recognition for the new syntax elements (?, or, xor, =>, <=>, [ ]).
    • Ensured smooth state transitions between tokens.

How Has This Been Tested?

Manual Testing:
• We created a sample feature model with various OR/XOR groups and cross-tree constraints.
• Ensured that invalid feature models produce errors.
-> Verified that the lexer correctly recognizes the new tokens

Open Issues

  1. Token Definitions
    • New token types for the extended syntax still need to be defined. This will allow the IntelliJ parser to recognize and differentiate the newly introduced tokens.

  2. Syntax Highlighting
    • Syntax highlighting for the new operators (?, or, xor, =>, <=>, [ ]) still needs to be implemented.
    • Once implemented, different colors and styles will improve the readability of feature models and visually differentiate operators.

Types of changes

  • Pipeline changes
  • 
Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have updated the CONTRIBUTORS file.
  • I have updated the CHANGELOG.

@DSaatz
Copy link
Author

DSaatz commented Feb 26, 2025

DEMO VIDEO: https://youtu.be/86lXpHOpfxs

Take in regard that due to time constraint we could not finish on the feature and only offer the baseline by giving an implementation of the formal language by changing the grammer and the lexer rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants