🤖 AI Summary
This work addresses the semantic gap between formal methods and practical software engineering by proposing a unified semantic framework based on the tagless-final style. Starting from a single executable program definition, the framework simultaneously generates executable semantics, weakest preconditions, and bounded verification conditions, thereby eliminating the need to reimplement traversal logic for each semantic variant. A prototype implementation in Python supports core imperative constructs—including assignment, conditionals, assumptions, and assertions—and successfully produces state transformers and verification conditions for five benchmark programs. Bounded verification is performed over finite domains with up to 729 states, demonstrating both the effectiveness and conciseness of the approach.
📝 Abstract
Formal methods provide rigorous accounts of program behavior, but practical software engineering often works through executable libraries, tests, and incremental design. This paper presents SEMBridge, a small tagless-final framework for generating weakest-precondition and bounded-checking interpretations from the same executable object programs. Instead of committing a program semantics to one abstract syntax tree and then writing separate traversals, object programs are written once against a semantic interface and interpreted into multiple meanings: readable code, concrete execution, predicate transformers, bounded counterexample search, and future proof-assistant or SMT back ends. The Python prototype implements a loop-free imperative core with assignments, conditionals, assumptions, and assertions. Across five example programs, the same tagless-final definitions generated executable state transformers and verification conditions that passed bounded checking over domains up to 729 states. The contribution is not a Scala code-generation system or a new verifier, but a compact architecture for keeping executable semantics, weakest-precondition artifacts, and bounded validation synchronized.