The application discloses a program
verification metadata export method and device and a deterministic execution environment, and belongs to the field of compiling technology and
formal verification. The method comprises the following steps: marking the pointer ownership state in the
source code through attribute
annotation; extracting the ownership conversion information and generating the structured
metadata during compiling; and outputting the
metadata to the
special section of the compiling product, so that the
memory safety of the program can be verified independently by directly reading the metadata by an external
system. In order to make the exported metadata complete and inferable, a deterministic running environment composed of zero global state context, full-link
memory management, capability token and deterministic execution suite is provided. In the application, specific attribute annotations in the
source code are identified during the compiling process, the pointer ownership state conversion information and the function formal contract are generated into the structured metadata with a predefined binary format, and are written into the special metadata section of the target file (such as an ELF). In this way, the
processing of the internal
semantics of the program is changed from being internally digested and reformed by the
compiler to being actively and standardized output to the external
system, so that the technical obstacle that the program
semantics information cannot be directly and reliably acquired by the external AI or
verification tool is solved.