All Projects → tofgarion → Spark By Example

tofgarion / Spark By Example

SPARK by Example is an adaptation of ACSL by Example for SPARK 2014, a programming language which is a formally verified subset of Ada

Projects that are alternatives of or similar to Spark By Example

TSNsched
Automated Schedule Generation for Time-Sensitive Networks (TSN).
Stars: ✭ 46 (-61.02%)
Mutual labels:  formal-methods
vscode-tlaplus
TLA+ language support for Visual Studio Code
Stars: ✭ 213 (+80.51%)
Mutual labels:  formal-methods
Mathlib
Lean mathematical components library
Stars: ✭ 746 (+532.2%)
Mutual labels:  formal-methods
fm-notes
Unassorted scribbles on formal methods, type theory, category theory, and so on, and so on
Stars: ✭ 19 (-83.9%)
Mutual labels:  formal-methods
intrepid
Intrepyd Model Checker
Stars: ✭ 14 (-88.14%)
Mutual labels:  formal-methods
Tool lists
Links to tools by subject
Stars: ✭ 270 (+128.81%)
Mutual labels:  formal-methods
TorXakis
A tool for Model Based Testing
Stars: ✭ 40 (-66.1%)
Mutual labels:  formal-methods
Ouroboros High Assurance
High-assurance implementation of the Ouroboros protocol family
Stars: ✭ 79 (-33.05%)
Mutual labels:  formal-methods
vsrl-framework
The Verifiably Safe Reinforcement Learning Framework
Stars: ✭ 42 (-64.41%)
Mutual labels:  formal-methods
Oak
Meaningful control of data in distributed systems.
Stars: ✭ 698 (+491.53%)
Mutual labels:  formal-methods
z3 tutorial
Jupyter notebooks for tutorial on the Z3 SMT solver
Stars: ✭ 117 (-0.85%)
Mutual labels:  formal-methods
tutoriel wp
Frama-C and WP tutorial
Stars: ✭ 31 (-73.73%)
Mutual labels:  formal-methods
Practical Fm
A gently curated list of companies using verification formal methods in industry
Stars: ✭ 272 (+130.51%)
Mutual labels:  formal-methods
llvm-semantics
Formal semantics of LLVM IR in K
Stars: ✭ 42 (-64.41%)
Mutual labels:  formal-methods
Cosa
CoreIR Symbolic Analyzer
Stars: ✭ 35 (-70.34%)
Mutual labels:  formal-methods
high-assurance-legacy
Legacy code connected to the high-assurance implementation of the Ouroboros protocol family
Stars: ✭ 81 (-31.36%)
Mutual labels:  formal-methods
z-eves
Z-EVES for linux. Probably the only place you can find it
Stars: ✭ 17 (-85.59%)
Mutual labels:  formal-methods
Hacl Star
HACL*, a formally verified cryptographic library written in F*
Stars: ✭ 1,360 (+1052.54%)
Mutual labels:  formal-methods
Scallina
A Coq-based synthesis of Scala programs which are correct-by-construction
Stars: ✭ 65 (-44.92%)
Mutual labels:  formal-methods
Sled
the champagne of beta embedded databases
Stars: ✭ 5,423 (+4495.76%)
Mutual labels:  formal-methods
  • SPARK by Example

    SPARK by Example is a project (greatly) inspired by [[https://github.com/fraunhoferfokus/acsl-by-example][ACSL by Example]], a collection of verified C functions and data types from the C++ standard library. SPARK by Example has two objectives

    • implement and verify the same functions as ACSL by Example using SPARK 2014 ([[https://www.adacore.com/about-spark][SPARK 2014]] is a formally verified subset of the Ada programming language)
    • highlight differences between verification of C programs and verification of SPARK programs

    Adacore has developed a great tutorial website for Ada/SPARK beginners [[https://learn.adacore.com/][here]]. It is recommended to follow at least the SPARK part of this tutorial before reading SPARK by Example.

** Tools used

[[https://www.adacore.com/community][GNAT Community 2018]] has been used for this project. You may download and install it using the previous link.

** Table of contents

  1. [[./non-mutating/README.org][non mutating algorithms]]
  2. [[file:maxmin/README.org][maxmin algorithms]]
  3. [[file:binary-search/README.org][binary search algorithms]]
  4. [[file:mutating/README.org][mutating algorithms]]
  5. [[file:numeric/README.org][numeric algorithms]]
  6. [[file:heap/README.org][heap algorithms]]
  7. [[file:sorting/README.org][sorting algorithms]]
  8. [[file:classic-sorting/README.org][classic sorting algorithms]]

** Content of each directory and global Makefile

Each directory corresponds to a chapter of ACSL by Example. Each directory contains a GNAT Project file (the file ending by .gpr) containing informations about the location of the sources etc. Common configuration, e.g. GNATprove configuration, is specified in the spark_by_example_shared.gpr file at the project root.

For each algorithm Algo to be proved, you will find the specification of Algo in the algo_p.ads file and its implementation if the algo_p.adb file. Specifications and implementations are defined in packages. To avoid name clashes with functions, packages names have a _P suffixes, hence the file names.

Ghost functions that may be used in several algorithms are grouped in the spec directory at the root of the project. Lemmas used in proofs are grouped in the lemmas directory at the root of the project.

A Makefile is provided for each chapter with some default values for provers timeouts, levels of proof etc. These default values are sufficient to prove the corresponding algorithms with the previous tools on a machine equipped with an Intel Core i7-4810MQ CPU and 16GB of RAM. For each chapter, a all target proves all functions and procedures of the chapter. Each function or procedure has a corresponding target to prove it.

The following variables can be used to control the behaviour of the Makefiles:

  • CHAPTER_NAME_DEFAULT_TIMEOUT (defined at the beginning of each Makefile) contains the default value for provers timeout
  • LEVEL_FUNCTION_NAME defines for each function the level used by GNATprove
  • MEMCACHED=1 enables the use of a [[https://www.memcached.org][Memcached]] server to cache proofs (it speeds up the proof process as some lemmas are used in several function for instance). Variables MEMCACHED_SERVER and MEMCACHED_PORT can be used to specify IP and port of server (localhost:11211 by default)
  • STATS=1 enables the generation of statistics on the proof, based on the standard output. Generated files will be placed in the stats directory at the root of the project
  • PARALLEL controls the -j option of GNATprove for parallelizing proofs (default 0, use all cores of the machine)
  • DEBUG=1 enables debug and verbose options of GNATprove

Other variables are available, see the Makefile-common file at the root of the project.

For instance, if you want to prove all functions of chapter on non-mutating algorithms with statistics and by changing the default timeout to 10, issue the following command from the project root:

#+BEGIN_SRC shell make -C non-mutating all STATS=1 NON_MUTATING_DEFAULT_TIMEOUT="TIMEOUT=10" #+END_SRC

A Makefile is also available at the root of the project. It has a all-chapters target that proves all the chapters, gathers statistics, and generate a recap.csv file in the stats directory.

For instance, if you want to prove all chapters with statistics and Memcached, issue the following command:

#+BEGIN_SRC shell make all-chapters STATS=1 MEMCACHED=1 #+END_SRC

** Contributing

If you want to contribute to SPARK by Example, please read the [[./CONTRIBUTING.org][CONTRIBUTING]] file.

** References

  • [[http://docs.adacore.com/spark2014-docs/html/ug/index.html][SPARK 2014 user guide 19.0]]
  • [[https://learn.adacore.com/][learn.adacore.com]]

Local Variables:

ispell-dictionary: "english"

flyspell-mode: 1

End:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].