Is Prolog a high level language?

(Note:  We may earn commissions from products/services you click on.  This is at no extra cost to you.)

Table of Contents

Prolog is a logic programming language. It is based on the theoretical foundation of logic and was initially used in research fields such as natural language. It has been widely used in artificial intelligence research and can be used to build expert systems, natural language understanding, and intelligent knowledge bases.
At the same time, it is also very helpful for the writing of some common application programs. It can develop programs faster than other languages because its programming method is more like using logical language to describe the program.

Never stop learning.   The time is now to upskill yourself.  Click this affiliate link to register for Data Science Certification training.


Computer languages ​​are divided into high-level languages ​​and low-level languages. The high-level language is mainly relative to assembly language. It is a programming that is closer to natural language and mathematical formulas. It is basically separated from the hardware system of the machine and writes programs in a way that is easier for people to understand.

High-level language does not specifically refer to a specific language. Still, it includes many programming languages, such as the currently popular Java, c, c++, C#, pascal, python, Lisp, Prolog, FoxPro, VC, accessible language, Chinese version. The grammar and command formats of these languages ​​are different.

Low-level languages ​​are divided into machine language (binary language) and assembly language (symbolic language), both of which are machine-oriented languages ​​and are closely related to the instruction system of a specific machine. Machine language uses instruction codes to write programs, while symbolic languages ​​use instruction mnemonics to write programs.
The high-level language has nothing to do with the computer’s hardware structure and instruction system. It has a more vital expressive ability, can conveniently express data operations and program control structures, describe various algorithms, and is easy to learn and master. But the program code generated by high-level language compilation is generally longer than the program code designed with assembler language, and the execution speed is also slow. Therefore, assembly language is suitable for writing programs that require high speed and code length and programs that directly control hardware. High-level language, assembly language, and machine language are all languages ​​used to write computer programs.

Is Prolog a high level language
Is Lisp a functional programming language

What is Prolog used for?

Prolog (abbreviation for Programming in Logic) is a logic programming language. It is based on the theory of logic e68a84e8a2ad62616964757a686964616f31333339653737 and was initially used in natural language and other research fields. It has been widely used in artificial intelligence research and can build expert systems, natural language understanding, and intelligent knowledge bases. At the same time, it is also beneficial for the writing of some common application programs. It can develop programs faster than other languages because its programming method uses logical language to describe the program. The prolog program does not have a specific running sequence, and the computer, not the programmer, determines its running sequence.

  • There are no control flow statements such as if, when, case, and for in the prolog program
  • Prolog program and data are highly unified
  • The prolog program is an intelligent database
  • Powerful recursion function

Structured Query Language (Structured Query Language), referred to as SQL (pronounced: /ˈes kjuː ˈel/”SQL”) is a special-purpose programming language, a database query, and programming language, used to access data And query, update and manage relational database systems; it is also the extension of database script files.

Generally speaking, Prolog runs as a data or logic processing program and cooperates with other programs such as VC++, JAVA, etc., to achieve “smart” software with UI interaction. Of course, the “smart” you edit is software, And cannot be said to be the true meaning of artificial intelligence. As mentioned above, Prolog is an intelligent database. It is not. Prolog mainly describes the data. For example, Zhang San and Li Si are A relationship, Li Si and Wang Er are B relationship, A relationship == B relationship, then Prolog is good at dealing with this kind of logical data relationship and cannot be confused with SQL. Therefore, Prolog aims to deal with the relationship between data, not to store the essential existence of the data.

What is Prolog in Artificial Intelligence?

What is intelligence? Different researchers have proposed various explanations and definitions. Among many other suggestions, intelligence is defined as the ability to acquire and apply knowledge and the ability to reason logically and self-awareness.

Two methods have been widely known among researchers and have been used in practice for decades. Prolog is usually associated with symbolic methods. Well-known applications of this type include scheduled tasks such as Wumpus World, escape from Zurg, Connect 4, scheduled tasks (such as timetables and sports games), and other combined tasks such as N Queens and Sudoku. Prolog can, of course, also implement statistical methods. For example, check out ProbLog, splint, and AILog 2 for uncertain probabilistic logic programming and reasoning.

Become an industry expert when you take the time to learn new skills.  Click this affiliate link to register for the Data Scientist Masters Program.

These methods have different advantages and disadvantages: symbolic methods are usually suitable for formal verification. These rules are available, and you can check whether they are complete and whether they express your intentions. Using Inductive Logic Programming (ILP), you can even let the program learn rules based on positive and negative examples. See, for example, the Metal system. However, not all tasks are suitable for symbolic methods because the rules can be difficult to express. For example, it is difficult to express the rules for determining whether a musical composition has marginal tones or whether a photo contains flower paintings.

On the other hand, statistical methods can implicitly obtain rules based on the so-called training set, test set, and validation set. This is convenient because you don’t have to think about the rules yourself, and the computer may come up with rules that are difficult to encode. Unfortunately, this also brings obvious shortcomings: you can no longer reason about rules explicitly, and the resulting mechanism may produce outliers that are difficult to remedy. For example, if you change a single pixel, you might classify the image of a penguin as a car.

Prolog and artificial intelligence

Prolog has a very strong historical connection with artificial intelligence. In 1982, Japan launched an ambitious government project called the Fifth Generation Computer System (FGCS), whose goal was to use concurrent logic programming as the software foundation of the project to create large-scale parallel computers.

Is Prolog used today?

Prolog can still be used today, and various implementations are actively developed. Nonetheless, I know of simply a handful of companies that are using it.

There are technologies that you can learn and secure an immediate technical and economic benefit, like SQL. There was still engineering’s you should escape because they have been superseded by better things, like cash( C eggshell ). There are technologies where they are likely to specify a technical setback but maybe financial benefits, like COBOL or Oracle pl/ SQL.

Prolog belongs to a group of technologies that, for whatever reason, failed to change the world despite being radically different and considerable betters on what came before. Nonetheless, it is a niche technology, and it won’t provide you with an immediate financial benefit. I happen to think that learning has uses outside the immediately applicable:

  • Registering you what kinds of crazy things are possible.
  • Helping to deflate hype on new stuff.
  • Helping you analyze questions more technology-agnostically.
  • But these are “soft” benefits of learning Prolog.

I experience using it for side projects, personally. If you are inclined to learn it, exactly give it a try, it’s very fun!

From a theoretical point of view, Prolog is a very interesting language, but its semantics and control flow does not fit the human brain very well; at least they do not fit the psyche of the person training in any other computer language ( being it was essential or object-oriented ). To corroborate this declaration, I give you some more details: P TAGEND

a.) The 4-port sit: For understanding the assured move of a Prolog program, you have to get familiar with the 4-port pose. Having expended any debugger in any other language, you will be surprised when you single-step through a Prolog program.

b.) The most beneficial things in Prolog are only a “side effect”: For almost every serious program, you have to read input (e.g., from the keyboard, a document, a database, or a socket) and make yield ( e.g., write to a register, screen or database, a socket ). In “pure” Prolog, this is not possible.

Swi-Prolog

Prolog may be a language that particularly encourages the utilization of its implementation. Suppose you would like a Prolog implementation that’s particularly good at inference on multiple computers or insert probability or time into the premise. In that case, you will have to make your own Prolog.

If language may be a front, then Java is going to be the Communist Party (emphasis on integration), C are Amish (emphasis on old-fashioned and straightforward methods), and Prolog is going to be a hippie, emphasizing self-expression instead of consistency.

Any implementation consists of core language implementations and libraries. SWI-Prolog is known for its exquisite library collection. There are SWI-Prolog libraries for “many things”-various names from web frameworks to Google Protocol Buffers. Many Prolog implementations use the SWI-Prolog library, and in an exceeding sense, are “on top of” SWI-Prolog.

What is silent and silent in C++?

What is the Hoon programming language?

Is there any reason to use >> (append)> (overwrite) when redirecting output to /dev/null?

What are some good ways for Lisp or Clojure programmers to find out Haskell?

What is the Scratch programming language?

This situation isn’t unique. Scala and Clojure are among the simplest within the JVM partly because it allows them to access various Java language libraries.

The core language implementation is also compelling, so SWI-Prolog is the most ordinarily used Prolog implementation.

Finally, SWI-Prolog comes with “battery included”, small IDE, quick installation, etc. This makes it popular among CS lecturers and students and business users who don’t need to waste time on a posh ecosystem.

Prolog is a beautiful tool for representing and manipulating data written in formal languages further as linguistic communication. Its safe semantics and automatic memory management make it a significant candidate for programming robust Web services.

Although Prolog is usually seen as a component during a Web application that’s either embedded or communicates employing a proprietary protocol, we propose an architecture where Prolog communicates to other elements in the same Web application using the quality HTTP protocol.

By avoiding embedding in external Web servers, development and deployment become much more accessible. To support this architecture, additionally to the transfer protocol, we must also support parsing, representing, and generating the necessary Web document types like HTML, XML, and RDF.

Prolog stands for.

Prolog (abbreviation for Programming in Logic) is a logic programming language. It is based on the theoretical basis of logic and was initially used in research fields such as natural language.

In 1972, to improve the execution efficiency of the resolution method, the French Comorauer team developed a program executor for the theorem-proving program, named PROLOG (Programming In Logic), marking the birth of the first logic programming language, PROLOG.

In 1974 and after, R. Kowalski further clarified the theoretical basis of PROLOG from the perspective of the HORN clause of predicate logic and systematically proposed ​​logical programming.

There are three basic sentences in PROLOG language, which represent facts, rules, and queries, and correspond to the HORN clauses with head (without body, body) and headless. E.g.:

Therefore, programming in PROLOG language can be boiled down to declaring facts, defining rules, and asking questions.

The interpretation and execution process of the PROLOG program adopts a specific input resolution, that is, starting from the target sentence, find the resolution (tail and head matching) of a clause in the original clause set, and the new clause is then matched with a clause in the original clause set. The clause seeks the resolution, and so on. At any time, no resolution is found between two derived clauses or two clauses of the original clause set. In the above example

⑥: -human(u), greek(u) (the resolution of ④ and ⑤, mgu=u/x)

⑦: -greek(socarates) (the resolution of ② and ⑥, mgu=socarates/u)

⑧:-(The resolution of ③ and ⑦, the empty clause)

The answer to the question is u=Socrates. It can be seen that the PROLOG interpretation system is a theorem-proving program or problem-solving program based on the resolution principle.

Low time and space efficiency is an important issue that affects the application of PROLOG language. The ways to improve efficiency are: improve the PROLOG interpretation system, adopt the PROLOG compilation system, develop the PROLOG machine, introduce meta-rules for control, use heuristic search methods, and enable intelligent backtracking, Adopt collaborative and concurrent solution technology to develop parallel processing mechanism.

Is Prolog powerful in graphics?

Logic programs lotion in knowledge-based arrangements ask ponderous implementation of images for effective human interfaces, and it needs potent methods for describing, engendering personas. PROLOG as an AI language dedicates the user the possibility of describing conceptions – in this way, epitomes – at the highest level and can solve problems given declaratively. The high-pitched need for computer graphics in logic programming language and the lack of it in represent PROLOG implementations caused us to elaborate a graphic organization built into PROLOG language and to analyze its role in AI application. A 3-dimensional graphic called angle graphic based on turtle graphic was created. An implementation is briefly described.

Improve your skills and become a Data Analyst.  Click this affiliate link to register for the Data Analyst Masters Program.

Prolog is usually associated with AI, natural language processing, databases, and similar chores. Interactive curricula may have subtasks for which Prolog is` the tool to use. ‘ Such employments are often implemented in other languages, and Prolog is used as an embedded locomotive to deal with these tasks.

Prolog is very suitable for building graphical applications. Its potent meta-programming abilities allow for clear and concise affirms of owners and addictions in the application. Its interactive exploitation environment allows for fast prototyping while the application is running, and its automated data and memory conduct stir growth fast and reliable.

The two most essential handicaps of Prolog, accelerated and relatively large footprint and startup period of very small employments do not matter for interactive works!

The dynamic object system of XPCE provides the ideal platform. It guarantees an acceptable level of stability at the data level to allow for interactive occurrence countless Prolog consumers like so much. It provides an object-oriented program exploiting a natural syntax from Prolog, which is very suitable for implementing massive GUIs. The close-fisted amalgamation ensures good execution, and finally, generalization over the native Window-system API accommodates employments that are fully portable between UNIX and PCs.

Why is Prolog not popular?

Because there isn’t much demand for Prolog in and of itself. By this, I symbolize, as two examples, 

nobody in their right mind would try to create a website that has brought about Prolog. The Prolog was used to some degree as a rules engine for things like decisions in giving. We exploited it in our mortgage stage about 20 years ago to decide what mortgage products, interest rates, extents, etc., we are to be able to offer to a borrower. These daylights are other convention engines, like Drools and Jess, that are more popular – probably because they are easier for most makes to work with.

 Prolog is not a favorite because it’s not a systems programming language, and most “real-world” program work involves developing an entire method. Dev teams, especially small-scale ones, like to use a single language to create the whole system rather than code different parts in different languages, so specialist languages like Prolog never look in. Anything that can be done in Prolog can also be done in the likes of C, C ++, C #, Java, etc., and even if it’s initially a little more work to do it that way, it will be easier to integrate that part with the complete structure, and it may, in the end, prove overall more efficient.

The core question may be the concept of a programming “usage” itself — by having a single “language”, we don’t build change with numerous subsystems in mind.

Prolog’s shortfall of vogue is due in part to its unusual syntax, which absences the built-in imperative ascendancy formations that most programmers are familiar with. I am trying to solve this problem by writing an interpreter in Prolog that implements these features.

Prolog programming examples

Prolog means Programming in logic in English. Unlike the almost omnipotent C language or Python language, Prolog is not a universal language. For example, it cannot write a 3D game engine. It is unique programming based on the theoretical foundation of logic. Language. It is not omnipotent, but it is still a language worth learning. It is also widely used in artificial intelligence research. It can be used to build expert systems, natural language understanding, intelligent knowledge bases, etc.

If you have some basic logic knowledge, it will be very convenient to use Prolog to solve some logical reasoning problems. It can develop such programs faster than other languages. Because its programming method is more like using logical language to describe the issue, rather than writing a program, Prolog’s program and data are highly unified, and it is difficult to distinguish which are programs and which are data. Everything in Prolog has the same form, which means that data is a program, and a program is data. This is not a way of thinking at all with our common programming languages. The prolog program does not even have a specific running sequence, and the computer determines its running series.

Enter the world of Prolog

We choose an implementation of Prolog called SWI Prolog. It can be installed under Linux, Mac, and Windows. On the download page, the installation is straightforward. I won’t introduce it here. SWI Prolog also supports programming in Chinese. Let’s take a look at what logic programming is. Prolog is as simple as the following three basic sentences.

1. Facts

Facts are used to illustrate the relationship between known objects or the definition of objects. In Prolog programs, points consist of the name of a predicate and one or more objects enclosed in parentheses. The user can define predicates and objects.

Programming examples

Prolog ever accomplishes depth-first-search, Matches information& settles( i.e., knowledge base) in a top-down manner, and resolves the goals or sub-goals left-to-right manner. The most important thing to keep in mind while writing a prolog curriculum – “order of writing actualities& settles always matters”.

Prolog tutorial

If you read through this tutorial, you still don’t know what programming is all about. That’s okay; at least you tried it. You can say that you have tried your best, but the results are not good, but at least you have tried. This is also something you are proud of.

Why learn Prolog

When I found Prolog in the university curriculum, I was shocked. I was thinking: Why should I learn Prolog? I can use Java, C++, and PHP to program. These languages ​​are powerful enough to realize almost any function, and there are many, many written function libraries for you to use. Why should I learn Prolog?

When I started to learn Prolog, I found that the grammar of this language was peculiar. Unlike ordinary programming languages, Prolog’s programs are based on the theory of predicate logic. The most basic way of writing is to establish the relationship between the object and the object. Then you can query the relationship between various things by asking the target. The system will automatically match and backtrack to find out the answer to the question. But when I understood Prolog, I discovered that it is precise because of the characteristics of Prolog that it is mighty.

Uses of Prolog

At present, Prolog is mainly used in the research field of artificial intelligence and computer language. Prolog and LISP are the two primary tools for studying artificial intelligence algorithms. An interesting phenomenon is that in the United States, researchers like to use LISP, and in Europe, researchers are more inclined to use Prolog for development. There is no difference between the good and the bad of these two languages. It is just personal preference. A LISP parser can be implemented very easily under Prolog. Similarly, a Prolog parser can also be easily implemented under LISP. In the following chapters, Taipei Small Code Farmer and I will teach you how to do it.

Luis Gillman
Luis Gillman

Hi, I Am Luis Gillman CA (SA), ACMA
I am a Chartered Accountant (SA) and CIMA (SA) and author of Due Diligence: A strategic and Financial Approach.

The book was published by Lexis Nexis on 2001. In 2010, I wrote the second edition. Much of this website is derived from these two books.

In addition I have published an article entitled the Link Between Due Diligence and Valautions.

Disclaimer: Whilst every effort has been made to ensure that the information published on this website is accurate, the author and owners of this website take no responsibility  for any loss or damage suffered as a result of relience upon the information contained therein.  Furthermore the bulk of the information is derived from information in 2018 and use therefore is at your on risk. In addition you should consult professional advice if required.