Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Extend soundness appendix#406

Merged
rossberg merged 15 commits into
mainfrom
spec.soundness
Sep 12, 2023
Merged

Extend soundness appendix#406
rossberg merged 15 commits into
mainfrom
spec.soundness

Conversation

@rossberg

Copy link
Copy Markdown
Member

Also, kill a few related todos.

@conrad-watt, PTAL.

@rossberg rossberg mentioned this pull request Jul 20, 2023
53 tasks
\begin{array}{llll}
\production{context} & C &::=&
\{~ \dots, \CRECS ~ (\deftype^\ast)^\ast ~\} \\
\{~ \dots, \CRECS ~ \subtype^\ast ~\} \\

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

}

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

Copy link
Copy Markdown
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
Copy Markdown
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.

...............................................................

* 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
Copy Markdown
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
Copy Markdown
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

rossberg commented Sep 11, 2023

Copy link
Copy Markdown
Member Author

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

@rossberg

Copy link
Copy Markdown
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.

@conrad-watt conrad-watt left a comment

Copy link
Copy Markdown
Contributor

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
@rossberg rossberg deleted the spec.soundness branch September 12, 2023 11:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants