This repository was archived by the owner on Apr 25, 2025. It is now read-only.
Conversation
conrad-watt
reviewed
Jul 18, 2023
document/core/appendix/algorithm.rst
Outdated
| 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. |
Contributor
There was a problem hiding this comment.
Do we plan to sketch an algorithm for this?
Member
Author
There was a problem hiding this comment.
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) |
Contributor
There was a problem hiding this comment.
is it ok that the new helper functions here, validate_ref_type, and is_func/struct etc, are never defined above?
Member
Author
There was a problem hiding this comment.
Added them to the Data Structures section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Baseline: #382