The invention discloses an automatic function abstract generation method based on a
large model. The method comprises the following steps: step 1) designing an abstract grammar and a related analysis tool in an EBNF (Extended Bass Normal Form) form; 2) aiming at input information of a function to be abstracted, screening similar use cases, grammar information and
semantics of each instruction in abstract definition from the abstract
knowledge base, and constructing cue words by using modeling knowledge such as methods; 3) transmitting the cue word to the
large model and extracting a function abstract from the output of the
large model; 4) performing grammar test and semantic test on the function abstract generated by the large model in the step 3), if the test is passed, entering the next step, otherwise, repeating the step 3), transmitting error information to the large model, and regenerating the abstract; 5, when a tripartite
library function is encountered, a matched abstract is searched from the abstract
library according to a function signature, the abstract is analyzed into a
data structure convenient to use by a
static analysis tool based on the constructed analysis tool, substitution operation is carried out, and
simulation of the
side effect of the function is achieved.By means of the method, the precision of
static program analysis can be improved.