Skip to content

Lower & upper bounds on variables - #431

Merged
maxkratz merged 9 commits into
masterfrom
feature/variable-bounds
Aug 27, 2026
Merged

Lower & upper bounds on variables#431
maxkratz merged 9 commits into
masterfrom
feature/variable-bounds

Conversation

@MarkBeB

@MarkBeB MarkBeB commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

This PR introduces new optional syntax to GIPSL for setting upper and lower bounds on type and mapping variables. This will resolve #421 . Tests can be found here Echtzeitsysteme/gips-tests#146

After defining the type of a variable, the inclusive bounds are specified within brackets ([ <lower> , <upper> ]), separated by a comma. If a lower or upper bound is not needed, an asterisk (*) can be used as a placeholder.
The syntax is validated to ensure that the lower bound is always less than or equal to the upper bound. If the lower bound exceeds the upper bound, a validation error is triggered.

Examples:

  • var variableA : EInt [0 , 5] (lower bound: 0, upper bound 5)
  • var variableB : EInt [* , 7] (no lower bound, upper bound 7)
  • var variableC : EDouble [1.5 , *] (lower bound: 1.5 , no upper bound)

@MarkBeB
MarkBeB requested a review from maxkratz August 20, 2026 12:23
@MarkBeB MarkBeB added the enhancement New feature or request label Aug 20, 2026
@maxkratz

Copy link
Copy Markdown
Member

I checked the feature branch out and gave it a try. Unfortunately, I get Java compiler errors within the generated code of multiple gips-test projects. Is this some local Eclipse issue on my system? Can you please verify that all of the tests pass on your system, @MarkBeB? Thanks!

@maxkratz maxkratz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the last two commits I checked everything again and it was working as expected. I ran all related tests and everything passes.

@MarkBeB I suppose I can merge this PR now?

@MarkBeB

MarkBeB commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Yes, I forgot to rebuild the test projects after making changes to the code generator. Everything seems to be working properly now.

@maxkratz

Copy link
Copy Markdown
Member

Yes, I forgot to rebuild the test projects after making changes to the code generator. Everything seems to be working properly now.

Alright, thank you very much!

@maxkratz
maxkratz merged commit 14c95b5 into master Aug 27, 2026
@maxkratz
maxkratz deleted the feature/variable-bounds branch August 27, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: variable bounds

2 participants