Re: saving, restoring prolog state in binary form
Mayuresh <[email protected]>
| Newsgroups | gmane.comp.gnu.prolog.general |
|---|---|
| Message-ID | <1086874933.1921.93.camel@TCS023077> |
> Try this approach (using gplc to make an executable with all static > predicates). Thanks for a detailed reply. I may need to close and restore the session a no of times. If the predicates become static they will not be listed the second time around. I can declare the predicates as dynamic and still use the compilation approach suggested by you. Does it take away the benefits of compilation approach? Actually, this is how I am currently doing it: I have a gplc compiled binary consisting of just the rules. (This could be called a meta interpreter, I guess.) The facts are piped through stdin to this binary at run time. These facts come from some external source. The predicates used for these facts are known up front and are declared dynamic in the compiled code. Now when closing the session I dump the listing. Next time around I first feed this listing through stdin before starting listening to the facts from external source. I find this much faster than consulting the file as you said. But no compilation is involved either. Could you please comment on this approach as well? TIA. Mayuresh.