Next: , Previous: , Up: mpg-bpr   [Contents][Index]


11.3.197 save_predicates/2

Synopsis

save_predicates(+PredSpecs, +File)

Saves all predicates in PredSpecs in PO format to File.

Arguments

:PredSpecs

pred_spec_tree

A predicate specification, or a list of such.

File

file_spec, must be ground

A file specification, ‘.po’ extension optional.

Description

save_predicates/2 saves the current definitions of all the predicates specified by the list of predicate specifications in PO format into a file. The module of the predicates saved in the PO file is fixed, so it is not possible to save a predicate from any module foo, and reload it into module bar. Source file information and embedded directives are not saved. A typical use of this would be to take a snapshot of a table of dynamic facts.

The PO file that is written out can be loaded using load_files/[1,2].

Please note: if PredSpecs contains specifications for which no matching predicate can be found, then a warning is issued, and the file is written anyway. Also, no built-in predicates are saved.

Exceptions

instantiation_error

PredSpecs is not instantiated enough, or File is not bound.

type_error

PredSpecs is not a valid tree of predicate specifications, or File is not a valid file specification, or a Name is not an atom or an Arity is not an integer.

domain_error

if an Arity is specified as an integer outside the range 0-255.

permission_error

File is not writable.

See Also

load_files/[1,2], Saving, ref-sls, ref-sls-ssl.



Send feedback on this subject.