comp.lang.ada
 help / color / mirror / Atom feed
From: phil.clayton@lineone.net
Subject: Re: Ada to C translator for small microcontrollers
Date: Fri, 30 Mar 2012 04:54:08 -0700 (PDT)
Date: 2012-03-30T04:54:08-07:00	[thread overview]
Message-ID: <5576868.1739.1333108448535.JavaMail.geo-discussion-forums@vbut24> (raw)
In-Reply-To: <4f737c92$0$6636$9b4e6d93@newsspool2.arcor-online.net>

On Wednesday, March 28, 2012 10:03:14 PM UTC+1, Georg Bauhaus wrote:
> I do not know (yet) why a no-op in the language is a must
> in a theory-friendly programming language, I have seen that
> it is. Ada has it, in any case.

At a practical level, without null, using rules to reason about programs can become tedious.  For example, null statements allow us to write the rule

  if C
  then
    P
  else
    null;
  end if;
=
  if C
  then
    P
  end if;

where C is a boolean expression and P is any program statement.  

That is useful because no other rules then need to deal with an implicit else null branch.  Without null statements and the above rule, we would then need four versions of the following rule, for all combinations of omitting the else branch:

  if C
  then
    if C
    then
      P
    else
      Q
  else
    R
  end if;
=
  if C
  then
    P
  else
    R
  end if;

At a more abstract level, a null statement may be needed so that sequential composition has an identity to appeal to some other theoretical result.



  reply	other threads:[~2012-03-30 11:56 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26 12:48 Ada to C translator for small microcontrollers Tomi Saarnio
2012-03-26 13:44 ` Rego, P.
2012-03-26 14:14 ` Niklas Holsti
2012-03-26 15:48   ` Ludovic Brenta
2012-03-26 16:20     ` Simon Wright
2012-03-26 14:46 ` georg bauhaus
2012-03-26 19:16 ` anon
2012-03-27  9:46 ` kalvin.news
2012-03-27 17:22   ` anon
2012-03-27 20:13     ` kalvin.news
2012-03-28 14:29       ` KK6GM
2012-03-28 16:36       ` Niklas Holsti
2012-03-28 17:56         ` KK6GM
2012-03-28 21:03         ` Georg Bauhaus
2012-03-30 11:54           ` phil.clayton [this message]
2012-03-31 15:46         ` kalvin.news
2012-03-31 19:52           ` Rugxulo
2012-04-01 11:23             ` kalvin.news
2012-04-02 21:46             ` Niklas Holsti
2012-04-03  5:56               ` J-P. Rosen
2012-04-03  2:08 ` BrianG
2012-04-03  9:29   ` Georg Bauhaus
2012-05-21 10:35 ` kalvin.news
2012-05-21 12:27   ` Georg Bauhaus
2012-06-02 15:27     ` Marco
2012-06-05  9:18       ` kalvin.news
2012-06-05 12:17         ` Brian Drummond
2012-06-06  5:21           ` J-P. Rosen
2012-06-06 11:50             ` Brian Drummond
2012-06-10 15:41         ` Marco
replies disabled

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