Javascript 中的 Prolog 系统 [英] Prolog systems in Javascript

查看:25
本文介绍了Javascript 中的 Prolog 系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Javascript 作为其他编程语言的实现语言似乎变得流行起来.文章(C)LP 到 JavaScript 的轻量级编译.ICLP 2012引起了我的注意.

网上有很多用 Javascript 编写的 Prolog 系统的概念验证原型.

什么是当前的、积极维护的、最好是用 Javascript 编写的符合 ISO 的 Prolog 系统?

解决方案

我所知道的 JavaScript 中唯一的 Prolog 是 YieldProlog,但我还没有广泛尝试过,只有 QueryEditor 中可用的代码.>

我希望使用的 yield 构造不是轻量级的(我在 C# 中广泛使用了这种构造,我发现它 - 与 lambda 配对 - 相当强大).

但是当我检查(概要)来源时,我发现它确实很复杂,尽管有假设.

编辑

我最近发现了这些贡献,看起来很有趣:proscriptproscript2.

编辑

可用的新实现:

Tau Prolog,从 Jan 在 SWI 邮件列表中引起我的注意

编辑

一些新东西,hhprolog,一个纯 Prolog 引擎,基于 Paul 提供的代码和文档Tarau,由我移植到 Javascript.因此,可在浏览器和 NodeJS 中使用.

该项目仍处于初步阶段,最需要的是引导到解释器:现在(预)将 Prolog 编译到(新颖的)虚拟机必须安装并正确配置 SWI-Prolog(需要 JPL).

为了实现这样的引导,我可能需要实现否定,重用 Paul 的接口,或者 - 更好 - 尝试实现一些保持纯范式的东西.特别是,只有无界整数算术(同样由 Paul Tarau 提供,有一些 Python 代码可用 - 我将尝试懒惰地移植到 Javascript).

Javascript seems to become popular as an implementation language for other programming languages. The article Lightweight compilation of (C)LP to JavaScript. ICLP 2012 drew my attention on this.

There are a lot of proof-of-concept prototypes for Prolog systems written in Javascript around on the Web.

What are current, actively maintained, preferably ISO conforming Prolog systems written in Javascript?

解决方案

The only Prolog in JavaScript I know is YieldProlog, but I haven't tried it extensively, just the code available in QueryEditor.

I was hoping than using the yield construct it was lightweight (I used extensively such construct in C#, and I found it - paired to lambda - rather powerful).

But when I inspected (summarily) the source, I found it really complex, despite the assumptions.

edit

I've found recently these contributions, that seem really interesting: proscript and proscript2.

edit

a new implementation available:

Tau Prolog, brought to my attention from Jan on SWI mailing list

edit

Something new, hhprolog, a pure Prolog engine, based on code and documentation provided by Paul Tarau, ported by me to Javascript. So, available in both browsers and NodeJS.

The project is still preliminary, mostly needed is to bootstrap to interpreter: right now (pre)compiling Prolog to the (novel) virtual machine must be accomplished with SWI-Prolog installed, properly configured (JPL needed).

To implement such bootstrapping, I would probably need to implement negation, to reuse Paul' interface, or - better - attempt to implement something staying in the pure paradigm. In particular, only unbounded integer arithmetic (again by Paul Tarau, there is some Python code available - I will try lazily to port to Javascript).

这篇关于Javascript 中的 Prolog 系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆