Skip to main content
QUICK REVIEW

[Paper Review] Synthesis of Parametric Programs using Genetic Programming and Model Checking

Gal Katz, Doron Peled|arXiv (Cornell University)|Feb 27, 2014
Formal Methods in VerificationComputer Science19 references5 citations
TL;DR

This paper presents a hybrid approach combining genetic programming (GP) with model checking to synthesize correct-by-design parametric programs. It uses fitness evaluation via satisfiability checking and counterexample-driven refinement to evolve programs that satisfy temporal logic specifications, successfully generating correct solutions for complex problems like overflow-free average computation and mutual exclusion protocols.

ABSTRACT

Formal methods apply algorithms based on mathematical principles to enhance the reliability of systems. It would only be natural to try to progress from verification, model checking or testing a system against its formal specification into constructing it automatically. Classical algorithmic synthesis theory provides interesting algorithms but also alarming high complexity and undecidability results. The use of genetic programming, in combination with model checking and testing, provides a powerful heuristic to synthesize programs. The method is not completely automatic, as it is fine tuned by a user that sets up the specification and parameters. It also does not guarantee to always succeed and converge towards a solution that satisfies all the required properties. However, we applied it successfully on quite nontrivial examples and managed to find solutions to hard programming challenges, as well as to improve and to correct code. We describe here several versions of our method for synthesizing sequential and concurrent systems.

Motivation & Objective

  • Address the challenge of synthesizing correct-by-design parametric programs, which are inherently difficult due to undecidability and high complexity in classical synthesis methods.
  • Overcome limitations of traditional model checking by using it not as a complete verification method but as an exhaustive testing engine for fixed parameter instances.
  • Enable automatic correction and optimization of flawed or suboptimal code through a human-guided, heuristic-driven evolutionary process.
  • Extend genetic programming to evolve not only code logic but also system architecture, including process structures and communication channels.
  • Provide a practical, scalable framework for synthesizing complex concurrent and sequential programs where formal verification alone is infeasible.

Proposed method

  • Use genetic programming to generate and evolve candidate programs using mutation operations on syntactic constructs, including assignment, bitwise operations, and control structures.
  • Employ enhanced model checking or SMT solvers to evaluate correctness, returning not just yes/no but also counterexamples and fitness levels based on satisfiability of temporal logic properties.
  • Integrate a fitness function combining satisfiability checks and test case coverage, where failing test cases from previous iterations are reused to guide evolution.
  • Accumulate counterexamples and parameter sets from failed candidates to form a growing test suite, increasing confidence in correctness without requiring full verification.
  • Allow user-guided refinement by modifying specifications, fitness heuristics, or initial code templates to steer the search toward desired solutions.
  • Support architecture evolution by allowing mutation of process structures and communication channels, enabling discovery and correction of architectural flaws.

Experimental results

Research questions

  • RQ1Can genetic programming guided by model checking effectively synthesize correct-by-design parametric programs despite undecidability in classical synthesis?
  • RQ2How can model checking be repurposed as a generalized testing mechanism for parametric systems where full verification is infeasible?
  • RQ3To what extent can the method automatically correct or improve flawed or suboptimal code based on formal specifications?
  • RQ4Can the framework evolve not only code logic but also system architecture (e.g., number of processes, communication patterns) to discover correct concurrent designs?
  • RQ5How effective is the combination of satisfiability checking and counterexample-driven test case accumulation in guiding convergence toward correct solutions?

Key findings

  • The method successfully synthesized a correct, overflow-free average computation program (identical to the known solution in [23]) after refining a flawed initial version through iterative evolution.
  • A correct mutual exclusion algorithm was synthesized and verified using the framework, demonstrating applicability to complex concurrent systems.
  • The approach generated a correct program for the bit-vector problem (outputting 0 iff input is 2^n - 1) within seconds, proving correctness for all bit-vector inputs of fixed width.
  • Counterexamples from failed candidates were effectively reused to guide the search, significantly improving convergence and fitness evaluation accuracy.
  • The framework enabled automatic correction of a naive average computation algorithm that overflowed on large inputs, evolving it into a correct and efficient solution.
  • The method is not guaranteed to terminate or always succeed, but it provides strong empirical evidence of correctness through extensive test case coverage and satisfiability checks, making it practical for real-world synthesis tasks.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.