Prologue: artificial intelligence in your programs...

The moderate success of the language is undoubtedly due to the fact that its creators wanted to use it as a full-fledged language, which is why the programmer encounters problems where logical programming is neither natural nor very convenient.

While it excels in other problems when the procedural method is very laborious, due to its ability to evaluate based on data expressed as predicates.

Thus, the Prologue language takes on all its meaning if it is embedded in a procedural language, allowing one type of programming or the other to be used where they allow the best expression of the treatment. For example, procedural functions for drawing a maze and moving entities into it, classes for characterizing them, logical sentences for giving them smart behavior and integrating knowledge added over time.

Console Prolog

What are the best Prolog issues?

Problems that Prologue will solve for you

Relations

When recording relational data in the form of clauses, for example, family relations between people, the assessment allows us to conclude about family relations between all pairs of people .

Understanding

Natural language can be formulated by dividing the rules of grammar into points, after which machine translation can be implemented or ordinary questions can be answered.

Anticipation and explanation

Presenting data in a tree form, where the data of one point are other points, allows you to analyze hypotheses, predict the consequences, and find reasons.

Prolog Short Tutorial

They teach to use the prologue by installing an interpreter, for example, SWI-Prolog or GNU Prolog. Their command console allows you to download programs and interact with the knowledge base they contain.

After downloading and installing, the console is opened by clicking the SWI or GNU icon .

You can also run an interpreter in the system console, for example:

swipl -s programme -g "message" -t halt  

The program is the name of your file without the. "Pl" extension.

The program is compiled and run with the "consunt" command from the Prolog console.

Both interpreters are compatible with the same source code, but SWI responds with truth or lies, while SWI responds with yes or no.

  1. Prologue textbook: A set of facts is recorded.
  2. Prologue textbook: The problem is set out in the form of rules
  3. .
  4. Demo Prologue: Looking for an apartment
  5. .

Prolog kits for integration with another language

SWI-Prolog is free and has been developed since 1987, this implementation can be used by itself as a development platform and even as an HTTP server. It can analyze and generate HTML or JSON code and communicate with the database.

And it can interact with other languages ​ ​ such as C++, Java, C #. Recently there was a version for WebAssembly: swi-prolog-wasm. So you can use with JavaScript or any compilation language in wasm.

Prolog can be used in a web application with the wasm implementation as above, or with an interviewer written in JavaScript, such as Tau Prolog. It can work with Node.js.

Other kits for JavaScript and other languages:

Programming and languages of data -ALGOL 68-Asm.js -AppearanceJ BASICC EYELASH#- C++ -CDarthEiffelGuoJava - JavaScriptJulia- JavaFX Script PascalPHP PythonProlog QMLRexx RubyRust La ScalaScriptolSwift TclTypeScriptHTMLVasmXMLXAML XUL SQL