comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: A function that cannot be called?
Date: Sun, 21 Oct 2018 13:57:26 +0300
Date: 2018-10-21T13:57:26+03:00	[thread overview]
Message-ID: <g334cmFbu39U1@mid.individual.net> (raw)
In-Reply-To: <pqhfk6$gks$1@dont-email.me>

On 18-10-21 12:07 , G.B. wrote:
> On 20.10.18 13:13, Simon Wright wrote:
>> "G.B." <bauhaus@notmyhomepage.invalid> writes:
>>
>>> It might wet your appetite to recall that without the formal model
>>> of classical logic, none of Ada or its RM would be used by us.
>>
>> *whet
> (Ah. Thank you.)
>> Who is "us"? Certainly doesn't include me.
>
> The idea is that classical logic caused, and continues to cause,
> (features of) programming languages like Ada, in some sense.
> The idea is not to suggest that programmers need to be concerned
> with formal models in order to write programs.
>
> So, I guess for writing an embedded program like
>
>   loop
>     Ouput (Compute (Input));
>   end loop;
>
> one doesn't need to be aware that classical logic, without some
> type system, incurs the possibility of the HALTing trouble.

IMO most of the logicians' worry about the non-termination of such 
"embedded" programs is a red herring and of no importance.

The logical view of an embedded program with an outermost eternal loop, 
as above, should consider a single cycle, that is, a program like this:

    assume Cycle_Invariant (State);
    read Inputs;
    compute Outputs from Inputs and State;
    write Outputs;
    update State to New_State;
    assert Cycle_Invariant (New_State);

which has no non-termination aspects related to the cyclic loop.

If the logical model has to consider some coupling of the Outputs of one 
cycle to the Inputs of the next cycle (for control-loop stability 
analysis, say) the State can often be extended to cover that coupling.

Things become more complicated when the program contains cyclic tasks 
with various periods and perhaps some sporadic tasks. But it seems to me 
that such a complex multi-task program should divide its state into 
concurrent parts, anyway, and the invariants describing the validity of 
those state parts, and perhaps their mutual validity too, should be 
robust against all the task interleavings that can occur during 
execution. The logical model of even the longest-cycle task needs to 
consider only a statically bounded number of executions of the 
higher-rate or sporadic tasks, so the logical models of all tasks can 
assume that the outermost "non-terminating" loop, in any task, repeats 
for a statically bounded number of times.

That said, I certainly consider termination analysis to be an important 
subject. But I am more interested in _quantitative_ termination bounds 
(for WCET analysis) than in yes/no analysis.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .


  parent reply	other threads:[~2018-10-21 10:57 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18 12:14 A function that cannot be called? G.B.
2018-10-18 15:33 ` Stefan.Lucks
2018-10-18 20:21   ` G.B.
2018-10-18 20:57     ` Niklas Holsti
2018-10-19  7:15     ` Dmitry A. Kazakov
2018-10-19 13:55       ` G.B.
2018-10-19 15:31         ` Dmitry A. Kazakov
2018-10-18 17:03 ` AdaMagica
2018-10-18 19:36   ` G.B.
2018-10-18 21:30     ` Randy Brukardt
2018-10-19 14:00       ` G.B.
2018-10-19 15:39         ` Dmitry A. Kazakov
2018-10-20  1:34         ` Randy Brukardt
2018-10-20  9:14           ` G.B.
2018-10-20 11:13             ` Simon Wright
2018-10-20 14:11               ` Dmitry A. Kazakov
2018-10-21  9:25                 ` G.B.
2018-10-21  9:07               ` G.B.
2018-10-21  9:51                 ` Dmitry A. Kazakov
2018-10-21 10:57                 ` Niklas Holsti [this message]
2018-10-21 18:00                 ` Simon Wright
2018-10-19  8:48 ` AdaMagica
2018-10-19 11:15   ` G.B.
2018-10-19 17:06     ` AdaMagica
2018-10-19 19:57       ` G.B.
2018-10-19 22:06         ` Jere
2018-10-21 10:14           ` G.B.
2018-10-21 11:30             ` Egil H H
2018-10-23 11:45               ` G.B.
2018-10-23 14:35                 ` Jere
2018-10-23 14:57                   ` Dmitry A. Kazakov
2018-10-23 17:49                     ` G.B.
2018-10-23 19:25                       ` Dmitry A. Kazakov
2018-10-24  7:35                         ` G.B.
2018-10-24  8:14                           ` Dmitry A. Kazakov
2018-10-19 18:19 ` marciant
2018-10-19 18:22   ` marciant
2018-10-20  1:36     ` Randy Brukardt
2018-10-20  2:54       ` marciant
2018-10-19 20:25   ` Shark8
2018-10-19 23:28     ` marciant
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox