How can I make good use of the 'class pie'?

Discussions related to Visual Prolog
Post Reply
User avatar
KA3AKOB
Posts: 4
Joined: 30 Oct 2007 8:12

How can I make good use of the 'class pie'?

Post by KA3AKOB » 29 Jan 2018 12:38

Is it possible to publish some sample code in Visual Prolog where the class pie is used? How can I embed the Prolog Inference Engine into Component Object Model server? What interfaces should contain such server? If I had some code in PIE language inserted into the text file what is the sequence of the calls of pie class methods to run goals based on that text file?
KA3AKOB C.A.

User avatar
Thomas Linder Puls
VIP Member
Posts: 2333
Joined: 28 Feb 2000 0:01

Re: How can I make good use of the 'class pie'?

Post by Thomas Linder Puls » 29 Jan 2018 13:51

If you have installed the examples (IDE: Help -> Install Examples...) you will have a directory named pieDemo, which contains an embedded PIE.

The PIE interface contains a predicate consult_p (and reconsult_p):

Code: Select all

predicates     consult_p : (string Filename) determ.     % @short consult #Filename into the PIE interpreter. To be used in invokePredicate's.     % @end
That is the predicate that the interpreter itself uses for consult (and reconsult).

But normally/often I think you would only have clauses and no goals in such files, and then you would run the goals (and goal like things) from the Visual Prolog using predicates like:

Code: Select all

predicates     run : (string Goal).     % @short Run #Goal     % @end
Or if you want to obtain a result:

Code: Select all

predicates     evalTerm : (term Term) -> term Evaluated.     % @short #Evaluated is the result of evaluating expressions and functions in #Term.     % @end
Creating a COM Server is a different subject which should not be discussed together with PIE stuff. What interface to give such a server depends on what you want to use it for. But I think you should postpone that part until you have gained experience with PIE itself.
Regards Thomas Linder Puls
PDC

User avatar
KA3AKOB
Posts: 4
Joined: 30 Oct 2007 8:12

Re: How can I make good use of the 'class pie'?

Post by KA3AKOB » 30 Jan 2018 10:51

Thank you for the help. I will learn the sample pieDemo with great attention.
Sincerely yours,
KA3AKOB C.A.

Post Reply