-
Notifications
You must be signed in to change notification settings - Fork 72
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
Conversation
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Baseline: #382