Overcoming Restraint: Modular Refinement using Cogent's Principled Foreign Function Interface

02/19/2021
by   Louis Cheung, et al.
0

Cogent is a restricted functional language designed to reduce the cost of developing verified systems code. However, Cogent does not support recursion nor iteration, and its type system imposes restrictions that are sometimes too strong for low-level system programming. To overcome these restrictions, Cogent provides a foreign function interface (FFI) between Cogent and C which allows for implementing those parts of the system which cannot be expressed in Cogent, such as data structures and iterators over these data structures, to be implemented in C and called from Cogent. The Cogent framework automatically guarantees correctness of the overall Cogent-C system when provided proofs that the C components are functionally correct and satisfy Cogent's FFI constraints. We previously implemented file systems in Cogent and verified key file system operations. However, the C components and the FFI constraints that define the Cogent-C interoperability were axiomatized. In this paper, we verify the correctness and FFI constraints of the C implementation of word arrays used in the file systems. We demonstrate how these proofs modularly compose with existing Cogent theorems and result in a functional correctness theorem of the overall Cogent-C system. This demonstrates that Cogent 's FFI constraints ensure correct and safe inter-language interoperability.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/11/2021

Overcoming Restraint: Composing Verification of Foreign Functions with Cogent

Cogent is a restricted functional language designed to reduce the cost o...
research
04/08/2021

First-order natural deduction in Agda

Agda is a dependently-typed functional programming language, based on an...
research
08/23/2022

Exchangeable Laws in Borel Data Structures

Motivated by statistical practice, category theory terminology is used t...
research
07/06/2022

VeriFx: Correct Replicated Data Types for the Masses

Distributed systems adopt weak consistency to ensure high availability a...
research
04/09/2019

The Last Mile: High-Assurance and High-Speed Cryptographic Implementations

We develop a new approach for building cryptographic implementations. Ou...
research
04/12/2020

Accelerating Filesystem Checking and Repair with pFSCK

File system checking and recovery (C/R) tools play a pivotal role in inc...
research
02/24/2021

AwkwardForth: accelerating Uproot with an internal DSL

File formats for generic data structures, such as ROOT, Avro, and Parque...

Please sign up or login with your details

Forgot password? Click here to reset