JavaScript library for logic programming [closed]

僤鯓⒐⒋嵵緔 提交于 2019-12-12 07:12:19

问题


Do you know of any good javascript library for logic programming?

I'm interested in something like jsprolog, but I want to use javascript to communicate with the lib, and not a different language (such as prolog in this case).

Many thanks.


回答1:


There are a bunch of other languages that compile to javascript: https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS

It is possible (although not probable!) one of those has a javascript friendly API AND a suitable library that can by "compiled" into JavaScript.

Exactly what you aren't looking for, and probably a time waster :)




回答2:


Please check out (JSL) https://www.npmjs.com/package/lib-jsl.

From the overview document, JSL is a JSON based logic programming library meant for embedded use in JS programs. It uses JSON as its syntax as well as I/O method




回答3:


There is a new tool, a generic compiler adding any effect to JS, including logic programming, there is an example of prolog append: https://github.com/awto/mfjs-samples/tree/master/unify




回答4:


In addition to jsprolog, there are several JavaScript libraries for logic programming:

  • chr.js is a constraint logic programming library for JavaScript. It is an implementation of the Constraint Handling Rules programming language.

  • There are several JavaScript implementations of Datalog such as DataScript.

  • Yield Prolog allows Prolog programs to be embedded directly in JavaScript. This is especially useful because it allows JavaScript functions to be used in Prolog predicates, and vice-versa.

  • LogicJS is a JavaScript library that is based on MiniKanRen, which has been implemented in many programming languages, including JavaScript.

  • JavaScript-Logic-Programming-System is another logic programming system for JavaScript.

  • There is another Prolog implementation that was written in less than 200 lines of JavaScript code.

Of course, there are also several C++ libraries for logic programming that could be automatically ported into JavaScript using Emscripten.



来源:https://stackoverflow.com/questions/7585903/javascript-library-for-logic-programming

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!