Re: saving, restoring prolog state in binary form

Salvador Abreu <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Organization Universidade de Evora, Departamento de Informatica
Message-ID <[email protected]>
Mayuresh <[email protected]> wrote:

> I am trying to save the state of prolog for use in a subsequent
> session.
> Such requirement arises while trying to use prolog in forward chaining
> mode where inferences drawn are to be asserted as facts for future
> use.
	[...]
> > But is there any way the prolog state could be saved and restored in
> > binary form? Guess, this could make the store/load operations much
> > faster than the above approach.

This kind of approach doesn't really suit GNU Prolog, which is
essentially a native compiler system; you'd be better off producing your
clauses (assertz/1 is ok for this purpose), outputting them to a .pl
file (listing/1 will do), compiling that file separately and building a
new executable, which would then be used as the next "initial state".

Avoid using consult in GNU Prolog; compile (externally) with gplc:
you're likely to see very significant performance gains.

-- 
 ../salvador
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.