Skip to content

Commit c04a679

Browse files
committed
add rule appendix entries, add initial wait/notify axioms
1 parent 0ae4b4b commit c04a679

3 files changed

Lines changed: 52 additions & 7 deletions

File tree

document/core/appendix/index-rules.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,13 @@ Construct Judgement
114114
:ref:`Expression <exec-expr>` :math:`S;F;\expr \stepto^{\act^\ast} S';F';\expr'`
115115
:ref:`Configuration <syntax-reduction>` :math:`\config \stepto^{\evt} \config'`
116116
=============================================== ===============================================================================
117+
118+
Relaxed Memory Model
119+
~~~~~~~~~~~~~~~~~~~~
120+
121+
================================================== ===============================================================================
122+
Construct Judgement
123+
================================================== ===============================================================================
124+
:ref:`Pre-execution <relaxed-trace>` :math:`\vdash \config : \trace`
125+
:ref:`Consistent execution <relaxed-consistent>` :math:`\vdash \trace~\consistent`
126+
================================================== ===============================================================================

document/core/exec/relaxed.rst

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Preliminary Definitions
2222
.. math::
2323
\begin{array}{rcl}
2424
\timeevt(\act^\ast~\AT~\time_p~\time) & = & \time \\
25+
\timeevt_p(\act^\ast~\AT~\time_p~\time) & = & \time_p \\
2526
&&\\
2627
\locact(\ARD_{\ord}~\loc~\byte^\ast~\NOTEARS^?) & = & \loc \\
2728
\locact(\AWR_{\ord}~\loc~\byte^\ast~\NOTEARS^?) & = & \loc \\
@@ -40,6 +41,11 @@ Preliminary Definitions
4041
&&\\
4142
\readingact(\act) & = & (\readact(\act) \neq \epsilon) \\
4243
\writingact(\act) & = & (\writeact(\act) \neq \epsilon) \\
44+
\suspensionact(\u32, \AWAIT~\reg[\u32]~\s64) & = & \AWAIT~\reg[\u32]~\s64 \\
45+
\suspensionact(\u32, \AWOKEN~\reg[\u32]) & = & \AWOKEN~\reg[\u32] \\
46+
\suspensionact(\u32, \ATIMEOUT~\reg[\u32]) & = & \ATIMEOUT~\reg[\u32] \\
47+
\suspensionact(\u32, \ANOTIFY~\reg[\u32]~\u32'~\u32'') & = & \ANOTIFY~\reg[\u32]~\u32'~\u32'' \\
48+
\suspensionact(\u32, \act) & = & \epsilon \qquad \otherwise \\
4349
&&\\
4450
\readact(\ARD_{\ord}~\loc~\byte^\ast~\NOTEARS^?) & = & \byte^\ast \\
4551
\readact(\ARMW~\loc~{\byte_1}^\ast~{\byte_2}^\ast) & = & {\byte_1}^\ast \\
@@ -61,6 +67,7 @@ Preliminary Definitions
6167
\tearfreeact(\AWR_{\ord}~\loc~\byte^\ast) & = & \bot \qquad (\iff~\ord = \UNORD \vee \ord = \INIT) \\
6268
\tearfreeact(\act) & = & \top \qquad (\otherwise) \\
6369
&&\\
70+
\idact(\act) & = & \act \\
6471
\X{func}_{\reg}(\act_1^\ast~\act~\act_2^\ast~\AT~\time_p~\time) & = & \X{func}(\act) \\
6572
&& (\iff~\locact(\act) = \reg[\u32]) \\
6673
\X{func}_{\reg}(\act_1^\ast~\act~\act_2^\ast~\AT~\time_p~\time, \quad &&\\
@@ -78,11 +85,11 @@ Traces
7885

7986
.. todo:: novel notation here?
8087

81-
A trace is a coinductive set of :ref:`events <syntax-evt>`. A trace is considered to be a *pre-execution* of a given :ref:`global configuration <syntax-config>` if it can be derived from the events emitted by the coinductive closure of the :ref:`global reduction relation <syntax-reduction>` on that configuration, and all the :ref:`time stamps <syntax-time>` of its constituent events are distinct.
88+
A trace is a coinductive list of :ref:`events <syntax-evt>`. A trace is considered to be a *pre-execution* of a given :ref:`global configuration <syntax-config>` if it represents the events emitted by the coinductive closure of the :ref:`global reduction relation <syntax-reduction>` on that configuration, such that all of the trace's consituent events have unique :ref:`time stamps <syntax-time>` that are totally ordered according to the reduction order.
8289

8390
.. math::
8491
\begin{array}{c}
85-
\config \stepto^{\evt} \config' \qquad \vdash \config' : \trace \qquad \timeevt(\evt) \notin \timeevt^\ast(\trace) \\[0.2ex]
92+
\begin{array}{c}\config \stepto^{\evt} \config' \qquad \vdash \config' : \trace \\ \forall \evt' \in \trace, \timeevt(\evt') \prectot \timeevt(\evt)\end{array} \qquad \begin{array}{l}\timeevt(\evt) \notin \timeevt^\ast(\trace) \\ \timeevt_p(\evt) \notin \timeevt_p^\ast(\trace)\end{array} \\[0.2ex]
8693
\hline \\[-0.8ex]
8794
\hline \\[-0.8ex]
8895
\vdash \config : \evt~\trace
@@ -108,7 +115,7 @@ Consistency
108115
.. math::
109116
\frac{
110117
\begin{array}[b]{@{}c@{}}
111-
\vdash_{\reg} \trace~\suspensionsconsistentwith \\
118+
\forall i, \vdash_{\reg}^i \trace~\suspensionsconsistent \\
112119
\forall \evt_R \in \readingact_{\reg}(\trace), \exists \evt_W^\ast,
113120
\trace \vdash_{\reg} \evt_R~\readseachfrom~\evt_W^\ast \\
114121
\forall \evt_I, \evt \in \trace, \,
@@ -191,13 +198,37 @@ Consistency
191198
192199
.. math::
193200
\frac{
194-
TODO
201+
\begin{array}{c}\suspensionact_{\reg}^\ast(i, \trace) = \trace' \qquad \vdash_{\reg}^i \trace'~\suspensionsconsistentwith(\epsilon) \\ \forall \evt,\evt' \in \trace',~\evt \prectot \evt' \Longrightarrow \evt \prechb \evt'\end{array}
195202
}{
196-
\vdash_{\reg} \trace~\suspensionsconsistentwith
203+
\vdash_{\reg}^i \trace~\suspensionsconsistent
197204
}
198205
206+
.. math::
207+
\frac{
208+
}{
209+
\vdash_{\reg}^i \epsilon~\suspensionsconsistentwith(\time^\ast)
210+
}
211+
212+
.. math::
213+
\frac{
214+
\idact_{\reg}(\evt) = (\AWAIT~\reg[i]~\s64) \qquad \vdash_{\reg}^i \trace~\suspensionsconsistentwith(\timeevt(\evt)~\time^\ast)
215+
}{
216+
\vdash_{\reg}^i \evt~\trace~\suspensionsconsistentwith(\time^\ast)
217+
}
199218
200-
.. todo:: pull out the trace events which denote wait/wake actions as a timestamped list, check queue behaviour
219+
.. math::
220+
\frac{
221+
\idact_{\reg}(\evt) = (\ATIMEOUT~\reg[i]) \qquad \vdash_{\reg}^i \trace~\suspensionsconsistentwith(\time^\ast~\time'^\ast)
222+
}{
223+
\vdash_{\reg}^i \evt~\trace~\suspensionsconsistentwith(\time^\ast~\timeevt_p(\evt)~\time'^\ast)
224+
}
225+
226+
.. math::
227+
\frac{
228+
\begin{array}{c}\idact_{\reg}^n(\evt^n) = (\AWOKEN~\reg[i]) \qquad \idact_{\reg}(\evt_N) = (\ANOTIFY~\reg[i]~n~k) \\ n < k \Longrightarrow m = 0 \qquad \vdash_{\reg}^i \trace~\suspensionsconsistentwith(\time^m)\end{array}
229+
}{
230+
\vdash_{\reg}^i \evt^n~\evt_N~\trace~\suspensionsconsistentwith(\time^m~\timeevt_p^n(\evt^n))
231+
}
201232
202233
203234
.. [#cite-oopsla2019]

document/core/util/macros.def

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,8 @@
11191119

11201120
.. |timeevt| mathdef:: \xref{exec/relaxed}{relaxed-aux}{\F{time}}
11211121

1122-
.. |locact| mathdef:: \xref{exec/relaxed}{exec-locact}{\F{loc}}
1122+
.. |locact| mathdef:: \xref{exec/relaxed}{relaxed-aux}{\F{loc}}
1123+
.. |idact| mathdef:: \xref{exec/relaxed}{relaxed-aux}{\F{id}}
11231124

11241125
.. |readingact| mathdef:: \xref{exec/relaxed}{relaxed-aux}{\F{reading}}
11251126
.. |ordact| mathdef:: \xref{exec/relaxed}{relaxed-aux}{\F{ord}}
@@ -1138,11 +1139,14 @@
11381139
.. |tearfreeact| mathdef:: \xref{exec/relaxed}{relaxed-aux}{\F{tearfree}}
11391140
.. |sameact| mathdef:: \xref{exec/relaxed}{relaxed-aux}{\F{same}}
11401141

1142+
.. |suspensionact| mathdef:: \xref{exec/relaxed}{relaxed-aux}{\F{susp}}
1143+
11411144

11421145
.. Relaxed Memory Model Judgements
11431146

11441147
.. |consistent| mathdef:: \xref{exec/relaxed}{relaxed-consistent}{\mathrel{\mbox{consistent}}}
11451148
.. |consistentwith| mathdef:: \xref{exec/relaxed}{relaxed-consistent}{\mathrel{\mbox{consistent-with}}}
1149+
.. |suspensionsconsistent| mathdef:: \xref{exec/relaxed}{relaxed-consistent}{\mathrel{\mbox{suspensions-consistent}}}
11461150
.. |suspensionsconsistentwith| mathdef:: \xref{exec/relaxed}{relaxed-consistent}{\mathrel{\mbox{suspensions-consistent-with}}}
11471151
.. |readseachfrom| mathdef:: \xref{exec/relaxed}{relaxed-consistent}{\mathrel{\mbox{reads-each-from}}}
11481152
.. |readsfrom| mathdef:: \xref{exec/relaxed}{relaxed-consistent}{\mathrel{\mbox{reads-from}}}

0 commit comments

Comments
 (0)