From: Dirk Craeynest on
-----------------------------------------------------------------------

All presentations available on-line

T e c h n o l o g y U p d a t e :
A d a a n d S P A R K
f o r e d u c a t i o n a n d r e s e a r c h

State-of-the-art programming language technology with Ada
Formal specifications made practical with SPARK

Seminar organized by
the Computer Science Department of the K.U.Leuven
and the Ada-Belgium organization
with support from AdaCore and Altran Praxis

Tuesday, February 23, 2010, 14:00-18:00
K.U.Leuven, Department of Computer Science
Celestijnenlaan 200A, B-3001 Leuven (Heverlee), Belgium

http://www.cs.kuleuven.be/~dirk/ada-belgium/events/10/100223-ab-adaspark.html
http://distrinet.cs.kuleuven.be/events/AdaEvent/abstracts.html

-----------------------------------------------------------------------

All presentations at this half-day Seminar, held at the university in
Leuven last week, are available now on the web sites of Ada-Belgium
and the Distrinet research group: see URLs above.

For each presentation a PDF version can be downloaded; some are also
available in other formats (ODP or PPTX):

- "What's New in the World of Ada"
Robert Dewar, AdaCore, New York, USA

- "Ada in Industry, an Experience Report"
Philippe Waroquiers, EUROCONTROL/CFMU, Brussels, Belgium

- "Ada in Research and Education, an Experience Report"
Erhard Pl�dereder, University Stuttgart, Germany

- "SPARK - The Libre Language and Toolset for High-Assurance Software"
Rod Chapman, Altran Praxis, Bath, UK

The seminar went very well, with a good mix of people from academia,
research and industry, not only from Belgium, but also from the U.K.,
the Netherlands, Germany and France. Many participants told us they
really appreciated the event; some of the feedback we received:

"... was really interesting being there."

"... a most interesting Ada meeting at the K.U.Leuven."

"I did find all the presentations very interesting as well as
the informal discussions with the people present."

Thanks again to all presenters for their collaboration, to AdaCore
for the many Ada books we handed out, to the participants for their
interest, as well as for all the efforts many speakers and participants
went through to come to Leuven at a time when both European high speed
rail and air travel was disrupted.

Enjoy the on-line presentations!

Dirk Craeynest, Ada-Belgium, Dirk.Craeynest(a)cs.kuleuven.be

-----------------------------------------------------------------------
(V20100302.1)
From: Georg Bauhaus on
On 3/2/10 10:22 PM, Dirk Craeynest wrote:
> -----------------------------------------------------------------------
>
> All presentations available on-line
>
> T e c h n o l o g y U p d a t e :
> A d a a n d S P A R K
> f o r e d u c a t i o n a n d r e s e a r c h
>
> State-of-the-art programming language technology with Ada
> Formal specifications made practical with SPARK
>
> Seminar organized by
> the Computer Science Department of the K.U.Leuven
> and the Ada-Belgium organization
> with support from AdaCore and Altran Praxis
>
> Tuesday, February 23, 2010, 14:00-18:00
> K.U.Leuven, Department of Computer Science
> Celestijnenlaan 200A, B-3001 Leuven (Heverlee), Belgium
>
> http://www.cs.kuleuven.be/~dirk/ada-belgium/events/10/100223-ab-adaspark.html
> http://distrinet.cs.kuleuven.be/events/AdaEvent/abstracts.html

> - "Ada in Research and Education, an Experience Report"
> Erhard Pl�dereder, University Stuttgart, Germany


I'm reading a few presentation pages that advertise the strengths
of Ada. One sheet compares monitor functionalities as present
in Java and Ada. Java needs much care not to break
a monitor. Ada is shown not to have this problem.

True? With some effort, it seems possible to break an Ada
monitor implemented as a protected object.

package Monitor is

type SynchNode;
type Linkage is access all synchnode;
type data is access all integer;

protected type synchnode is
procedure Link (x : Linkage);
procedure Expose (N : out Data);
private
Outgoing : aliased Integer := 0;
end SynchNode;

end Monitor;

package body monitor is

protected body synchnode is
procedure link (X : Linkage) is
View : Data; -- X's data
begin
X.Expose(View);
View.all := View.all + 1; -- <-- unprotected
end link;

procedure Expose (N : out Data) is
begin
N := Outgoing'unchecked_access;
end expose;
end SynchNode;

end Monitor;
From: J-P. Rosen on
Georg Bauhaus a écrit :
> True? With some effort, it seems possible to break an Ada
> monitor implemented as a protected object.
>
With enough pointers, you can make anything unreliable ;-), but the
important point in your remark is "with some effort". If you make a
special effort to publicly export something that is meant to be
protected, it ceases to be protected. But this can happen only if the
author of the PO provides facility for doing that; it cannot happen due
to misuse on the client side.

--
---------------------------------------------------------
J-P. Rosen (rosen(a)adalog.fr)
Visit Adalog's web site at http://www.adalog.fr
From: Dmitry A. Kazakov on
On Fri, 05 Mar 2010 09:03:08 +0100, Georg Bauhaus wrote:

> True? With some effort, it seems possible to break an Ada
> monitor implemented as a protected object.
>
> package Monitor is
>
> type SynchNode;
> type Linkage is access all synchnode;
> type data is access all integer;
>
> protected type synchnode is
> procedure Link (x : Linkage);
> procedure Expose (N : out Data);
> private
> Outgoing : aliased Integer := 0;
> end SynchNode;
>
> end Monitor;
>
> package body monitor is
>
> protected body synchnode is
> procedure link (X : Linkage) is
> View : Data; -- X's data
> begin
> X.Expose(View);
> View.all := View.all + 1; -- <-- unprotected
> end link;
>
> procedure Expose (N : out Data) is
> begin
> N := Outgoing'unchecked_access;

monitor.adb:13:25: warning: possible unprotected access to protected data

Which pins down broken design.

> end expose;
> end SynchNode;
>
> end Monitor;

With even less efforts you can break anything:

X : SynchNode;
Y : Float;
for Y'Address use X'Address;
begin
Y := sqrt (Y);
----------------------------------

1. Do not use pointers
2. Do not use global variables

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
From: Georg Bauhaus on
J-P. Rosen schrieb:
> Georg Bauhaus a écrit :
>> True? With some effort, it seems possible to break an Ada
>> monitor implemented as a protected object.
>>
> With enough pointers, you can make anything unreliable ;-), but the
> important point in your remark is "with some effort". If you make a
> special effort to publicly export something that is meant to be
> protected, it ceases to be protected. But this can happen only if the
> author of the PO provides facility for doing that; it cannot happen due
> to misuse on the client side.

Thanks, this is wording I had been looking for.