Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parser and model builder for JANI format #30

Merged
merged 7 commits into from
Feb 3, 2025

Conversation

keb77
Copy link
Contributor

@keb77 keb77 commented Dec 5, 2024

No description provided.

@EnricoGhiorzi EnricoGhiorzi self-requested a review December 19, 2024 15:44
@EnricoGhiorzi
Copy link
Collaborator

Thank you for your PR! I will review it in detail, but, for a start, could you make sure the code is formatted using cargo fmt? As you see, there is an automated check that fails because of that.

Signed-off-by: keb77 <[email protected]>
@keb77
Copy link
Contributor Author

keb77 commented Dec 19, 2024

@EnricoGhiorzi I formatted the code and pushed the changes. Thank you!

Signed-off-by: Enrico Ghiorzi <[email protected]>
Copy link
Collaborator

@EnricoGhiorzi EnricoGhiorzi left a comment

Choose a reason for hiding this comment

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

The code looks good but I would like to have some automated tests. I will add a test.rs file that does that but the two examples we can run do not terminate. Why do you think that is the case?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I managed to run this test: parse the jani file, build the channel system, and run random actions on it. I would expect the channel system to terminate (meaning to get to a state in which no more transitions are possible), instead it seems to run forever. Do you have any idea why? Same applies for test.jani.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the problem is caused by the issue we discussed during our last meeting regarding how global variables are handled: in a program graph where a transition has a guard containing global variables, the system continuously checks for updates to those variables (which is done through other transitions). This should be why test.jani doesn't terminate. test2.jani, on the other hand, is structured in a way that should terminate, but it probably gets caught in a loop for similar reasons because the test function always chooses the first element in the possible transitions list. I modified the test function to select random transitions instead and it terminates as expected.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Your last commit has no sign-off and it fails the automated test. Could you fix that?

Also, would it be possible to modify test.jani so that it eventually terminates too? That would make a good automated test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All done!

keb77 added 2 commits January 31, 2025 00:59
Signed-off-by: Federico Solinas <[email protected]>
Signed-off-by: Federico Solinas <[email protected]>
Copy link
Collaborator

@EnricoGhiorzi EnricoGhiorzi left a comment

Choose a reason for hiding this comment

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

The code looks good to me!

@EnricoGhiorzi EnricoGhiorzi merged commit 2e1cb31 into convince-project:main Feb 3, 2025
2 checks passed
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