Skip to content

Commit 0838cf9

Browse files
jensmaurertkoeppe
authored andcommitted
[intro] Replace \term with \placeholder or \defn as appropriate (#1062)
Partially addresses #329.
1 parent 6e498da commit 0838cf9

File tree

2 files changed

+91
-92
lines changed

2 files changed

+91
-92
lines changed

source/basic.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2850,7 +2850,7 @@
28502850

28512851
\pnum
28522852
\indextext{storage~duration|(}%
2853-
Storage duration is the property of an object that defines the minimum
2853+
The \defnx{storage duration}{storage~duration} is the property of an object that defines the minimum
28542854
potential lifetime of the storage containing the object. The storage
28552855
duration is determined by the construct used to create the object and is
28562856
one of the following:

source/intro.tex

Lines changed: 90 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
\Cpp is a general purpose programming language based on the C
4040
programming language as described in ISO/IEC 9899:2011
4141
\doccite{Programming languages --- C} (hereinafter referred to as the
42-
\indexdefn{C!standard}\term{C standard}). In addition to
42+
\defnx{C standard}{C!standard}). In addition to
4343
the facilities provided by C, \Cpp provides additional data types,
4444
classes, templates, exceptions, namespaces, operator
4545
overloading, function name overloading, references, free store
@@ -548,13 +548,13 @@
548548
occupies storage in the way that objects do. \end{note}
549549
The properties of an
550550
object are determined when the object is created. An object can have a
551-
\term{name}~(Clause~\ref{basic}). An object has a \term{storage
552-
duration}~(\ref{basic.stc}) which influences its
553-
\term{lifetime}~(\ref{basic.life}). An object has a
554-
\term{type}~(\ref{basic.types}). The term \defn{object type} refers to
551+
name~(Clause~\ref{basic}). An object has a storage
552+
duration~(\ref{basic.stc}) which influences its
553+
lifetime~(\ref{basic.life}). An object has a
554+
type~(\ref{basic.types}). The term \defn{object type} refers to
555555
the type with which the object is created.
556556
Some objects are
557-
\term{polymorphic}~(\ref{class.virtual}); the implementation
557+
polymorphic~(\ref{class.virtual}); the implementation
558558
generates information associated with each such object that makes it
559559
possible to determine that object's type during program execution. For
560560
other objects, the interpretation of the values found therein is
@@ -950,16 +950,16 @@
950950
\pnum
951951
\defn{Sequenced before} is an asymmetric, transitive, pair-wise relation between
952952
evaluations executed by a single thread~(\ref{intro.multithread}), which induces
953-
a partial order among those evaluations. Given any two evaluations \term{A} and
954-
\term{B}, if \term{A} is sequenced before \term{B}
955-
(or, equivalently, \term{B} is \defn{sequenced after} \term{A}),
953+
a partial order among those evaluations. Given any two evaluations \placeholder{A} and
954+
\placeholder{B}, if \placeholder{A} is sequenced before \placeholder{B}
955+
(or, equivalently, \placeholder{B} is \defn{sequenced after} \placeholder{A}),
956956
then the execution of
957-
\term{A} shall precede the execution of \term{B}. If \term{A} is not sequenced
958-
before \term{B} and \term{B} is not sequenced before \term{A}, then \term{A} and
959-
\term{B} are \defn{unsequenced}. \begin{note} The execution of unsequenced
960-
evaluations can overlap. \end{note} Evaluations \term{A} and \term{B} are
961-
\defn{indeterminately sequenced} when either \term{A} is sequenced before
962-
\term{B} or \term{B} is sequenced before \term{A}, but it is unspecified which.
957+
\placeholder{A} shall precede the execution of \placeholder{B}. If \placeholder{A} is not sequenced
958+
before \placeholder{B} and \placeholder{B} is not sequenced before \placeholder{A}, then \placeholder{A} and
959+
\placeholder{B} are \defn{unsequenced}. \begin{note} The execution of unsequenced
960+
evaluations can overlap. \end{note} Evaluations \placeholder{A} and \placeholder{B} are
961+
\defn{indeterminately sequenced} when either \placeholder{A} is sequenced before
962+
\placeholder{B} or \placeholder{B} is sequenced before \placeholder{A}, but it is unspecified which.
963963
\begin{note} Indeterminately sequenced evaluations cannot overlap, but either
964964
could be executed first. \end{note}
965965
An expression \placeholder{X}
@@ -1027,16 +1027,16 @@
10271027
expression, or with the postfix expression designating the called
10281028
function, is sequenced before execution of every expression or statement
10291029
in the body of the called function.
1030-
For each function invocation \term{F},
1031-
for every evaluation \term{A} that occurs within \term{F} and
1032-
every evaluation \term{B} that does not occur within \term{F} but
1030+
For each function invocation \placeholder{F},
1031+
for every evaluation \placeholder{A} that occurs within \placeholder{F} and
1032+
every evaluation \placeholder{B} that does not occur within \placeholder{F} but
10331033
is evaluated on the same thread and as part of the same signal handler (if any),
1034-
either \term{A} is sequenced before \term{B} or
1035-
\term{B} is sequenced before \term{A}.
1034+
either \placeholder{A} is sequenced before \placeholder{B} or
1035+
\placeholder{B} is sequenced before \placeholder{A}.
10361036
\footnote{In other words, function executions do not interleave with
10371037
each other.}
10381038
\begin{note}
1039-
If \term{A} and \term{B} would not otherwise be sequenced then they are
1039+
If \placeholder{A} and \placeholder{B} would not otherwise be sequenced then they are
10401040
indeterminately sequenced.
10411041
\end{note}
10421042
Several contexts in \Cpp cause evaluation of a function call, even
@@ -1088,8 +1088,8 @@
10881088
\rSec2[intro.races]{Data races}
10891089

10901090
\pnum
1091-
The value of an object visible to a thread \term{T} at a particular point is the
1092-
initial value of the object, a value assigned to the object by \term{T}, or a
1091+
The value of an object visible to a thread \placeholder{T} at a particular point is the
1092+
initial value of the object, a value assigned to the object by \placeholder{T}, or a
10931093
value assigned to the object by another thread, according to the rules below.
10941094
\begin{note} In some cases, there may instead be undefined behavior. Much of this
10951095
section is motivated by the desire to support atomic operations with explicit
@@ -1116,29 +1116,29 @@
11161116
perform an acquire operation on the locations comprising the mutex.
11171117
Correspondingly, a call that releases the same mutex will perform a release
11181118
operation on those same locations. Informally, performing a release operation on
1119-
\term{A} forces prior
1119+
\placeholder{A} forces prior
11201120
\indextext{side effects}%
11211121
side effects on other memory locations to become visible
11221122
to other threads that later perform a consume or an acquire operation on
1123-
\term{A}. ``Relaxed'' atomic operations are not synchronization operations even
1123+
\placeholder{A}. ``Relaxed'' atomic operations are not synchronization operations even
11241124
though, like synchronization operations, they cannot contribute to data races.
11251125
\end{note}
11261126

11271127
\pnum
1128-
All modifications to a particular atomic object \term{M} occur in some
1129-
particular total order, called the \defn{modification order} of \term{M}.
1128+
All modifications to a particular atomic object \placeholder{M} occur in some
1129+
particular total order, called the \defn{modification order} of \placeholder{M}.
11301130
\begin{note} There is a separate order for each
11311131
atomic object. There is no requirement that these can be combined into a single
11321132
total order for all objects. In general this will be impossible since different
11331133
threads may observe modifications to different objects in inconsistent orders.
11341134
\end{note}
11351135

11361136
\pnum
1137-
A \defn{release sequence} headed by a release operation \term{A} on an atomic object
1138-
\term{M} is a maximal contiguous sub-sequence of
1137+
A \defn{release sequence} headed by a release operation \placeholder{A} on an atomic object
1138+
\placeholder{M} is a maximal contiguous sub-sequence of
11391139
\indextext{side effects}%
11401140
side effects in the
1141-
modification order of \term{M}, where the first operation is \tcode{A}, and
1141+
modification order of \placeholder{M}, where the first operation is \tcode{A}, and
11421142
every subsequent operation
11431143

11441144
\begin{itemize}
@@ -1159,92 +1159,92 @@
11591159
the value written'' by the last mutex release. \end{note}
11601160

11611161
\pnum
1162-
An evaluation \term{A} \defn{carries a dependency} to an evaluation \term{B} if
1162+
An evaluation \placeholder{A} \defn{carries a dependency} to an evaluation \placeholder{B} if
11631163

11641164
\begin{itemize}
11651165

11661166
\item
1167-
the value of \term{A} is used as an operand of \term{B}, unless:
1167+
the value of \placeholder{A} is used as an operand of \placeholder{B}, unless:
11681168
\begin{itemize}
11691169

11701170
\item
1171-
\term{B} is an invocation of any specialization of
1171+
\placeholder{B} is an invocation of any specialization of
11721172
\tcode{std::kill_dependency}~(\ref{atomics.order}), or
11731173

11741174
\item
1175-
\term{A} is the left operand of a built-in logical AND (\tcode{\&\&},
1175+
\placeholder{A} is the left operand of a built-in logical AND (\tcode{\&\&},
11761176
see~\ref{expr.log.and}) or logical OR (\tcode{||}, see~\ref{expr.log.or})
11771177
operator, or
11781178

11791179
\item
1180-
\term{A} is the left operand of a conditional (\tcode{?:}, see~\ref{expr.cond})
1180+
\placeholder{A} is the left operand of a conditional (\tcode{?:}, see~\ref{expr.cond})
11811181
operator, or
11821182

11831183
\item
1184-
\term{A} is the left operand of the built-in comma (\tcode{,})
1184+
\placeholder{A} is the left operand of the built-in comma (\tcode{,})
11851185
operator~(\ref{expr.comma}); \end{itemize} or
11861186

11871187
\item
1188-
\term{A} writes a scalar object or bit-field \term{M}, \term{B} reads the value
1189-
written by \term{A} from \term{M}, and \term{A} is sequenced before \term{B}, or
1188+
\placeholder{A} writes a scalar object or bit-field \placeholder{M}, \placeholder{B} reads the value
1189+
written by \placeholder{A} from \placeholder{M}, and \placeholder{A} is sequenced before \placeholder{B}, or
11901190

11911191
\item
1192-
for some evaluation \term{X}, \term{A} carries a dependency to \term{X}, and
1193-
\term{X} carries a dependency to \term{B}.
1192+
for some evaluation \placeholder{X}, \placeholder{A} carries a dependency to \placeholder{X}, and
1193+
\placeholder{X} carries a dependency to \placeholder{B}.
11941194

11951195
\end{itemize}
11961196

11971197
\begin{note} ``Carries a dependency to'' is a subset of ``is sequenced before'',
11981198
and is similarly strictly intra-thread. \end{note}
11991199

12001200
\pnum
1201-
An evaluation \term{A} is \defn{dependency-ordered before} an evaluation
1202-
\term{B} if
1201+
An evaluation \placeholder{A} is \defn{dependency-ordered before} an evaluation
1202+
\placeholder{B} if
12031203
\begin{itemize}
12041204

12051205
\item
1206-
\term{A} performs a release operation on an atomic object \term{M}, and, in
1207-
another thread, \term{B} performs a consume operation on \term{M} and reads a
1206+
\placeholder{A} performs a release operation on an atomic object \placeholder{M}, and, in
1207+
another thread, \placeholder{B} performs a consume operation on \placeholder{M} and reads a
12081208
value written by any
12091209
\indextext{side effects}%
1210-
side effect in the release sequence headed by \term{A}, or
1210+
side effect in the release sequence headed by \placeholder{A}, or
12111211

12121212
\item
1213-
for some evaluation \term{X}, \term{A} is dependency-ordered before \term{X} and
1214-
\term{X} carries a dependency to \term{B}.
1213+
for some evaluation \placeholder{X}, \placeholder{A} is dependency-ordered before \placeholder{X} and
1214+
\placeholder{X} carries a dependency to \placeholder{B}.
12151215

12161216
\end{itemize}
12171217
\begin{note} The relation ``is dependency-ordered before'' is analogous to
12181218
``synchronizes with'', but uses release/consume in place of release/acquire.
12191219
\end{note}
12201220

12211221
\pnum
1222-
An evaluation \term{A} \defn{inter-thread happens before} an evaluation \term{B}
1222+
An evaluation \placeholder{A} \defn{inter-thread happens before} an evaluation \placeholder{B}
12231223
if
12241224

12251225
\begin{itemize}
12261226

12271227
\item
1228-
\term{A} synchronizes with \term{B}, or
1228+
\placeholder{A} synchronizes with \placeholder{B}, or
12291229

12301230
\item
1231-
\term{A} is dependency-ordered before \term{B}, or
1231+
\placeholder{A} is dependency-ordered before \placeholder{B}, or
12321232

12331233
\item
1234-
for some evaluation \term{X}
1234+
for some evaluation \placeholder{X}
12351235

12361236
\begin{itemize}
12371237
\item
1238-
\term{A} synchronizes with \term{X} and \term{X} is sequenced before \term{B},
1238+
\placeholder{A} synchronizes with \placeholder{X} and \placeholder{X} is sequenced before \placeholder{B},
12391239
or
12401240

12411241
\item
1242-
\term{A} is sequenced before \term{X} and \term{X} inter-thread happens before
1243-
\term{B}, or
1242+
\placeholder{A} is sequenced before \placeholder{X} and \placeholder{X} inter-thread happens before
1243+
\placeholder{B}, or
12441244

12451245
\item
1246-
\term{A} inter-thread happens before \term{X} and \term{X} inter-thread happens
1247-
before \term{B}.
1246+
\placeholder{A} inter-thread happens before \placeholder{X} and \placeholder{X} inter-thread happens
1247+
before \placeholder{B}.
12481248
\end{itemize}
12491249
\end{itemize}
12501250

@@ -1265,36 +1265,36 @@
12651265
relationships consisting entirely of ``sequenced before''. \end{note}
12661266

12671267
\pnum
1268-
An evaluation \term{A} \defn{happens before} an evaluation \term{B}
1269-
(or, equivalently, \term{B} \defn{happens after} \term{A}) if:
1268+
An evaluation \placeholder{A} \defn{happens before} an evaluation \placeholder{B}
1269+
(or, equivalently, \placeholder{B} \defn{happens after} \placeholder{A}) if:
12701270

12711271
\begin{itemize}
1272-
\item \term{A} is sequenced before \term{B}, or
1273-
\item \term{A} inter-thread happens before \term{B}.
1272+
\item \placeholder{A} is sequenced before \placeholder{B}, or
1273+
\item \placeholder{A} inter-thread happens before \placeholder{B}.
12741274
\end{itemize}
12751275

12761276
The implementation shall ensure that no program execution demonstrates a cycle
12771277
in the ``happens before'' relation. \begin{note} This cycle would otherwise be
12781278
possible only through the use of consume operations. \end{note}
12791279

12801280
\pnum
1281-
A \defnx{visible side effect}{side effects!visible} \term{A} on a scalar object or bit-field \term{M}
1282-
with respect to a value computation \term{B} of \term{M} satisfies the
1281+
A \defnx{visible side effect}{side effects!visible} \placeholder{A} on a scalar object or bit-field \placeholder{M}
1282+
with respect to a value computation \placeholder{B} of \placeholder{M} satisfies the
12831283
conditions:
12841284

12851285
\begin{itemize}
1286-
\item \term{A} happens before \term{B} and
1286+
\item \placeholder{A} happens before \placeholder{B} and
12871287
\item there is no other
12881288
\indextext{side effects}%
1289-
side effect \term{X} to \term{M} such that \term{A}
1290-
happens before \term{X} and \term{X} happens before \term{B}.
1289+
side effect \placeholder{X} to \placeholder{M} such that \placeholder{A}
1290+
happens before \placeholder{X} and \placeholder{X} happens before \placeholder{B}.
12911291
\end{itemize}
12921292

1293-
The value of a non-atomic scalar object or bit-field \term{M}, as determined by
1294-
evaluation \term{B}, shall be the value stored by the
1293+
The value of a non-atomic scalar object or bit-field \placeholder{M}, as determined by
1294+
evaluation \placeholder{B}, shall be the value stored by the
12951295
\indextext{side effects!visible}%
12961296
visible side effect
1297-
\term{A}. \begin{note} If there is ambiguity about which side effect to a
1297+
\placeholder{A}. \begin{note} If there is ambiguity about which side effect to a
12981298
non-atomic object or bit-field is visible, then the behavior is either
12991299
unspecified or undefined. \end{note} \begin{note} This states that operations on
13001300
ordinary objects are not visibly reordered. This is not actually detectable
@@ -1304,51 +1304,51 @@
13041304

13051305
\pnum
13061306
The value of an
1307-
atomic object \term{M}, as determined by evaluation \term{B}, shall be the value
1307+
atomic object \placeholder{M}, as determined by evaluation \placeholder{B}, shall be the value
13081308
stored by some
1309-
side effect \term{A} that modifies \term{M}, where \term{B} does not happen
1310-
before \term{A}.
1309+
side effect \placeholder{A} that modifies \placeholder{M}, where \placeholder{B} does not happen
1310+
before \placeholder{A}.
13111311
\begin{note}
13121312
The set of such side effects is also restricted by the rest of the rules
13131313
described here, and in particular, by the coherence requirements below.
13141314
\end{note}
13151315

13161316
\pnum
1317-
If an operation \term{A} that modifies an atomic object \term{M} happens before
1318-
an operation \term{B} that modifies \term{M}, then \term{A} shall be earlier
1319-
than \term{B} in the modification order of \term{M}. \begin{note} This requirement
1317+
If an operation \placeholder{A} that modifies an atomic object \placeholder{M} happens before
1318+
an operation \placeholder{B} that modifies \placeholder{M}, then \placeholder{A} shall be earlier
1319+
than \placeholder{B} in the modification order of \placeholder{M}. \begin{note} This requirement
13201320
is known as write-write coherence. \end{note}
13211321

13221322
\pnum
13231323
If a
13241324
\indextext{value computation}%
1325-
value computation \term{A} of an atomic object \term{M} happens before a
1326-
value computation \term{B} of \term{M}, and \term{A} takes its value from a side
1327-
effect \term{X} on \term{M}, then the value computed by \term{B} shall either be
1328-
the value stored by \term{X} or the value stored by a
1325+
value computation \placeholder{A} of an atomic object \placeholder{M} happens before a
1326+
value computation \placeholder{B} of \placeholder{M}, and \placeholder{A} takes its value from a side
1327+
effect \placeholder{X} on \placeholder{M}, then the value computed by \placeholder{B} shall either be
1328+
the value stored by \placeholder{X} or the value stored by a
13291329
\indextext{side effects}%
1330-
side effect \term{Y} on
1331-
\term{M}, where \term{Y} follows \term{X} in the modification order of \term{M}.
1330+
side effect \placeholder{Y} on
1331+
\placeholder{M}, where \placeholder{Y} follows \placeholder{X} in the modification order of \placeholder{M}.
13321332
\begin{note} This requirement is known as read-read coherence. \end{note}
13331333

13341334
\pnum
13351335
If a
13361336
\indextext{value computation}%
1337-
value computation \term{A} of an atomic object \term{M} happens before an
1338-
operation \term{B} that modifies \term{M}, then \term{A} shall take its value from a side
1339-
effect \term{X} on \term{M}, where \term{X} precedes \term{B} in the
1340-
modification order of \term{M}. \begin{note} This requirement is known as
1337+
value computation \placeholder{A} of an atomic object \placeholder{M} happens before an
1338+
operation \placeholder{B} that modifies \placeholder{M}, then \placeholder{A} shall take its value from a side
1339+
effect \placeholder{X} on \placeholder{M}, where \placeholder{X} precedes \placeholder{B} in the
1340+
modification order of \placeholder{M}. \begin{note} This requirement is known as
13411341
read-write coherence. \end{note}
13421342

13431343
\pnum
13441344
If a
13451345
\indextext{side effects}%
1346-
side effect \term{X} on an atomic object \term{M} happens before a value
1347-
computation \term{B} of \term{M}, then the evaluation \term{B} shall take its
1348-
value from \term{X} or from a
1346+
side effect \placeholder{X} on an atomic object \placeholder{M} happens before a value
1347+
computation \placeholder{B} of \placeholder{M}, then the evaluation \placeholder{B} shall take its
1348+
value from \placeholder{X} or from a
13491349
\indextext{side effects}%
1350-
side effect \term{Y} that follows \term{X} in the
1351-
modification order of \term{M}. \begin{note} This requirement is known as
1350+
side effect \placeholder{Y} that follows \placeholder{X} in the
1351+
modification order of \placeholder{M}. \begin{note} This requirement is known as
13521352
write-read coherence. \end{note}
13531353

13541354
\pnum
@@ -1367,8 +1367,7 @@
13671367
as described above, satisfy the resulting constraints as imposed here. \end{note}
13681368

13691369
\pnum
1370-
\indextext{potentially~concurrent}%
1371-
Two actions are \term{potentially concurrent} if
1370+
Two actions are \defnx{potentially concurrent}{potentially~concurrent} if
13721371
\begin{itemize}
13731372
\item they are performed by different threads, or
13741373
\item they are unsequenced, and at least one is performed by a signal handler.

0 commit comments

Comments
 (0)