Saved-states may be created from within a stand-alone program or a runtime
system in the normal way, using save_program/[1,2]
. A saved-state may
be restored, using the built-in predicate restore/1
, or incrementally
loaded using load_files/[1,2]
. As discussed in ref-sls,
saved-states are just QOF files, and there is complete flexibility in how
they can be selectively saved and loaded. Saved states, and other
selections of predicates and modules saved into QOF files, can also be
directly used with qld
to build a stand-alone program or runtime
system.
Note that the restore/1
command is not as useful to load a saved-state
(or any QOF file) into a runtime system as the load_files/[1,2]
command.
While a restore/1
in a stand-alone program, just as in
the Development System, restarts the running executable and then loads the
argument QOF file, a runtime system only restarts
the executable, and the file, preceded by a +l
flag, is passed to
the application program, which may elect to parse the arguments and then
load the file. Similarly, if a saved-state is created from a runtime system
and then restarted from the command line, the executable will be started,
but the options list need to be parsed and the file loaded by the
application program (see mpg-ref-restore, and ref-pro-arg
or too-too-prolog for a description of the +l
option).