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

Arrays of clocks and actions #170

Merged
merged 29 commits into from
Apr 26, 2024
Merged

Arrays of clocks and actions #170

merged 29 commits into from
Apr 26, 2024

Conversation

tomaz1502
Copy link
Collaborator

@tomaz1502 tomaz1502 commented Mar 14, 2024

This PR adds support for arrays of actions and clocks. This is a different kind of array, which is only syntatic and only exists before the conversion of unexpanded_parsed_model to parsed_model.

In addition, it replaces the type parsed_model_with_templates with the new type unexpanded_parsed_model. It follows the same idea as the former but also adding information about syntatic arrays in the type (together with the information about templates). Now the function that we export has type unexpanded_parsed_model -> parsed_model.

Another difference in this type is that it does not contain a single field with type parsed_model. Instead, it contains * all * the fields of parsed_model as individual fields. The fields are renamed in unexpanded_parsed_model to avoid crashing the type inference. This is useful since there are a couple of fields that are slightly modified before the expansion. For instance, before expansion, actions have type name_or_access, as they can be the result of a lookup of an array of actions, but after the expansion these arrays do not exist anymore, so the type of actions become just string.

Two features are missing and will come in the next PRs: arrays of parameters and the support for arbitrary arithmetic expressions in accesses of syntatic arrays.

@tomaz1502 tomaz1502 marked this pull request as draft March 14, 2024 15:53
@tomaz1502 tomaz1502 marked this pull request as ready for review April 2, 2024 15:39
@tomaz1502 tomaz1502 changed the title [WIP] New feature: Arrays of clocks and actions Arrays of clocks and actions Apr 2, 2024
src/lib/ImitatorUtilities.ml Show resolved Hide resolved
src/lib/ParsingStructure.mli Show resolved Hide resolved
src/lib/Templates.ml Outdated Show resolved Hide resolved
src/lib/Templates.ml Outdated Show resolved Hide resolved
src/lib/ModelParser.mly Show resolved Hide resolved
src/lib/ModelParser.mly Show resolved Hide resolved
src/lib/ModelParser.mly Outdated Show resolved Hide resolved
src/lib/Templates.ml Outdated Show resolved Hide resolved
src/lib/Templates.ml Show resolved Hide resolved
src/lib/Templates.ml Show resolved Hide resolved
@tomaz1502 tomaz1502 merged commit 562d59a into develop Apr 26, 2024
4 checks passed
@tomaz1502 tomaz1502 deleted the chore/unexpanded_arrays branch April 26, 2024 17:00
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