Re: communicate with Prolog engine in Prolog



for nonterminating predicates you could write a metainterpreter and stop
/pause after finding n variable substutions.

Even when the predicate does not terminate it may be useful to use
something like a metainterpreter.
Suppose users may query a Prolog program through a web interface.
Suppose a query has 530 solutions. Then the web-interface program
should talk to a Prolog engine E and get from E the first, say, 10
solutions. Only if the user wants more solutions, should the interface
program be given the next 10 solutions. It would be absurdly expensive
to calculate all 530 solutions in the first place.

http://stud4.tuwien.ac.at/~e0225855/acomip/acomip.html, another source
http://www.complang.tuwien.ac.at/ulrich/prolog2.pdf(in german)

Thanks for the links. I will probably use such methods.

Simon
.



Relevant Pages

  • Re: communicate with Prolog engine in Prolog
    ... something like a metainterpreter. ... Suppose users may query a Prolog program through a web interface. ... have to take execution time into account anyway:) ...
    (comp.lang.prolog)
  • Re: A particular splitting problem
    ... > Suppose I have a prolog program, and I want to extract all the ... > bodies related to a particular head. ... I used the query: ... Run this after setof, substituting Output for List1. ...
    (comp.lang.prolog)
  • need smarter paging
    ... I have a query that returns many thousands of records, ... The web interface is fine with it because I use a paged grid view - ... however this control cannot tell the app server to just return the records ...
    (microsoft.public.dotnet.framework.aspnet)
  • Not printing the variable instantiations
    ... I wrote a prolog program to count the number of 1's in a list. ... I am using SWI prolog. ... When I try the query ... I want instantiations for N. ...
    (comp.lang.lisp)