Skip to content

Executable JavaScript as a Checkable Specification Language: A JS-SAM Case Study on SysMoBench

Jul 2026 · arXiv.org · Vol abs/2607.13092 · 0 citations · 34 references
Computer Science

Abstract

Can large language models write faithful formal specifications of real systems, and does it matter whether they write in a formal language they have seen rarely or in a mainstream language abundant in their training data? We study this on SysMoBench, which grades a generated specification in four phases, the decisive one replaying execution traces captured from the running system. We add JS-SAM, its first non-formal backend, in which a specification is executable JavaScript written in the SAM pattern, a pattern whose semantics mirror TLA+, and run a controlled comparison that separates three variables an ordinary head-to-head entangles: the language, the specification contract (the shape the model must fill), and the prompt. The study spans four frontier models and three systems (an operating-system spinlock, a distributed lock service, and the Etcd Raft consensus implementation), with counterexample-driven repair. Three findings emerge. First, conformance against the real system is the only phase that discriminates among models; internal consistency is inexpensive to satisfy, and a specification that looks right is not thereby right. Second, once the comparison is drawn like for like, the specification contract, not the language, governs fidelity: JavaScript in the shape of the TLA+ transition relation is as faithful as TLA+. Third, a minimal contract carries transcription but not semantic derivation: at consensus scale the difficulty becomes understanding the protocol, which no contract shape and no language supplies. We frame executable JavaScript as a checkable specification substrate that complements, rather than replaces, the verification TLA+ provides, and present the study as a case study.

View source

Similar papers

Preprint Sep 2026

Large Language Models and Language Server Protocol: a match made in context

This article introduces Eiffel-tools, a language server protocol (LSP) implementation for the Eiffel programming language that uses Large Language Models (LLMs) to aid the development of statically verified software. The tool provides various interactive and non-interactive commands to produce code and specifications....

Alessandro Schena, I. Mustafin, Julia Kotovich · 0 citations
Preprint Sep 2026

Specifying Paxos for System Builders: Pseudocode Made Executable

It is shown how the protocol pseudocode can be expressed easily, essentially line-by-line, in a precise high-level language, DistAlgo, for direct execution in distributed systems.

Yan-Hong A. Liu, Rahul Sihag · 0 citations
Open access Sep 2026

Generative File Systems: Specification-Driven Synthesis and Evolution via LLMs

File systems are critical OS components that require constant evolution to support new hardware and emerging application needs. However, the traditional paradigm of developing features, fixing bugs, and maintaining the system incurs significant overhead, especially as systems grow in complexity. This paper proposes a n...

Qing-Yuan Liu, Heng Zhang, Mo Zou et al. · 0 citations
Review Sep 2026

Trust the Spec, Not the Code - A Specification-First, AI-Assisted Case Study in Online Banking

It is argued that AI removes much of that cost: natural language enriched with lightweight mathematics, written in \LaTeX, can serve as an intermediate specification language that is precise enough to reason over and prove, while a large language model reviews it for ambiguity, drafts proofs, and generates the implemen...

E. Farchi · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.