简体   繁体   English

序言元解释器使用的例子?

[英]examples of prolog meta-interpreter uses?

I'm reading several texts and online guides to understand the possibilities of prolog meta-interpreters.我正在阅读一些文本和在线指南,以了解 prolog 元解释器的可能性。

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" :引用 Prolog 中的几个元解释器,这是“Prolog 的力量”一书的一部分:

Further extensions进一步扩展

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.其他可能的扩展是模块系统、延迟目标、检查各种无限循环、分析、调试、类型系统、约束解决等。使用 MI 实现这些东西所产生的开销可以使用部分评估技术编译掉。 [...] [...]

This quite extends your proposed uses, eg, by这大大扩展了您建议的用途,例如,通过

  1. changing the search of p(X):- p(s(X)).改变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 .或者通过将程序简化为更易于分析的更简单的片段(但仍然具有意想不到的属性:非终止或失败),例如生成

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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