Recently, I have been learning about the extremely interesting logic of PROLOG.Programming LanguageIt is completely different from the imperative programming language. Prolog is declarative. I personally think it is more like a DSL language and logic DSL language.
No PROLOG LanguageCodeThere are actually three points.
Fact: some logical concepts are defined. They are true without any proof, just like the kilometers in the Euclidean ry.
Rule: Defines rules between basic facts. It is a bit like the reasoning process of Euclidean ry. Some Theorems can be derived from the basic kilometer.
Goal: this is the problem. The solution to the problem is derived from facts and defined rules, which is a bit like a mathematical proof.
The core of this language is recursion. It is completely solved by recursion.
Recursion has two important elements: boundary condition and recursive definition.
That is to say, it cannot be infinitely recursive. If recursion is not completed within a unit of time, the problem is unbounded.
Recursive definition is actuallyAlgorithmProblem.
Prolog is suitable for programming logic and rules. It can solve the problem related to artificial intelligence. It is easy to learn a little and mainly exercises abstract thinking.