Iteratively Composing Statically Verified Traits

02/26/2019
by   Isaac Oscar Gariano, et al.
0

Metaprogramming is often used to programmatically generate faster specialised code when some parameters are known in advance. To use metaprogramming and SV together, we could generate code containing contracts, and such code could be checked after metaprogramming has been completed. SV could then be applied to the code resulting from the metaprogramming to ensure it is correct. However this could be very time consuming, since it would require verifying all the generated code from scratch. Even worse, since SV is unpredictable, there would be no guarantee that the result of a given metaprogram will be verifiable, even if its result is correct by construction. We extend the disciplined form of metaprogramming of Servetto & Zucca, which is based on trait composition and adaptation. Here a Trait is a unit of code: a set of method declarations with pre/post-conditions. They are well-typed and correct. Traits directly written in the source code are proven correct by SV. The composition and adaptation of Traits is carefully defined to preserve correctness. Metaprogramming cannot generate code directly, code is only generated by composing and adapting traits, thus generated code is also correct. However generated code may not be able to pass SV, since theorem provers are not complete.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/12/2022

Traits for Correct-by-Construction Programming

We demonstrate that traits are a natural way to support correctness-by-c...
research
12/21/2018

Correct by construction

Matrix code allows one to discover algorithms and to render them in code...
research
05/02/2023

Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generation

Program synthesis has been long studied with recent approaches focused o...
research
09/18/2023

From RTL to SVA: LLM-assisted generation of Formal Verification Testbenches

Formal property verification (FPV) has existed for decades and has been ...
research
02/01/2019

Separating Use and Reuse to Improve Both

Context: Trait composition has inspired new research in the area of code...
research
03/14/2019

Are My Invariants Valid? A Learning Approach

Ensuring that a program operates correctly is a difficult task in large,...
research
05/24/2023

ALGO: Synthesizing Algorithmic Programs with Generated Oracle Verifiers

Large language models (LLMs) excel at implementing code from functionali...

Please sign up or login with your details

Forgot password? Click here to reset