Search papers, labs, and topics across Lattice.
This paper introduces VeGo, a deductive formal verification system designed for verifying Go programs, which integrates rigorous mathematical constructs such as Hoare-style contracts and loop invariants directly into Go code as comments. The authors argue that Go's unique features, like multiple return values, make it a superior choice for formal verification compared to languages like C, C++, Java, and Rust. Evaluation of VeGo against educational textbooks demonstrates its effectiveness and sets the stage for future developments in formal concurrency specifications using epistemic temporal logic.
Go programs can now be verified directly with formal methods, enhancing educational tools and developer productivity without altering the original code structure.
As formal methods are rapidly becoming accessible and practical due to AI coding agents, priority passes to assisting developers and students in generating specifications. Leveraging native HMX/SSA verifiers provide that support with rigorous mathematical guardrails. We present VeGo (Verified Go), a deductive formal verification system that enables direct verification of standard Go source code. VeGo incorporates Hoare-style contracts, loop invariants and integer variants, well-founded recursive measures, block-level scope invariants, and equational reasoning chains with primed variables directly as non-intrusive Go comments. We detail the language selection rationale justifying Go as an ideal balance over C, C++, Java, and Rust, strategically adopting Go's native multiple return values. We detail the tool architecture, exploiting the theoretical equivalence between Static Single Assignment (SSA) form and first-order functional programming to annotate code, desugar of clopen interval quantifiers, add Reynolds' skip statement, provide weakest precondition calculus, and native Hindley-Milner constraint inference, and verification condition resolution over the SSA form. We formalize contract-precision checking (weakest precondition vs. strongest postcondition) using an explicit analogy to type inference. Finally, we evaluate VeGo across educational textbooks and outline a roadmap for formal concurrency specifications using epistemic temporal logic.