Normal view

There are new articles available, click to refresh the page.
Before yesterdayNews from the Ada programming language world

Streamline Certification using QGen TQL-1 Qualifiable Auto Code Generator for Simulink®/Stateflow®

By: AdaCore
9 July 2021 at 19:57

Presented by S. Tucker Taft - AdaCore

This session will introduce the QGen Auto Code Generator for Simulink®/Stateflow® and explain the advantages provided by a TQL-1 Qualification, in terms of reduced time and effort to certify a Simulink-based application. The talk will identify the DO-178C and DO-331 objectives that are covered by the QGen code generator, meaning that your team can avoid many of the most labor-intensive steps involved in achieving certification, even at the highest level of criticality. The talk is aimed at both engineers and managers for such critical systems development activities and will cover the features of the QGen code generator, as well as other tools with which it is integrated, including a model-level debugger and testing tools for Simulink-based applications running in embedded targets.
  • 9 July 2021 at 19:57

Engineering Self-Verified Software

By: AdaCore
8 July 2021 at 15:52

Implementation and verification are traditionally viewed as two separate activities. Even in test-driven environments, the test platform is distinct from the implementation one. This talk will present an alternative approach where the verification and development activities are engineered together, creating effectively a “self-verified” program combining at the same place an implementation and the means to verify its correctness.

4 key takeaways
- Developing verification at the same time as the code allows for more efficient coding processes and mitigates errors at the end of the process.
- Formal proofs and testing can be combined to increase the level of safety and decrease overall development costs.
- There are alternatives to the C programming language that allows more effective verification.
- There is a way to redirect software developers energy from worrying about low-level coding errors to concentrate on more valuable aspects of software engineering.

Presented by Quentin Ochem at ScaleUp OSS.5 Europe Day.
  • 8 July 2021 at 15:52

Advanced Resource Embedder 1.1.0

4 July 2021 at 16:52

The resource embedder allows to embed files in binaries by producing C, Ada or Go source files that contain the original files. The first version of the tool was representing the file content as an array of bytes. In Ada, they are accessed through an `Ada.Streams.Stream_Element_Array` which is not easy to use when you need the content as a string.

The new release introduces the customization of the format for each resource. The format is controlled through the XML description by the `format` attribute. The following data formats are supported:

  • `binary` format provides the file content as a binary data,
  • `string` format provides the file content as string,
  • `lines` format splits the content in several lines and according to a set of customizable rules.

With the `string` format, the Ada code generator can generate the following function:

```

 function Get_Content (Name : in String)
   return access constant String;

```

The `lines` format tells the code generator to represent the content as an array of separate lines. For this integration, some control is available to indicate how the content must be split and optionally apply some filter on the input content. These controls are made within the XML description by using the `line-separator` and `line-filter` description: The `line-separator` indicates the characters that represent a line separation. There can be several `line-separator` definition. The `line-filter` defines a regular expression that when matched must be replaced by an empty string or a specified content. The `line-filter` are applied in the order of the XML definition.

The example below is intended to integrate an SQL scripts with:

  • a separate line for each SQL statement,
  • remove spurious empty lines and SQL comments.

The SQL statements are separated by `;` (semi-colon) and the `line-separator` indicates to split lines on that character. By splitting on the `;` we allow to have an SQL statement on multiple lines in the original SQL source file.

```XML <package>

 <resource name='Scripts'
           format='lines'
           type='access constant String'>
   <line-separator>;</line-separator>
   <!-- Remove new lines -->
   <line-filter>[\r\n]</line-filter>
   <!-- Remove C comments -->
   <line-filter>/\*[^/]*\*/</line-filter>
   <!-- Remove contiguous spaces after C comments removal -->
   <line-filter replace=' '>[ \t][ \t]+</line-filter>
   <install mode='copy' strip-extension='yes'>
     <fileset dir="sql">
       <include name="**/*.sql"/>
     </fileset>
   </install>
 </resource>

</package> ```

Then the first `line-filter` will remove the `r` and `n` characters.

The regular expression `/\*[./]*\*/` matches a C style comment and remove it.

The last `line-filter` replaces multiple tabs and spaces by a single occurrence.

Below is an example of generated code with the above resource description. Each file is accessed through a separate variable whose name is built from the base name of the original file.

[Resource Embedder Overview](Ada/are-scripts.png)

The command used to generate this code was:

``` are lang=Ada -o src var-access content-only rule=package.xml . ```

and the `sql` directory contains only two files: `create-database.sql` and `drop-database.sql`.

The complete example is available for two languages:

To install the tool, follow the instructions given in the initial announcement: Advanced Resource Embedder for Ada, C and Go(https://blog.vacs.fr/vacs/blogs/post.html?post=2021/06/11/Advanced-Resource-Embedder).

If you want to know more about the tool, have a look at its documentation:

  • Resource Embedder Guide(https://resource-embedder.readthedocs.io/en/latest/) PDF(https://gitlab.com/stcarrez/resource-embedder/blob/master/docs/are-book.pdf)
  • Man page: are (1)(https://gitlab.com/stcarrez/resource-embedder/blob/master/docs/are.md)

and if you have ideas for improvements, fork the project and submit a pull request!

❌
❌