Repository logo

Infoscience

  • English
  • French
Log In
Logo EPFL, École polytechnique fédérale de Lausanne

Infoscience

  • English
  • French
Log In
  1. Home
  2. Academic and Research Output
  3. Conferences, Workshops, Symposiums, and Seminars
  4. From Verified Scala to STIX File System Embedded Code Using Stainless
 
conference paper

From Verified Scala to STIX File System Embedded Code Using Stainless

Hamza, Jad
•
Felix, Simon
•
Kuncak, Viktor  
Show more
2022
NASA Formal Method
14th International Symposium NASA Formal Methods (NFM 2022)

We present an approach for using formal methods in embedded systems and its evaluation on a case study. In our approach, the developers describe the system in a restricted subset of the high-level programming language Scala. We then use 1) a verification system to formally prove properties of such Scala program, and 2) a source-to-source translator to map Scala to C code. We have adapted the Stainless verification system to support constructs for describing embedded software (more machine integer types and early returns) and to support verification patterns needed for embedded systems code (array swap operation, pre-allocated and initialized memory, constant-length arrays). The implemented C code translator generates code that can be compiled with compilers such as GCC and integrated into larger C applications. We evaluate our approach on a case study of a file system of an instrument on the Solar Orbiter satellite. We have ported around a thousand lines of C code to Scala. We wrote specification and proof hints to make the code verify. Stainless verified the absence of run-time errors, as well as function preconditions, postconditions, and data structure invariants. The generated C code was integrated into the existing code base and exhibits very similar code size, memory use, and performance. In this process we identified multiple bugs in the well-tested code base, which were fixed in-orbit.

  • Details
  • Metrics
Type
conference paper
DOI
10.1007/978-3-031-06773-0_21
Author(s)
Hamza, Jad
Felix, Simon
Kuncak, Viktor  
Nussbaumer, Ivo
Schramka, Filip
Date Issued

2022

Publisher

Springer

Published in
NASA Formal Method
ISBN of the book

978-3-031067-73-0

Series title/Series vol.

Lecture Notes in Computer Science; 13260

Start page

393

End page

410

Editorial or Peer reviewed

REVIEWED

Written at

EPFL

EPFL units
LARA  
Event nameEvent placeEvent date
14th International Symposium NASA Formal Methods (NFM 2022)

Pasadena, CA, USA

May 24–27, 2022

Available on Infoscience
December 20, 2022
Use this identifier to reference this record
https://infoscience.epfl.ch/handle/20.500.14299/193453
Logo EPFL, École polytechnique fédérale de Lausanne
  • Contact
  • infoscience@epfl.ch

  • Follow us on Facebook
  • Follow us on Instagram
  • Follow us on LinkedIn
  • Follow us on X
  • Follow us on Youtube
AccessibilityLegal noticePrivacy policyCookie settingsEnd User AgreementGet helpFeedback

Infoscience is a service managed and provided by the Library and IT Services of EPFL. © EPFL, tous droits réservés