简体   繁体   中英

examples of prolog meta-interpreter uses?

I'm reading several texts and online guides to understand the possibilities of prolog meta-interpreters.

The following seem like solid use cases:

  • proof explainers / tracers
  • changing proof search strategy, eg breadth first vs depth first
  • domain specific languages

Question - what other compelling use-cases are there?

Quoting from A Couple of Meta-interpreters in Prolog which is a part of the book "The Power of Prolog" :

Other possible extensions are module systems, delayed goals, checking for various kinds of infinite loops, profiling, debugging, type systems, constraint solving etc. The overhead incurred by implementing these things using MIs can be compiled away using partial evaluation techniques. [...]

This quite extends your proposed uses, eg, by

  1. changing the search of p(X):- p(s(X)). to detect loops (including "obvious" ones like this one),
  2. hinting at where most compute time is spent ("profiling"),
  3. or by reducing a program to a simpler fragment that is easier to analyse (but still has the unexpected property: non-termination or failure), eg producing a .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM