Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Bulk array validation#401

Merged
tlively merged 5 commits intomainfrom
bulk-array-validation
Jul 20, 2023
Merged

Bulk array validation#401
tlively merged 5 commits intomainfrom
bulk-array-validation

Conversation

@tlively
Copy link
Member

@tlively tlively commented Jul 19, 2023

Add validation rules (prose and formalism) for array.fill, array.copy,
array.init_data, and array.init_elem. As part of the rules for array.copy,
extend the matches relation to storage types.

@tlively tlively requested a review from rossberg July 19, 2023 04:33
@tlively
Copy link
Member Author

tlively commented Jul 19, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

Copy link
Member

@rossberg rossberg left a comment

Choose a reason for hiding this comment

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

LGTM modulo comments.

.. index:: storage type
.. _match-storagetype:

Storage Types
Copy link
Member

Choose a reason for hiding this comment

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

Subtyping rules for storage types are already added by #382, so I'd suggest to omit them in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've now also removed the macros that will be added back in by #382.

.. _valid-array.fill:

:math:`\ARRAYFILL~x`
...........................
Copy link
Member

Choose a reason for hiding this comment

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

Underline length


.. math::
\frac{
\expand(C.\CTYPES[x]) = \TARRAY~(\MVAR~\X{st_1}) \qquad \expand(C.\CTYPES[y]) = \TARRAY~(\mut~\X{st_2}) \qquad C \vdashstoragetypematch \X{st_2} \matchesstoragetype \X{st_1}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
\expand(C.\CTYPES[x]) = \TARRAY~(\MVAR~\X{st_1}) \qquad \expand(C.\CTYPES[y]) = \TARRAY~(\mut~\X{st_2}) \qquad C \vdashstoragetypematch \X{st_2} \matchesstoragetype \X{st_1}
\expand(C.\CTYPES[x]) = \TARRAY~(\MVAR~\X{st_1})
\qquad
\expand(C.\CTYPES[y]) = \TARRAY~(\mut~\X{st_2})
\qquad
C \vdashstoragetypematch \X{st_2} \matchesstoragetype \X{st_1}


.. index:: result type, value type
.. _match-resulttype:

Copy link
Member

Choose a reason for hiding this comment

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

Did you want to delete those?

Copy link
Member Author

Choose a reason for hiding this comment

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

nope, thanks


.. _valid-array.init_elem:

:math:`\ARRAYINITELEM~x~y
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be missing a closing tick.

@tlively
Copy link
Member Author

tlively commented Jul 19, 2023

We'll wait on #382 to land this, since it no longer builds independently.

@rossberg rossberg mentioned this pull request Jul 20, 2023
53 tasks
tlively added 4 commits July 20, 2023 13:12
Add validation rules (prose and formalism) for `array.fill`, `array.copy`,
`array.init_data`, and `array.init_elem`. As part of the rules for `array.copy`,
extend the `matches` relation to storage types.
@tlively tlively force-pushed the bulk-array-validation branch from e639ed8 to c5861b9 Compare July 20, 2023 20:12
@tlively tlively merged commit 94c9014 into main Jul 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants