Page 1 of 1

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

Posted: 29 Jan 2018 12:38
by KA3AKOB
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?

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

Posted: 29 Jan 2018 13:51
by Thomas Linder Puls
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.

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

Posted: 30 Jan 2018 10:51
by KA3AKOB
Thank you for the help. I will learn the sample pieDemo with great attention.
Sincerely yours,