[SystemSafety] Accuracy of COVID modeling code

Olwen Morgan olwen at phaedsys.com
Fri May 22 12:51:00 CEST 2020


... and as Derek should know, the C standard speaks of the "underlying 
abstract machine" but nowhere mathematically defines it. One 
particularly inept provision of the C standards is, AFAI am aware, to 
allow an implementation to omit an evaluation in cases where it produces 
"no needed side-effect" .... yet the standards do not mathematically 
define what it means for a side effect to be needed .....

It is possible to some extent to control optimisation by use of 
compile-time options, but the effects of these options are not, AFAI am 
aware, defined in the C standards. Often your best, but by no means 
foolproof, bet to defeat incautious optimisation is to adopt a 
pseudo-applicative programming style - which I normally do amid 
accusations of being an "anally obsessive" coder - not hyperbole as I've 
been called exactly that by members of the lumpenprogrammariat.


Here, IMO, Martyn is right and Derek is demonstrating his apparently 
ingrained eschewal of soundly-based methods.


Olwen


On 09/05/2020 17:41, Derek M Jones wrote:
> Martyn,
>
>> I haven't seen a language specification that rules out any form of
>> optimisation that involves rearranging code or using mathematically
>> equivalent operations. Please post a link to the sections of those that
>> you have seen that make that clear.
>
> Section 5.1.2.3 of the C Standard,
>
> or sentence 189: https://c0x.coding-guidelines.com/5.1.2.3.html
> "In the abstract machine, all expressions are evaluated as specified 
> by the semantics."
>
> There as an as-if rule that allows implementations to do what they
> like (e.g., turn an integer multiple by two into a shift), as long as
> the behavior is the same.
>


More information about the systemsafety mailing list