Adventures in FRET and Specification

Marie Farrell, Matt Luckcuck, Rosemary Monahan, Conor Reynolds, Oisín Sheridan · 2025

Read Adventures in FRET and Specification by Marie Farrell, Matt Luckcuck, Rosemary Monahan, Conor Reynolds, Oisín Sheridan (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2503-24040.txt.

Introduction

Farrell and four co-authors look back on work with a NASA tool that turns plain asks into strict specs in this twenty twenty-five paper. Builders of safe rigs must state what a rig must do in words a machine can check. Loose words at that stage breed costly flaws down the line.

Inside, four case works show the tool in use on real rigs of unlike kinds. For each case, the team sums what the tool caught and where it strained. The strict asks then fed specs cast in a mix of formal frames. Their tale backs the tool as a sound bridge from first asks to checked specs, with clear trace from ask to end spec.

Catalog record

CREATORMarie Farrell, Matt Luckcuck, Rosemary Monahan, Conor Reynolds, Oisín Sheridan
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE38 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2503-24040

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Adventures in FRET and Specification Thanks: This work was partially supported by the Royal Academy of Engineering and EPSRC grant EP/Y001532/1, as well as Maynooth University’s Hume Doctoral Award. Marie Farrell, Matt Luckcuck, Rosemary Monahan, Conor Reynolds, Oisín Sheridan Abstract This paper gives an overview of previous work in which the authors used NASA’s Formal Requirement Elicitation Tool (FRET) to formalise requirements. We discuss four case studies where we used FRET to capture the system’s requirements. These formalised requirements subsequently guided the case study specifications in a combination of formal paradigms. For each case study we summarise insights gained during this process, exploring the expressiveness and the potential interoperability of these approaches. Our experience confirms FRET’s suitability as a framework for the elicitation and understanding of requirements and for providing traceability from requirements to specification. 1 Introduction Knowing which properties to specify and subsequently verify is one of the biggest bottlenecks in the use of Formal Methods [ 36 ] . Requirements are often written in natural-language, which can be ambiguous and is not generally amenable to formal verification. As a result, requirements elicitation and formalisation becomes even more important for understanding what to specify and verify. Tools such as NASA’s Formal Requirements Elicitation Tool (FRET) have been developed to bridge the gap between natural-language requirements and the logics normally used for formal specification [ 24 ] . FRET provides a structured natural-language, called fretish , from which temporal logic specifications and other verification conditions can be derived. We have used FRET in many use cases to support both elicitation and formalisation of requirements. In this paper, we provide an overview of four of these case studies and discuss how the fretish requirements were elicited and subsequently used for specifying properties to be verified in various formal methods. These case studies are an aircraft engine software controller [ 16 ] , a mechanical lung ventilator [ 14 ] , a rover carrying out an inspection task [ 9 ] and an algorithm for autonomously grasping spent rocket stages [ 18 ] . We outline the relevant background material in § 2 . Next, we describe the four case studies that we explore in this paper (§ 3 ). § 4 provides metrics about our fretish requirement sets, showing the structure of requirements and how to express them in fretish . We discuss how we used these requirements in other formal methods (model-checking, theorem proving and runtime verification approaches), encouraging a framework for interoperability. We provide a brief discussion in § 5 . Finally, § 6 concludes. 2 Background We provide an overview of the various formal methods used in the case studies reviewed in this paper: FRET, Dafny, Event-B and ROSMonitoring. 2.1 FRET The Formal Requirements Elicitation Tool (FRET) is an open-source tool that enables developers to write and formalise system requirements [ 23 ] . FRET requirements are written in a structured natural-language called fretish , built from five fields: scope condition component shall timing response . The component and response fields are mandatory (along with the “shall” keyword) for all fretish requirements; scope , condition and timing are optional. Using fretish , users can express requirements for individual component s that pertain to a particular scope under some condition where the response (expected behaviour) can be specific to a defined timing . Fig. 1 is a screenshot of FRET ’s ‘Update Requirement’ dialogue, with the fretish version of a requirement from the Aircraft Engine Controller case study, discussed in Section 3.1 . Figure 1: Screenshot of FRET showing the fretish version of requirement UC5_R_1 from the Aircraft Engine Controller case study (§ 3.1 ). Each requirement has an ID (top left), and a diagrammatic semantics (right) is generated by the tool to help the user to understand the meaning behind the fretish requirement [ 16 ] . FRET provides automated translations from fretish requirements to CoCoSpec contracts [ 11 ] , which can be verified with the Kind2 model checker, and Copilot runtime monitors [ 34 ] . There is no automated support for translating between fretish requirements and theorem proving approaches like Event-B, though prior work shows proof-based methods are useful for verifying requirements that are difficult to verify using the supported CoCoSpec approach [ 9 ] . Other requirements tools include D-Risq’s Kapture tool 1 1 1 Kapture: https://www.drisq.com/product-kapture , IBM’s DOORS 2 2 2 DOORS: www.ibm.com/products/requirements-management?mhsrc=ibmsearch_a&mhq=DOORS , and the open-source tool Doorstop 3 3 3 Doorstop: https://github.com/doorstop-dev/doorstop . FRET was chosen because it is a free, open-source platform that is under active development. 2.2 Event-B Event-B is a state-based formal method that has been used in the development of safety-critical systems in a variety of sectors, including rail [ 29 ] , aerospace [ 31 ] and medical [ 27 ] . The Event-B language is based on set theory and first-order logic [ 2 ] . Tool support is provided by the Rodin Platform [ 3 ] . Event-B, like FRET, is open-source. Event-B specifications comprise machines and contexts . A machine specifies dynamic behaviour via variants, invariants, and events. Static behaviour is specified in contexts, using carrier sets, constants, and axioms. Event-B supports formal refinement, enabling users to gradually add more detail to their model and discharge proofs of correctness at each stage [ 38 ] . Theorem proving is supported in Rodin with most of the generated proof obligations discharged automatically, although some may need manual interaction with Rodin’s provers. The semantics of Event-B models is often thought of in terms of the generated proof obligations [ 26 ] , and a detailed formal semantics for the Event-B language itself is given in [ 19 ] . CONTEXT ctx EXTENDS ctx 0 SETS S CONSTANTS c AXIOMS A(s,c) MACHINE m REFINES m 0 SEES ctx VARIABLES x INVARIANTS I(x) VARIANT n(x) EVENTS INITIALISATION, e {}_{1},\ldots, e n Event e i \mathrel{\widehat{=}} status any p when G(x,p) with W(x,p) then BA(x,p,x’) end Figure 2: Event-B specifications comprise contexts (static aspects) and machines (dynamic behaviour). Machines contain events that specify state changes. 2.3 Dafny Dafny is a formal verification system that is used in the static verification of functional program correctness. Users provide specification constructs e.g. pre-/post-conditions, loop invariants and variants [ 30 ] . Programs are translated into the Boogie intermediate verification language [ 6 ] and then the Z3 automated theorem prover discharges the associated proof obligations [ 12 ] . Fig. 3 shows the basic structure of a Dafny method. The requires keyword (line 2) indicates the method’s pre-condition, the modifies keyword (line 3) specifies which input variables the method is allowed to modify and the ensures keyword (line 4) captures the method’s post-condition. The user specifies a loop invariant (line 7) which is used by the underlying SMT solver to reason about the loop’s correctness and to prove that the post-condition is preserved, and the decreases clause (line 8) is a loop variant for proving loop termination. ⬇ 1 method myMethod ( x \colon int ) returns ( y \colon int ) 2 requires \ldots 3 modifies \ldots 4 ensures \ldots 5 { 6 while ( i < x ) //this is a comment 7 invariant \ldots 8 decreases \ldots

Read the complete text