Yes, this is so. But the problem is not how to implement(execute, make) THIS predicate as well as to be able to execute any predicate stored in string. I think that the interface of this library can not do it. My aim is Prologue server that can send a text query (a predicate). The problem in obtaining the correct predicate from the string. Thank you all, I decided to go to the SWI-Prolog.
(Sorry for my bad English) On Mon, 27 Apr 2009 15:22:07 +0200, Daniel Diaz <[email protected]> wrote: > You are right, the problem comes from: > > char str[]="asserta(parent(bob,mary))"; > > followed by: > > Pl_Mk_Atom(Pl_Create_Allocate_Atom(str)) > > you thus create an atom and not a compound term. You should use instead > Pl_Mk_Compound instead > (see http://gprolog.org/manual/html_node/gprolog069.html#toc291) > > BTW: since you have 2 nested compound terms (asserta/1 and parent/2) you > have to first create parent(bob,mary) in a PlTerm variable 'X' and then > to create asserta(X) into a variable 'goal'. Use Pl_Mk_Compound for both. > > Daniel > _______________________________________________ Users-prolog mailing list [email protected] http://lists.gnu.org/mailman/listinfo/users-prolog
