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

Bulk array validation #401

Merged
merged 5 commits into from
Jul 20, 2023
Merged

Bulk array validation #401

merged 5 commits into from
Jul 20, 2023

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}

@@ -147,9 +147,6 @@ A :ref:`value type <syntax-valtype>` :math:`\valtype_1` matches a :ref:`value ty
}


.. 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
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 merged commit 94c9014 into main Jul 20, 2023
4 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.

None yet

2 participants