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

Extend validation algorithm appendix #390

Merged
merged 4 commits into from
Jul 20, 2023
Merged

Extend validation algorithm appendix #390

merged 4 commits into from
Jul 20, 2023

Conversation

rossberg
Copy link
Member

Baseline: #382

@rossberg rossberg mentioned this pull request Jun 23, 2023
53 tasks
This includes *recursive* references to enclosing :ref:`defined types <syntax-deftype>`,
such that type representations form graphs and may be *cyclic* for :ref:`recursive types <syntax-rectype>`.

We assume that all types have been *canonicalized*, such that equality on two type representations holds if and only if they are in fact :ref:`equivalent <equiv>`. making it a constant-time check.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we plan to sketch an algorithm for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

For canonicalisation? No, that's a standard algorithm on trees.

I started writing out the subtyping algorithm, but concluded that it wasn't interesting enough either. After all, the point of this appendix is to show a sketch of a linear validation algorithm, because that can be written quite differently from the declarative rules. That's not the case for other parts of the semantics.

pop_vals(ft.params)
push_vals(ft.results)
case (br_on_cast n rt1 rt2)
validate_ref_type(rt1)
Copy link
Contributor

Choose a reason for hiding this comment

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

is it ok that the new helper functions here, validate_ref_type, and is_func/struct etc, are never defined above?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added them to the Data Structures section.

Copy link
Contributor

@conrad-watt conrad-watt left a comment

Choose a reason for hiding this comment

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

lgtm

Base automatically changed from spec.valid-types to main July 20, 2023 06:07
@rossberg rossberg merged commit bb84882 into main Jul 20, 2023
3 checks passed
@rossberg rossberg deleted the spec.algorithm branch July 20, 2023 06:19
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