Skip to content

Commit 3aa6936

Browse files
committed
Revert context extension notation
1 parent 6299fc3 commit 3aa6936

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

document/core/syntax/conventions.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ The following conventions are adopted in defining grammar rules for abstract syn
4141

4242

4343

44+
.. _notation-epsilon:
45+
.. _notation-length:
46+
.. _notation-index:
4447
.. _notation-slice:
4548
.. _notation-replace:
4649
.. _notation-record:
50+
.. _notation-project:
4751
.. _notation-concat:
4852
.. _notation-compose:
4953

document/core/valid/conventions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ In addition to field access written :math:`C.\K{field}` the following notation i
6868

6969
* When spelling out a context, empty fields are omitted.
7070

71-
* The notation :math:`\K{field}\,A^\ast, C` denotes the same context as :math:`C` but with the elements :math:`A^\ast` prepended to its :math:`\K{field}` component sequence.
71+
* :math:`C,\K{field}\,A^\ast` denotes the same context as :math:`C` but with the elements :math:`A^\ast` prepended to its :math:`\K{field}` component sequence.
7272

7373
.. note::
74-
The notation for context extension is only used in situations where the original :math:`C.\K{field}` is either empty
75-
or :math:`\K{field}` is :math:`\K{labels}`.
76-
It is reversed from usual conventions because it *prepends* not *appends*, in accordance with the use of relative indexing to look up a label in the context's label list.
74+
We use :ref:`indexing notation <notation-index>` like :math:`C.\CLABELS[x]` to look up indices in their respective :ref:`index space <syntax-index>` in the context.
75+
Context extension notation :math:`C,\K{field}\,A` is primarily used to locally extend *relative* index spaces, such as :ref:`label indices <syntax-labelidx>`.
76+
Accordingly, the notation is defined to append at the *front* of the respective sequence, introducing a new relative index :math:`0` and shifting the existing ones.
7777

7878

7979
.. _valid-notation-textual:

document/core/valid/instructions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ Control Instructions
477477

478478
.. math::
479479
\frac{
480-
\CLABELS\,[t^?], C \vdashinstrseq \instr^\ast : [] \to [t^?]
480+
C,\CLABELS\,[t^?] \vdashinstrseq \instr^\ast : [] \to [t^?]
481481
}{
482482
C \vdashinstr \BLOCK~[t^?]~\instr^\ast~\END : [] \to [t^?]
483483
}
@@ -501,7 +501,7 @@ Control Instructions
501501

502502
.. math::
503503
\frac{
504-
\CLABELS\,[], C \vdashinstrseq \instr^\ast : [] \to [t^?]
504+
C,\CLABELS\,[] \vdashinstrseq \instr^\ast : [] \to [t^?]
505505
}{
506506
C \vdashinstr \LOOP~[t^?]~\instr^\ast~\END : [] \to [t^?]
507507
}
@@ -528,9 +528,9 @@ Control Instructions
528528

529529
.. math::
530530
\frac{
531-
\CLABELS\,[t^?], C \vdashinstrseq \instr_1^\ast : [] \to [t^?]
531+
C,\CLABELS\,[t^?] \vdashinstrseq \instr_1^\ast : [] \to [t^?]
532532
\qquad
533-
\CLABELS\,[t^?], C \vdashinstrseq \instr_2^\ast : [] \to [t^?]
533+
C,\CLABELS\,[t^?] \vdashinstrseq \instr_2^\ast : [] \to [t^?]
534534
}{
535535
C \vdashinstr \IF~[t^?]~\instr_1^\ast~\ELSE~\instr_2^\ast~\END : [\I32] \to [t^?]
536536
}

document/core/valid/modules.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Functions :math:`\func` are classified by :ref:`function types <syntax-functype>
4242
\frac{
4343
C.\CTYPES[x] = [t_1^\ast] \to [t_2^?]
4444
\qquad
45-
\CLOCALS\,t_1^\ast~t^\ast,\CLABELS~[t_2^?],\CRETURN~[t_2^?], C \vdashexpr \expr : [t_2^?]
45+
C,\CLOCALS\,t_1^\ast~t^\ast,\CLABELS~[t_2^?],\CRETURN~[t_2^?] \vdashexpr \expr : [t_2^?]
4646
}{
4747
C \vdashfunc \{ \FTYPE~x, \FLOCALS~t^\ast, \FBODY~\expr \} : [t_1^\ast] \to [t_2^?]
4848
}

0 commit comments

Comments
 (0)