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

Naming of arrays / sequences #528

Closed
treiher opened this issue Dec 18, 2020 · 2 comments · Fixed by #661
Closed

Naming of arrays / sequences #528

treiher opened this issue Dec 18, 2020 · 2 comments · Fixed by #661
Assignees
Labels
architectural decision Discussion of design decision generator Related to generator package (SPARK code generation) model Related to model package (e.g., model verification) specification Related to specification package (e.g., specification parsing)

Comments

@treiher
Copy link
Collaborator

treiher commented Dec 18, 2020

Context and Problem Statement

The current use of the terms array and sequence is inconsistent:

Specification: type T is array of E
Python: Array, ArrayType, ArrayValue
SPARK: Message_Sequence, Scalar_Sequence

The mainly used term array might not be the most suitable.

Considered Options

O1: Consistently use array

Specification: type T is array of E
Python: Array, ArrayType, ArrayValue
SPARK: Message_Array, Scalar_Array

+ Specification syntax is similar to Ada, although not identical
Specification uses same term as Ada, although semantics differ: no specification of index type, no direct access to array elements possible
array often refers to collection of fixed-size elements, which is not necessarily the case in our specification

O2: Consistently use sequence

Specification: type T is sequence of E
Python: Sequence, SequenceType, SequenceValue
SPARK: Message_Sequence, Scalar_Sequence

+ Makes divergent syntax and semantics to Ada arrays clear
+ Similar use in ASN.1
Name conflict with Python´s typing.Sequence

O3: Consistently use list

Specification: type T is list of E
Python: List, ListType, ListValue
SPARK: Message_List, Scalar_List

+ Makes divergent syntax and semantics to Ada arrays clear
list usually refers to collection of heterogeneous elements, which is not the case here
Name conflict with Python´s typing.List

O4: Use array and sequence interchangeably

Specification: type T is array of E
Python: Array, ArrayType, ArrayValue
SPARK: Message_Sequence, Scalar_Sequence

+ No changes needed
Inconsistent

Decision Outcome

O2

@treiher treiher added this to To do in RecordFlux 0.5 via automation Dec 18, 2020
@treiher
Copy link
Collaborator Author

treiher commented Dec 18, 2020

O2 seems to me to be the best option.

@senier
Copy link
Member

senier commented Dec 18, 2020

I agree that O2 is the cleanest solution.

@treiher treiher added generator Related to generator package (SPARK code generation) model Related to model package (e.g., model verification) specification Related to specification package (e.g., specification parsing) labels Dec 18, 2020
@treiher treiher self-assigned this May 7, 2021
@treiher treiher moved this from To do to In progress in RecordFlux 0.5 May 7, 2021
treiher added a commit that referenced this issue May 10, 2021
treiher added a commit that referenced this issue May 10, 2021
@treiher treiher moved this from In progress to Under review in RecordFlux 0.5 May 10, 2021
treiher added a commit that referenced this issue May 10, 2021
treiher added a commit that referenced this issue May 10, 2021
treiher added a commit that referenced this issue May 10, 2021
RecordFlux 0.5 automation moved this from Under review to Merged May 11, 2021
treiher added a commit that referenced this issue May 11, 2021
treiher added a commit that referenced this issue May 11, 2021
@treiher treiher added the architectural decision Discussion of design decision label Jul 12, 2021
@treiher treiher mentioned this issue Aug 4, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architectural decision Discussion of design decision generator Related to generator package (SPARK code generation) model Related to model package (e.g., model verification) specification Related to specification package (e.g., specification parsing)
Projects
No open projects
RecordFlux 0.5
  
Merged
Development

Successfully merging a pull request may close this issue.

2 participants