From Affine to Polynomial: Synthesizing Loops with Branches via Algebraic Geometry

📅 2025-09-29
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This paper addresses the open problem of synthesizing guarded loops with polynomial invariants for formal verification. Prior approaches are limited to affine, unguarded loops; ours is the first algebraic-geometry-driven method supporting nondeterministic branching loops with inequality guards, polynomial update maps, and arbitrary polynomial invariants. Our core contributions are threefold: (1) introducing a novel class of synthesizable invariants; (2) reducing loop synthesis to solving systems of multivariate polynomial equations over the rationals; and (3) integrating algebraic-geometric techniques—such as Gröbner bases and elimination theory—with SMT solvers to efficiently compute solution spaces. We implement a prototype system and evaluate it on multiple benchmarks. Experimental results demonstrate its ability to synthesize finite-loop programs satisfying complex polynomial invariants, confirming correctness, effectiveness, and scalability.

Technology Category

Application Category

📝 Abstract
Ensuring software correctness remains a fundamental challenge in formal program verification. One promising approach relies on finding polynomial invariants for loops. Polynomial invariants are properties of a program loop that hold before and after each iteration. Generating such invariants is a crucial task in loop analysis, but it is undecidable in the general case. Recently, an alternative approach to this problem has emerged, focusing on synthesizing loops from invariants. However, existing methods only synthesize affine loops without guard conditions from polynomial invariants. In this paper, we address a more general problem, allowing loops to have polynomial update maps with a given structure, inequations in the guard condition, and polynomial invariants of arbitrary form. We use algebraic geometry tools to design and implement an algorithm that computes a finite set of polynomial equations whose solutions correspond to all nondeterministic branching loops satisfying the given invariants. Furthermore, we introduce a new class of invariants for which we present a significantly more efficient algorithm. In other words, we reduce the problem of synthesizing loops to find solutions of multivariate polynomial systems with rational entries. This final step is handled in our software using an SMT solver.
Problem

Research questions and friction points this paper is trying to address.

Synthesizing loops with polynomial updates and branching guards
Generating polynomial invariants for arbitrary loop structures
Reducing loop synthesis to solving multivariate polynomial systems
Innovation

Methods, ideas, or system contributions that make the work stand out.

Synthesizes branching loops with polynomial invariants
Uses algebraic geometry to solve polynomial equation systems
Employs SMT solver for rational polynomial system solutions
E
Erdenebayar Bayarmagnai
KU Leuven, Department of Computer Science
Fatemeh Mohammadi
Fatemeh Mohammadi
Professor (Hoogleraar), KU Leuven
Combinatorial Algebraic GeometryApplied AlgebraTropical GeometryApplied Algebraic Geometry
R
Rémi Prébet
Inria, CNRS, ENS de Lyon, Université Claude Bernard Lyon 1, LIP, UMR 5668, 69342, Lyon cedex 07, France