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

Spec sequential visibility for globals#420

Merged
rossberg merged 3 commits into
mainfrom
spec.globals
Sep 10, 2023
Merged

Spec sequential visibility for globals#420
rossberg merged 3 commits into
mainfrom
spec.globals

Conversation

@rossberg

@rossberg rossberg commented Sep 9, 2023

Copy link
Copy Markdown
Member

Also, add a couple of respective test cases.

@rossberg rossberg requested a review from tlively September 9, 2023 17:23
@rossberg rossberg mentioned this pull request Sep 9, 2023
53 tasks
Comment thread document/core/valid/modules.rst Outdated
\frac{
C \vdashglobal \global_1 : \X{gt}_1
\qquad
C, \CGLOBALS~\X{gt}_1 \vdashglobalseq \global^\ast : \X{gt}^\ast

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since context extension was originally defined with labels in mind, it prepends the new items to the relevant index space in the context, but here we want to append the new global to the end of the index space. It seems we need to define separate notations for prepending and appending extension, or else define a convention that extension prepends for labels and appends for everything else.

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.

Ah, yes, good catch. I'll probably redesign that at some point, but for now I'm using \compose instead here.

Comment thread document/core/valid/modules.rst Outdated

Globals, however, are not recursive and not accessible within :ref:`constant expressions <valid-const>` when they are defined locally.
The effect of defining the limited context :math:`C'` for validating certain definitions is that they can only access functions and imported globals and nothing else.
Globals, however, are not recursive but eveluated sequentially, such that each :ref:`constant expressions <valid-const>` only has access to imported or priviously defined globals.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Globals, however, are not recursive but eveluated sequentially, such that each :ref:`constant expressions <valid-const>` only has access to imported or priviously defined globals.
Globals, however, are not recursive but evaluated sequentially, such that each :ref:`constant expressions <valid-const>` only has access to imported or previously defined globals.

@tlively tlively left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM beyond those comments.

@rossberg

rossberg commented Sep 9, 2023

Copy link
Copy Markdown
Member Author

@tlively, PTAL.

@tlively tlively left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we briefly describe what \compose means in the conventions section? Other than that, LGTM.

@rossberg

Copy link
Copy Markdown
Member Author

It's already described there. ;)

@rossberg rossberg merged commit 5a85356 into main Sep 10, 2023
@rossberg rossberg deleted the spec.globals branch September 10, 2023 06:08
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