To install click the Add extension button. That's it.

The source code for the WIKI 2 extension is being checked by specialists of the Mozilla Foundation, Google, and Apple. You could also do it yourself at any point in time.

4,5
Kelly Slayton
Congratulations on this excellent venture… what a great idea!
Alexander Grigorievskiy
I use WIKI 2 every day and almost forgot how the original Wikipedia looks like.
Live Statistics
English Articles
Improved in 24 Hours
Added in 24 Hours
What we do. Every page goes through several hundred of perfecting techniques; in live mode. Quite the same Wikipedia. Just better.
.
Leo
Newton
Brights
Milds

ANSI/ISO C Specification Language

From Wikipedia, the free encyclopedia

The ANSI/ISO C Specification Language (ACSL) is a specification language for C programs, using Hoare style pre- and postconditions and invariants, that follows the design by contract paradigm. Specifications are written as C annotation comments to the C program, which hence can be compiled with any C compiler.

The current verification tool for ACSL is Frama-C. It also implements a sister language, ANSI/ISO C++ Specification Language (ACSL++), defined for C++.

YouTube Encyclopedic

  • 1/3
    Views:
    3 308
    728
    1 749
  • Fortran
  • 4.Typecasting in c part - 1(Implicit Typecasting)
  • CppCon 2017: Dietmar Kühl “C++17 Parallel Algorithms”

Transcription

Overview

In 1983, the American National Standards Institute (ANSI) commissioned a committee, X3J11, to standardize the C language. The first standard for C was published by ANSI. Although this document was subsequently adopted by International Organization for Standardization (ISO) and subsequent revisions published by ISO have been adopted by ANSI, the name ANSI C continues to be used.

ACSL is a behavioral interface specification language (BISL). It aims at specifying behavioral properties of C source code. The main inspiration for this language comes from the specification language of the Caduceus tool for deductive verification of behavioral properties of C programs. The specification language of Caduceus is itself inspired from JML which aims at similar goals for Java source code.

One difference with JML is that ACSL is intended for static verification and deductive verification whereas JML is designed both for runtime assertion checking and static verification using for instance the ESC/Java tool.

Syntax

Consider the following example for the prototype of a function named incrstar:

/*@ requires \valid(p);
  @ assigns *p;
  @ ensures *p == \old(*p) + 1;
  @*/
void incrstar (int *p);

The contract is given by the comment which starts with /*@. Its meaning is as follows:

  • the first line is a precondition: it states that function incrstar must be called with a pointer p that points to a safely allocated memory location.
  • Second line is a frame clause, stating that function incrstar does not modify any memory location but the one pointed to by p.
  • Finally, the ensures clause is a postcondition, which specifies that the value *p is incremented by one.

A valid implementation of the above function would be:

void incrstar (int *p) {
    (*p)++;
}

Tool support

Most of the features of ACSL are supported by Frama-C.

The TrustInSoft static analyzer is a commercial derivative of Frama-C. It verifies program behavior and (with builtin rules based on the language specification) catch instances of undefined behavior.[1]

References

  1. ^ "ACSL Properties". TrustInSoft Documentation 1.42-dev documentation.

External links

  • The complete ACSL specification is available from the download page of Frama-C.
  • TSnippet from TrustInSoft allows for in-browser testing of C snippets using ACSL.
This page was last edited on 25 March 2024, at 10:53
Basis of this page is in Wikipedia. Text is available under the CC BY-SA 3.0 Unported License. Non-text media are available under their specified licenses. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. WIKI 2 is an independent company and has no affiliation with Wikimedia Foundation.