[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: saving, restoring prolog state in binary form
From: |
Salvador Abreu |
Subject: |
Re: saving, restoring prolog state in binary form |
Date: |
Thu, 10 Jun 2004 10:22:00 +0100 |
Mayuresh <address@hidden> 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