The University of Southampton
University of Southampton Institutional Repository

Petra: A compositional, contract-based, Correct-by-Construction OOP language, using explainable, layered abstractions, for scalable V&V

Petra: A compositional, contract-based, Correct-by-Construction OOP language, using explainable, layered abstractions, for scalable V&V
Petra: A compositional, contract-based, Correct-by-Construction OOP language, using explainable, layered abstractions, for scalable V&V
This thesis presents Petra, a new correct-by-construction OOP language which aims to democratise the application of formal software methods, by integrating simplified, scalable, comprehensive, fully-automated formal verification and validation (V&V). Petra has default null-safety, determinism, parallel processing and decision branch level pre/post condition reachability checks. Objects are verified by verifying that their methods behave as total functions which transition object states such that the method pre/post conditions are satisfied. Objects are structured using explainable and modular objects which help to decompose the problem space in such a way that it becomes easier to validate their behaviour and to verify them efficiently. This is achieved using a simple yet expressive syntax structure for expressions and statements, which are explainable and map to a simple controlled English language, and with a semantics that allows for layered abstractions which means verification for an entire program can be achieved by verifying independent trees of objects, branches and methods, separately. We define both a denotational semantics to model the concrete and symbolic state transitions of a correct program, and an operational semantics that captures the unconstrained behaviour of a program at run-time. We prove soundness between correct symbolic and operational semantics through a structural induction that is designed to prove that a correct symbolic semantics implies a correct operational semantics. This is split into two parts, first by proving correct symbolic implies correct concrete, and then by proving correct concrete implies correct operational. Correct operational semantics provides strong properties which include total correctness and determinism, whilst supporting parallel processing. A key limitation of Petra is the lack of direct support for verification of loops, however loops over compositions of primitive fields, within the branches of base object methods, can be assumed or proved using alternative methods. In addition to contributing the Petra language, semantics, and soundness proof, we developed a Java tool that automatically verifies Petra with a theoretical complexity of O(k(net + mct(nt^2 + b(q + z + t^b)))), where k is the number of objects in the program, each object has up to n private symbolic states, up to b fields, up to t predicates (each of expression size at most e), and up to m methods (each with up to c cases,
each case having a parallel composition of up to z statements and a sequential composition of up to q statements). This is in P (Polynomial Time), however Petra favours many small objects to leverage abstraction, yielding near-linear performance in practice.
Correct-by-Construction (CBC), Formal Verification, Formal Methods, Object-Oriented Programming (OOP), Denotational Semantics, Operational Semantics, Soundness Proof, Deterministic Concurrency, Parallel Processing, Embedded DSL, Polynomial Time (P), Near-Linear Performance, Scalable Verification, Petra Programming Language, Formal Verification and Validation (V&V), Contract-Based Programming, Total Correctness, Structural Induction, Polynomial Time Complexity (P), Automated Theorem Proving, Automated Formal Verification, Automated Trading Systems, Algorithmic Trading, Financial Technology (FinTech), Business Logic Workflows, Explainable Software, Controlled English Language, Null-Safety, Deadlock Freedom, Race-Condition Freedom
University of Southampton
Hakki, Aran
915dbbc2-c9ce-4329-b472-c5d13b6c8d5b
Hakki, Aran
915dbbc2-c9ce-4329-b472-c5d13b6c8d5b
Cirstea, Corina
ce5b1cf1-5329-444f-9a76-0abcc47a54ea
Rathke, Julian
dba0b571-545c-4c31-9aec-5f70c231774b

Hakki, Aran (2026) Petra: A compositional, contract-based, Correct-by-Construction OOP language, using explainable, layered abstractions, for scalable V&V. University of Southampton, Doctoral Thesis, 234pp.

Record type: Thesis (Doctoral)

Abstract

This thesis presents Petra, a new correct-by-construction OOP language which aims to democratise the application of formal software methods, by integrating simplified, scalable, comprehensive, fully-automated formal verification and validation (V&V). Petra has default null-safety, determinism, parallel processing and decision branch level pre/post condition reachability checks. Objects are verified by verifying that their methods behave as total functions which transition object states such that the method pre/post conditions are satisfied. Objects are structured using explainable and modular objects which help to decompose the problem space in such a way that it becomes easier to validate their behaviour and to verify them efficiently. This is achieved using a simple yet expressive syntax structure for expressions and statements, which are explainable and map to a simple controlled English language, and with a semantics that allows for layered abstractions which means verification for an entire program can be achieved by verifying independent trees of objects, branches and methods, separately. We define both a denotational semantics to model the concrete and symbolic state transitions of a correct program, and an operational semantics that captures the unconstrained behaviour of a program at run-time. We prove soundness between correct symbolic and operational semantics through a structural induction that is designed to prove that a correct symbolic semantics implies a correct operational semantics. This is split into two parts, first by proving correct symbolic implies correct concrete, and then by proving correct concrete implies correct operational. Correct operational semantics provides strong properties which include total correctness and determinism, whilst supporting parallel processing. A key limitation of Petra is the lack of direct support for verification of loops, however loops over compositions of primitive fields, within the branches of base object methods, can be assumed or proved using alternative methods. In addition to contributing the Petra language, semantics, and soundness proof, we developed a Java tool that automatically verifies Petra with a theoretical complexity of O(k(net + mct(nt^2 + b(q + z + t^b)))), where k is the number of objects in the program, each object has up to n private symbolic states, up to b fields, up to t predicates (each of expression size at most e), and up to m methods (each with up to c cases,
each case having a parallel composition of up to z statements and a sequential composition of up to q statements). This is in P (Polynomial Time), however Petra favours many small objects to leverage abstraction, yielding near-linear performance in practice.

Text
AranHakki-2026-thesis-COMPLETE - Version of Record
Restricted to Repository staff only until 2 June 2029.
Available under License University of Southampton Thesis Licence.
Text
AranHakki-2026-thesis-REDACTED - Version of Record
Available under License University of Southampton Thesis Licence.
Download (1MB)
Text
Final-thesis-submission-Examination-Mr-Aran-Hakki
Restricted to Repository staff only

More information

Published date: June 2026
Keywords: Correct-by-Construction (CBC), Formal Verification, Formal Methods, Object-Oriented Programming (OOP), Denotational Semantics, Operational Semantics, Soundness Proof, Deterministic Concurrency, Parallel Processing, Embedded DSL, Polynomial Time (P), Near-Linear Performance, Scalable Verification, Petra Programming Language, Formal Verification and Validation (V&V), Contract-Based Programming, Total Correctness, Structural Induction, Polynomial Time Complexity (P), Automated Theorem Proving, Automated Formal Verification, Automated Trading Systems, Algorithmic Trading, Financial Technology (FinTech), Business Logic Workflows, Explainable Software, Controlled English Language, Null-Safety, Deadlock Freedom, Race-Condition Freedom

Identifiers

Local EPrints ID: 512032
URI: https://eprints.soton.ac.uk/id/eprint/512032
PURE UUID: a9f7dc81-3c99-4b2b-89ce-f1849a86b3b1
ORCID for Aran Hakki: ORCID iD orcid.org/0000-0002-8986-6446
ORCID for Corina Cirstea: ORCID iD orcid.org/0000-0003-3165-5678

Catalogue record

Date deposited: 12 Jun 2026 16:50
Last modified: 30 Oct 2026 03:14

Export record

Altmetrics

Contributors

Author: Aran Hakki ORCID iD
Thesis advisor: Corina Cirstea ORCID iD
Thesis advisor: Julian Rathke

Download statistics

Downloads from ePrints over the past year. Other digital versions may also be available to download e.g. from the publisher's website.

View more statistics

Atom RSS 1.0 RSS 2.0

Contact ePrints Soton: eprints@soton.ac.uk

ePrints Soton supports OAI 2.0 with a base URL of https://eprints.soton.ac.uk/cgi/oai2

This repository has been built using EPrints software, developed at the University of Southampton, but available to everyone to use.

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we will assume that you are happy to receive cookies on the University of Southampton website.

×