The application discloses a
formal specification generation and
verification method for ESBMC, which reduces manual intervention by combining a large
language model with an ESBMC tool, can significantly improve the
verification efficiency and accuracy of complex programs, and can fully reflect the real behavior of the program when
processing programs containing complex control structures. The automatically generated specification can fully reflect the real behavior of the program when
processing programs containing complex control structures. By using a large
language model to analyze and extract program information, the preconditions, postconditions and loop invariant
formal specification are automatically generated, which are input into the ESBMC tool for
verification to obtain the verification result. The verification result of ESBMC is fed back to the specification generation module, the generated specification is refined and repaired, and the generation strategy is dynamically adjusted to optimize different program behaviors, so that the generated
formal specification is accurate and effective. Through supervised fine-tuning and reinforcement training, the ability of the large
language model is continuously optimized, so that the model can automatically adapt to the characteristics of different programs and generate more accurate specifications.