On Saturday, July 21, 2018 at 1:30:47 PM UTC-4, Rainer Weikusat wrote:
>
james...@alumni.caltech.edu writes:
> > On Friday, July 20, 2018 at 12:12:48 PM UTC-4, Rainer Weikusat wrote:
> >>
james...@alumni.caltech.edu writes:
>
> [...]
>
> >> > Which "silly statement" are you referring to?
> >>
> >> The specific silly statement this digression happens to be about.
> >
> > That's not clear enough, but it allows me to make a guess. My best guess
> > is that the "silly statement" you're referring to is "This is the
> > _observable behavior_ of the program."
>
> Exactly. I consider it a silly statements as standardized C has existed
> for more than 20 years without and it adds nothing of value to the text.
The only thing it adds is a convenient term for referring to "the kinds
of behavior listed in section 5.1.2.3p6".
You didn't bother identifying which of the numbered statements I gave
you disagreed with. I therefore choose to assume that you're disagreeing
with all of them.
...
> As a side note: The C text very likely uses the phrase observable
> behaviour because of its English meaning.
I very much doubt that. The C++ standard has been using the term
"observable behavior" since early drafts of the 1998 standard for the
same purpose. I think the authors of the C standard thought it would be
a good idea to incorporate the same concept. The original C++ definition
was very different from the current one, but the current version is
worded in a way quite similar to the way it is worded in the C standard,
which is a strong indication it's meant to be interpreted the same way
in both standards:
Section 1.9:
"8 The least requirements on a conforming implementation are:
(8.1) — Access to volatile objects are evaluated strictly according to
the rules of the abstract machine.
(8.2) — At program termination, all data written into files shall be
identical to one of the possible results that execution of the program
according to the abstract semantics would have produced.
(8.3) — The input and output dynamics of interactive devices shall take
place in such a fashion that prompting output is actually delivered
before a program waits for input. What constitutes an interactive device
is implementation-defined.
These collectively are referred to as the observable behavior of the
program. [ Note: More stringent correspondences between abstract and
actual semantics may be defined by each implementation. — end note ]"
The key difference is that the C++ standard actually uses the term
"observable behavior", whereas the C standard only defines the term
without ever using it:
"The semantic descriptions in this International Standard define a
parameterized nondeterministic abstract machine. This International
Standard places no requirement on the structure of conforming
implementations.
In particular, they need not copy or emulate the structure of the
abstract machine. Rather, conforming implementations are required to
emulate (only) the observable behavior of the abstract machine as
explained below." (1.9p1).
If "observable behavior" had been intended to mean "behavior which is
observable", that clause would be pretty meaningless - it would allow no
significant different between the behavior of a conforming
implementation and the behavior of the abstract machine, whereas it's
hard for a sane person to read 1.9 of the C++ standard without realizing
that the key point of that clause is to explicitly allow such differences
- while restricting the permitted differences to things that aren't
"observable behavior".