Verification of a software program may be automated by receiving a program
source file comprising program source code and at least one formal
specification annotation, extracting the at least one formal
specification annotation from the program source file, compiling the
program source code and linking the compiled program and the at least one
extracted formal specification annotation to create an executable program
that includes at least one reference to an executable formal
specification module. According to one aspect, a virtual machine includes
a target virtual machine for executing one or more program implementation
instructions, and a formal virtual machine for executing one or more
formal specification modules corresponding to one or more program
implementation instructions and configured to call a formal specification
module, and to compare a first result obtained by executing the program
implementation instructions with a second result obtained by the call to
the formal specification module.