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 soundness appendix #406

Merged
merged 15 commits into from
Sep 12, 2023
Merged

Extend soundness appendix #406

merged 15 commits into from
Sep 12, 2023

Conversation

rossberg
Copy link
Member

Also, kill a few related todos.

@conrad-watt, PTAL.

@rossberg rossberg mentioned this pull request Jul 20, 2023
53 tasks

.. math::
\begin{array}{llll}
\production{context} & C &::=&
\{~ \dots, \CRECS ~ (\deftype^\ast)^\ast ~\} \\
\{~ \dots, \CRECS ~ \subtype^\ast ~\} \\
Copy link
Contributor

Choose a reason for hiding this comment

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

the hyperlink on \CRECS doesn't seem to jump to a helpful place right now - is this where \CRECS is defined?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that has been the case for all grammars: at their definition site, the hyperlinks generated by the syntax macros essentially jump to themselves. Admittedly slightly confusing at times.


- Either :math:`\X{ht}_k` is a :ref:`defined type <syntax-deftype>`.

- Or :math:`\X{ht}_k` is a :ref:`type index <syntax-typeidx>` :math:`y_k` that is smaller than :math:`x`.
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 possible to have a mixture of type indices and recursive type indices here? Can you give me more of an intuition about this? I thought that the process of unrolling/rolling meant that you would always have either one or the other.

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it's not, good point. I added a clarifying note to valid/conventions, where the generalised syntax is introduced.

\end{array}
\end{array}
}{
\vdashstore S \ok
}

.. note::
The validity condition on type instances ensures the absence of cyclic types.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this deleted? Is it no longer true? If so, why?

Copy link
Member Author

Choose a reason for hiding this comment

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

This note has been outdated for a while, I just missed it. We no longer have type instances. And since we no longer have indirections through a type store, types are closed syntactic terms and hence non-cyclic by construction.

@@ -382,7 +658,7 @@ Module instances are classified by *module contexts*, which are regular :ref:`co
:ref:`Module Instances <syntax-moduleinst>` :math:`\moduleinst`
...............................................................

* Each :ref:`defined type <syntax-deftype>` :math:`\deftype_i` in :math:`\moduleinst.\MITYPES` must be :ref:`valid <valid-deftype>`.
* Each :ref:`defined type <syntax-deftype>` :math:`\deftype_i` in :math:`\moduleinst.\MITYPES` must be :ref:`valid <valid-deftype>` under the empty :ref:`context <context>`.
Copy link
Contributor

Choose a reason for hiding this comment

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

To confirm, types in module instances aren't stored in their rolled form?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, they are assumed to be rolled up (and closed), see also the definition of alloctype (which I tried to make a bit more readable). But of course, in terms of wf rules for instances, that does not materialise as an observable constraint, since any 1-step unrolling is also a valid defined type, and you can construct a(nother) module that produces that.

For example,

(module $A
  (rec (type $t1 (array (ref $t1)))
  (rec (type $t2 (array (ref $t2)))
)

(module $B
  (rec (type $t1 (array (ref $t1)))
  (rec (type $t2' (array (ref $t1)))
)

are both valid modules, but in the instance of $B, the deftype for $t2' would to look exactly like the unrolling of $t2 in $A.

@rossberg
Copy link
Member Author

rossberg commented Sep 11, 2023

@conrad-watt, I also added the cycle-freedom condition. Fixes #332.

@rossberg
Copy link
Member Author

And fixed a bunch of oversights in the rules for tail calls, which I forgot to adapt for subtyping after the rebase. Fortunately, this was implemented correctly in the interpreter.

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 (although I didn't previously spot the tail call omissions)

@rossberg rossberg merged commit bc304c5 into main Sep 12, 2023
4 checks passed
@rossberg rossberg deleted the spec.soundness branch September 12, 2023 11:32
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