<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.11" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>AdaCore - The GNAT Pro Company</title>
	<link>http://www.adacore.com</link>
	<description>AdaCore technology and news</description>
	<pubDate>Fri, 16 May 2008 15:06:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.11</generator>
	<language>en</language>
			<item>
		<title>Spring newsletter available</title>
		<link>http://www.adacore.com/2008/05/13/spring-newsletter-available-2/</link>
		<comments>http://www.adacore.com/2008/05/13/spring-newsletter-available-2/#comments</comments>
		<pubDate>Tue, 13 May 2008 10:36:24 +0000</pubDate>
		<dc:creator>AdaCore</dc:creator>
		
		<category>Development Log</category>

		<category>Ada / Ada 2005</category>

		<guid isPermaLink="false">http://www2.adacore.com/2008/05/13/spring-newsletter-available-2/</guid>
		<description><![CDATA[The latest edition of the GNAT Pro Insider newsletter has been published and is available for download at:



www.adacore.com/category/press-center/newsletters



This issue features:


	New Release of GNAT Programming Studio
	Contract Award for Coverage Analysis Project

	Current Releases

	In the Pipeline

	Academia Corner

	Interview with Emmanuel Briot

	Webinar Schedule
	
Technology Corner:Pragmas Precondition and Postcondition

	Conferences/Events




]]></description>
			<content:encoded><![CDATA[<p>The latest edition of the GNAT Pro Insider newsletter has been published and is available for download at:<br/>
<br/>


<a href="http://www.adacore.com/category/press-center/newsletters/">www.adacore.com/category/press-center/newsletters</a>
</p>


<p>This issue features:<br/>


	<li>New Release of GNAT Programming Studio</li>
	<li>Contract Award for Coverage Analysis Project</li>

	<li>Current Releases</li>

	<li>In the Pipeline</li>

	<li>Academia Corner</li>

	<li>Interview with Emmanuel Briot</li>

	<li>Webinar Schedule</li>
	<li>
Technology Corner:Pragmas Precondition and Postcondition</li>

	<li>Conferences/Events</li>
</p>



]]></content:encoded>
			<wfw:commentRss>http://www.adacore.com/2008/05/13/spring-newsletter-available-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GNAT Pro 6.1 InSight webinar archive</title>
		<link>http://www.adacore.com/2008/05/12/gnat-pro-61-insight-webinar-archive/</link>
		<comments>http://www.adacore.com/2008/05/12/gnat-pro-61-insight-webinar-archive/#comments</comments>
		<pubDate>Mon, 12 May 2008 14:56:57 +0000</pubDate>
		<dc:creator>AdaCore</dc:creator>
		
		<category>Development Log</category>

		<category>GNAT Compilation System</category>

		<guid isPermaLink="false">http://www2.adacore.com/2008/05/12/gnat-pro-61-insight-webinar-archive/</guid>
		<description><![CDATA[The recently held GNAT Pro InSight webinar featuring GNAT Pro 6.1 is now available for viewing at:



www.adacore.com/home/gnatpro/webinars
]]></description>
			<content:encoded><![CDATA[<p>The recently held GNAT Pro InSight webinar featuring GNAT Pro 6.1 is now available for viewing at:<br/>
<br/>


<a href="http://www.adacore.com/home/gnatpro/webinars">www.adacore.com/home/gnatpro/webinars</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adacore.com/2008/05/12/gnat-pro-61-insight-webinar-archive/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Gem #35: bounded buffer package in GNAT hierarchy (Part 1)</title>
		<link>http://www.adacore.com/2008/05/12/gem-35/</link>
		<comments>http://www.adacore.com/2008/05/12/gem-35/#comments</comments>
		<pubDate>Mon, 12 May 2008 10:00:57 +0000</pubDate>
		<dc:creator>AdaCore</dc:creator>
		
		<category>Development Log</category>

		<category>Ada / Ada 2005</category>

		<category>Devt log - Gem of the Week</category>

		<guid isPermaLink="false">http://www2.adacore.com/2008/05/12/gem-35/</guid>
		<description><![CDATA[Ada Gem #35 &#8212;  Ada 95 introduced “protected types” as
a fundamental building block for efficient concurrent programming
and interrupt handling.  In this Gem we examine the use of
protected types in the implementation of the classic asynchronous
bounded buffer abstraction provided by the GNAT hierarchy of library units.  This
Gem assumes the reader is somewhat familiar with protected types
and will, therefore, explain some, but by no means all, of their
semantics.]]></description>
			<content:encoded><![CDATA[<h3>Let&#8217;s get started&#8230;</h3>


<p>The bounded buffer is a classic concurrent programming component
exhibiting asynchronous task interactions.  The concept is that
of a buffer of a fixed size that is accessed by multiple tasks, some inserting items and some removing them, concurrently and
asynchronously.  Hence the buffer implementation must be
protected against race conditions in which the tasks access the
implementation in an interleaved manner and thereby corrupt the
representation.  In addition to this “mutually exclusive access”,
the buffer also requires “condition synchronization”, in which
callers are kept waiting until the requested buffer has the
necessary state.  For example, a task cannot remove an item from
a buffer when the buffer is empty.  Likewise, an item cannot be
put into a buffer when the buffer is full.</p>



<p>Prior to Ada 95, programmers wanting to write portable code had
to use the rendezvous to achieve mutual exclusion, with guards to
implement the condition synchronization, because no other
synchronization mechanism was provided by the language.  Although
the extended rendezvous has a number of advantages and was a step
forward in language design, it has significant overhead when
compared to lower-level mechanisms such as semaphores, and is a
synchronous mechanism as well.  (Ada 80 had a built-in
“Semaphore” task type, intended to be implemented efficiently and
used as the name suggests, but mixing the higher-level rendezvous
with the much lower-level semaphore abstraction was considered
poor language design.) In addition, the rendezvous is only
available between tasks, meaning that the buffer would have to be
implemented as a task too, like the accessing threads.  As a
result, inserting and removing items would involve expensive task
switching, which is the primary source of the comparative
inefficiency.</p>



<p>The protected type construct added in Ada 95 addresses this issue
directly.  Protected types provide efficient mutually exclusive
access to encapsulated data, with direct expression of condition
synchronization when required.  Protected types do not define
threads of control, so their use does not involve task switching,
and although they do more than simple semaphores, their overhead
is comparable.</p>


The GNAT hierarchy of packages includes the generic package
GNAT.Bounded_Buffers, providing just the sort of abstraction we
have in mind, parameterized for general use.  The implementation
of the bounded buffer will be that of an array, and we will do
assignments of the values held within any given buffer, so the
generic formal type representing the values is declared as
private, but not limited private or indefinite:</p>


<pre>

<b>generic</b>
   <b>type</b> Element <b>is</b> <b>private</b>;
<b>package</b> GNAT.Bounded_Buffers <b>is</b>
</pre>


<p>Given this generic formal profile, users can instantiate the
generic as required.  For example, given an appropriate generic
actual parameter type named “Job”, we could instantiate it as
follows:</p>

<pre>

   <b>package</b> Jobs <b>is</b> <b>new</b> GNAT.Bounded_Buffers (Element =&gt; Job);
</pre>


<p>The package declaration contains a pragma Pure so
that the generic can be used during library unit elaboration
without a potential access-before-elaboration problem.  That
effect is achieved because Pure units are preelaborated, in
addition to other semantics.</p>



<p>Next the package declares the array type used internally in the
representation of the bounded buffer type:</p>

<pre>

   <b>type</b> Content <b>is</b> <b>array</b> (Positive <b>range</b> &lt;&gt;) <b>of</b> Element;
</pre>


<p>The array type must be declared outside the protected type,
rather than inside in the private part as a hidden implementation
artifact.  This is an unfortunate holdover from the fact that
protected types were originally named “protected records”, with
record type semantics: record types cannot declare such things as
other types!  This limitation was known during the Ada 2005 revision
but other revision aspects were more important, so this
undesirable restriction remains.</p>



<p>The next declaration in the package is a constant value of type
System.Priority:</p>

<pre>

   Default_Ceiling : <b>constant</b> System.Priority := System.Default_Priority;
</pre>


<p>In a real-time application using the Real-Time Systems Annex,
protected types are given a “ceiling” priority.  The constant
declared here is a default for that purpose so that applications
not using that Annex can ignore this aspect.</p>



<p>Finally the package declares the protected type itself, with two
discriminants:</p>

<pre>

   <b>protected</b> <b>type</b> Bounded_Buffer
      (Capacity : Positive;
       Ceiling  : System.Priority)
   <b>is</b>
      <b>pragma</b> Priority (Ceiling);
</pre>


<p>The first discriminant is the capacity of the instance object,
that is, the maximum number of values it can contain.  This value
will be used in the declaration of a hidden array object of type
Content.  With this approach, different objects of the one buffer
type can have different capacities.  The second discriminant
represents the ceiling priority value, used in the pragma
Priority.  This is where the Default_Ceiling constant would be
used in non-real-time applications.  Note that we cannot use the
Default_Ceiling constant as a default discriminant value because
the language does not allow some discriminants to have defaults
unless all have defaults.</p>



<p>Continuing with our “Jobs” example instantiation, declaration of
a bounded buffer specifies these discriminant values:</p>

<pre>

   Buffer : Jobs.Bounded_Buffer (Capacity =&gt; 20,
                                 Ceiling =&gt; Jobs.Default_Ceiling);
</pre>


<p>In this example we have arbitrarily set the capacity of Buffer to
20.  Note that the Bounded_Buffer type is provided directly as a
protected type, rather than as a limited private type completed
with a protected type.  With this approach, clients have full
flexibility to do all that protected types allow, such as timed
and conditional calls.
</p>


<p>Next the protected type declares the visible operations.  The two
primary operations are Insert and Remove, defined as entries for
the sake of the barriers that specify the required condition
synchronization.  (Only protected entries can have barriers,
unlike protected procedures and functions.) The barriers express the “not full”
and “not empty” conditions and keep their callers waiting until
those conditions hold.</p>

<pre>

      <b>entry</b> Insert (Item : Element);
      <b>entry</b> Remove (Item : <b>out</b> Element);
</pre>


<p>Then three functions are declared.  The names “Empty” and “Full”
describe the purpose of the first two functions.  The third,
“Extent”, returns the number of elements currently held in the
buffer.  It is worth noting that the state of a buffer to which
these functions may be applied can change immediately after the
call returns.</p>

<pre>

      <b>function</b> Empty <b>return</b> Boolean;
      <b>function</b> Full <b>return</b> Boolean;
      <b>function</b> Extent <b>return</b> Natural;
</pre>


<p>In part two of this Gem we will explore the private part of the
protected type, the package body, and the body of the protected
type. </p>

<h3>Related Source Code</h3>

<p>Ada Gems example files are distributed by AdaCore and may be used or modified for any purpose without restrictions.</p>]]></content:encoded>
			<wfw:commentRss>http://www.adacore.com/2008/05/12/gem-35/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Gem #34: Safe and Secure Software : Chapter 2, Safe Typing</title>
		<link>http://www.adacore.com/2008/05/05/gem-34/</link>
		<comments>http://www.adacore.com/2008/05/05/gem-34/#comments</comments>
		<pubDate>Mon, 05 May 2008 10:00:22 +0000</pubDate>
		<dc:creator>AdaCore</dc:creator>
		
		<category>Development Log</category>

		<category>Ada / Ada 2005</category>

		<category>Devt log - Gem of the Week</category>

		<guid isPermaLink="false">http://www2.adacore.com/2008/05/05/gem-34/</guid>
		<description><![CDATA[This week's gem is the second chapter of John Barnes' new booklet:</p> 

<p>Safe and Secure Software: An Introduction to Ada 2005.</p>

<p>
Over the coming months, we will be publishing all thirteen chapters of the booklet. In the attachment at the bottom of Gem #30 you can access the contents and bibliography for the entire booklet.

We hope you will enjoy the read!</p>]]></description>
			<content:encoded><![CDATA[<h3>Let&#8217;s get started&#8230;</h3>


<p>Safe typing is not about preventing heavy-handed use of the keyboard, although it can detect errors made by typos!</p>


<p>Safe typing is about designing the type structure of the language in order to prevent many common semantic errors. It is often known as strong typing.</p>


<p>Early languages such as Fortran and Algol treated all data as numeric types. Of course, at the end of the day, everything is indeed held in the computer as a numeric of some form, usually as an integer or floating point value and usually encoded using a binary representation. Later languages, starting with Pascal, began to recognize that there was merit in taking a more abstract view of the objects being manipulated. Even if they were ultimately integers, there was much benefit to be gained by treating colors as colors and not as integers by using enumeration types (just called scalar types in Pascal).</p>


<p>Ada take this idea much further as we shall see, but other languages still treat scalar types as just raw numeric types, and miss the critical idea of abstraction, which is to distinguish semantic intent from machine representation. The Ada approach provides more opportunities for detecting programming errors.
</p>

<h3>Read Chapter 2 in full</h3>


<p>Note: All chapters of this booklet will, in time, be available on the <a href="/home/ada_answers/ada_2005">Ada 2005 home page</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.adacore.com/2008/05/05/gem-34/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Designing Safe and Secure Systems</title>
		<link>http://www.adacore.com/2008/04/29/designing-safe-and-secure-systems/</link>
		<comments>http://www.adacore.com/2008/04/29/designing-safe-and-secure-systems/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 11:41:16 +0000</pubDate>
		<dc:creator>AdaCore</dc:creator>
		
		<category>Development Log</category>

		<category>Ada / Ada 2005</category>

		<guid isPermaLink="false">http://www2.adacore.com/2008/04/29/designing-safe-and-secure-systems/</guid>
		<description><![CDATA[Ben Brosgol&#8217;s tutorial at SSTC 2008, entitled &#8220;Safety and Security: An                                  
Analysis of Certification Issues and Technologies for High-Integrity    [...]]]></description>
			<content:encoded><![CDATA[<p>Ben Brosgol&#8217;s tutorial at SSTC 2008, entitled &#8220;Safety and Security: An                                  
Analysis of Certification Issues and Technologies for High-Integrity                                    
Software&#8221;.</p>
                                                                                                        
<p>Today&#8217;s interconnected critical systems must be both safe and secure; software developers and decision makers need to understand the operative certification standards and their implications on technology choice and                                 system development.  This presentation first summarizes the DO-178B avionics safety standard and the Common Criteria / Common Evaluation Methodology security standard.  It identifies the requirements that these                               standards impose on programming language technology and development tools, and explains how safety and security considerations are similar and how they differ.  It describes how modern programming language features such as                             
Object-Oriented Programming affect safety and security certification, and assesses several current language family approaches &#8212; C / C++, Ada / SPARK, and Java &#8212; against safety and security requirements. </p>]]></content:encoded>
			<wfw:commentRss>http://www.adacore.com/2008/04/29/designing-safe-and-secure-systems/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Gem #33: Accessibility Checks (Part I: Ada95)</title>
		<link>http://www.adacore.com/2008/04/28/gem-33/</link>
		<comments>http://www.adacore.com/2008/04/28/gem-33/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 10:00:15 +0000</pubDate>
		<dc:creator>AdaCore</dc:creator>
		
		<category>Development Log</category>

		<category>Ada / Ada 2005</category>

		<category>Devt log - Gem of the Week</category>

		<guid isPermaLink="false">http://www2.adacore.com/2008/04/28/gem-33/</guid>
		<description><![CDATA[Ada Gem #33 &#8212; The existence of dangling references (pointers to objects that no longer
  exist) in a program can have catastrophic results. Ada incorporates a
  set of "accessibility rules" that help the programmer prevent dangling
  references, making programs more secure.]]></description>
			<content:encoded><![CDATA[<h3>Let&#8217;s get started&#8230;</h3>


<p>  Ada is a block-structured language, which means the programmer can nest blocks of
  code inside other blocks. At the end of a block, all objects declared
  inside of it go out of scope, meaning they no longer exist, so the
  language disallows pointers to objects in blocks with a deeper nesting
  level.</p>

  
  
<p>In order to prevent dangling references, every entity is associated with a number,
  called its &#8220;accessibility level&#8221;, according to a Ada&#8217;s accessibility rules.
  When certain references are made to an entity of an access type (Ada&#8217;s
  parlance for pointer), the accessibility level of the entity is checked
  against the level allowed by the context so that no dangling pointers can occur.</p>


  
<p>Consider the following example:</p>

<pre>

     <b>procedure</b> Static_Check <b>is</b>
        <b>type</b> Global <b>is</b> <b>access</b> <b>all</b> Integer;
        X : Global;

        <b>procedure</b> Init <b>is</b>
           Y : <b>aliased</b> Integer := 0;
        <b>begin</b>
           X := Y&apos;Access; <EM>&#45;&#45; Illegal!</EM>
        <b>end</b> Init;
   
     <b>begin</b>
        Init;
        &#8230;
     <b>end</b> Static_Check;
</pre>

  
<p>The assignment is illegal because when the procedure <tt>Init</tt> finishes, the
  object <tt>Y</tt> no longer exists, thus making <tt>X</tt> a danging pointer. The compiler
  will detect this situation and flag the error.</p>


  
<p>The beauty of the accessibility rules is that most of them can be
  checked and enforced at compile time, just by using statically known accessibility
  levels.
</p>

  
<p>However, there are cases when it is not possible to statically determine the
  accessibility level that an entity will have during program execution. In
  these cases, the compiler will insert a run-time check to raise an
  exception if a dangling pointer can be created:</p>

<pre>

     <b>procedure</b> Access_Params <b>is</b>
        <b>type</b> Integer_Access <b>is</b> <b>access</b> <b>all</b> Integer;
        Data : Integer_Access;

        <b>procedure</b> Init_Data (Value : <b>access</b> Integer) <b>is</b>
        <b>begin</b>
           Data := Integer_Access (Value);
           <EM>&#45;&#45; this conversion performs a dynamic accessibility check</EM>
        <b>end</b>;

        X : <b>aliased</b> Integer := 1;

     <b>begin</b>
        Init_Data (X&apos;Access); <EM>&#45;&#45; This is OK</EM> 

        <b>declare</b>  
           Y : <b>aliased</b> Integer := 2;
        <b>begin</b>
           Init_Data (Y&apos;Access); <EM>&#45;&#45;  Trouble!</EM>
        <b>end</b>;
	<EM>&#45;&#45;  Y no longer exists!</EM>

	Process (Data);
     <b>end</b>;
</pre>

  
<p>In the example above, we cannot know at compile time the accessibility
  level of the object that will be passed to <tt>Init_Data</tt>, so the compiler
  inserts a run-time check to make sure that the assignment &#8216;<tt>Data :=</tt> &#8230;&#8217;
  does not cause a dangling reference &#8212; and to raise an exception if it
  would.</p>


  
<p>In summary, when it comes to dangling references, Ada makes it very
  hard for you to shoot yourself in the foot!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adacore.com/2008/04/28/gem-33/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[GNAT] New gnatcheck rule for exceptions</title>
		<link>http://www.adacore.com/2008/04/28/NF-62-H326-015-gnat/</link>
		<comments>http://www.adacore.com/2008/04/28/NF-62-H326-015-gnat/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 12:00:00 +0000</pubDate>
		<dc:creator>AdaCore</dc:creator>
		
		<category>Development Log</category>

		<category>GNAT Compilation System</category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[   A new rule (Separate_Numeric_Error_Handlers) is added to gnatcheck. This
   rule checks if the predefined Numeric_Error and Constraint_Error are always
   used together as exception choices of the same exception handler. This
   check is used to ensure that exception handling will behave the same in
   Ada [...]]]></description>
			<content:encoded><![CDATA[   A new rule (Separate_Numeric_Error_Handlers) is added to gnatcheck. This
   rule checks if the predefined Numeric_Error and Constraint_Error are always
   used together as exception choices of the same exception handler. This
   check is used to ensure that exception handling will behave the same in
   Ada 83 and in Ada 95 modes.
]]></content:encoded>
			<wfw:commentRss>http://www.adacore.com/2008/04/28/NF-62-H326-015-gnat/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[GNAT] gnatlink &#8220;&#8211;GCC=gcc -xxx&#8221;</title>
		<link>http://www.adacore.com/2008/04/24/NF-62-H423-001-gnat/</link>
		<comments>http://www.adacore.com/2008/04/24/NF-62-H423-001-gnat/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 12:00:00 +0000</pubDate>
		<dc:creator>AdaCore</dc:creator>
		
		<category>Development Log</category>

		<category>GNAT Compilation System</category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[   When gnatlink is invoked with &#8211;GCC= with an executable that is the same as
   the default one (gcc or &#60;prefix&#62;-gcc) and additional options, the back end
   switches from the ALI file are also used to compile the binder generated
   sources.
]]></description>
			<content:encoded><![CDATA[   When gnatlink is invoked with &#8211;GCC= with an executable that is the same as
   the default one (gcc or &lt;prefix&gt;-gcc) and additional options, the back end
   switches from the ALI file are also used to compile the binder generated
   sources.
]]></content:encoded>
			<wfw:commentRss>http://www.adacore.com/2008/04/24/NF-62-H423-001-gnat/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[GNAT] Wider access to GCC builtins from Ada</title>
		<link>http://www.adacore.com/2008/04/24/NF-62-F725-016-gnat/</link>
		<comments>http://www.adacore.com/2008/04/24/NF-62-F725-016-gnat/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 12:00:00 +0000</pubDate>
		<dc:creator>AdaCore</dc:creator>
		
		<category>Development Log</category>

		<category>GNAT Compilation System</category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[  Raw access to most of the GCC builtin functions is now possible thanks to
  Intrinsic import pragmas, allowing for instance access to very low level
  information like the current call frame return address or inline expansion
  of common math routines.
]]></description>
			<content:encoded><![CDATA[  Raw access to most of the GCC builtin functions is now possible thanks to
  Intrinsic import pragmas, allowing for instance access to very low level
  information like the current call frame return address or inline expansion
  of common math routines.
]]></content:encoded>
			<wfw:commentRss>http://www.adacore.com/2008/04/24/NF-62-F725-016-gnat/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[GNAT] New attribute Excluded_Source_List_File</title>
		<link>http://www.adacore.com/2008/04/23/NF-62-G828-004-gnat/</link>
		<comments>http://www.adacore.com/2008/04/23/NF-62-G828-004-gnat/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 12:00:00 +0000</pubDate>
		<dc:creator>AdaCore</dc:creator>
		
		<category>Development Log</category>

		<category>GNAT Compilation System</category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[  A new attribute Excluded_Source_List_File is added to the Project Manager.
  Its value is a single string that designates a text file that contains the
  list of simple file names that should not be considered as sources of the
  project.
]]></description>
			<content:encoded><![CDATA[  A new attribute Excluded_Source_List_File is added to the Project Manager.
  Its value is a single string that designates a text file that contains the
  list of simple file names that should not be considered as sources of the
  project.
]]></content:encoded>
			<wfw:commentRss>http://www.adacore.com/2008/04/23/NF-62-G828-004-gnat/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
