Digital Themes

Logic Programming

Logic programming is a programming paradigm that is based on logic. This means that a logic programming language has sentences that follow logic, so that they express facts and rules. Computation using logic programming is done by making logical inferences based on all available data. In order for computer programs to make use of logic programming, there must be a base of existing logic, called predicates. Predicates are used to build atomic formulas or atoms, which state true facts. Predicates and atoms are used to create formulas and perform queries. Logic languages most often rely on queries in order to display relevant data. These queries can exist as part of machine learning, which can be run without the need for manual intervention.

There are multiple different logic programming languages. The most common language, Prolog (from the French programmation en logique, or programming in logic), can also interface with other programming languages such as Java and C. On top of being the most popular logic programming language, Prolog was also one of the first such languages, with the first prolog program created in the 1970s for use with interpretations. Prolog was developed using first-order logic, also called predicate logic, which allows for the use of variables rather than propositions. Prolog utilizes artificial intelligence (AI) to help form its conclusions and can quickly process large amounts of data. Prolog can be run with or without manual inputs, meaning in it can be programmed to run automatically as part of data processing.

Logic programming, and especially Prolog, can help businesses and organizations through:

  • Natural language processing: Natural language processing (NLP) allows for better interactions between humans and computers. NLP can listen to human language in real time, and then processes and translate it for computers. This allows technology to “understand” natural language. However, NLP is not limited just to spoken language. Instead, NLP can also be utilized to read and understand documentation, both in physical print or from word processing programs. NLP is used by technologies such as Amazon Alexa and Google Home to process and understand spoken instructions, as well as by email applications to filter spam emails and warn of phishing attempts.

  • Database management: Logic programming can be used for the creation, maintenance, and querying of NoSQL databases. Logic programming can create databases out of big data. The programming can identify which information has been programmed as relevant, and store it in the appropriate area. Users can then query these databases with specific questions, such as “What’s the best route to get to New York,” and logic languages can quickly sift through all of the data, run analyses, and return the relevant result with no additional work required by the user.

  • Predictive analysis: With large data sets, logic languages can search for inconsistencies or areas of differentiation in order to make predictions. This can be useful in identifying potentially dangerous activities (such as going for a bike ride in the middle of a thunderstorm) or for predicting failures of industrial machines. It can also be used to analyze photos and make predictions around the images, such as predicting the identity of objects in satellite photos, or recognizing the patterns that differentiate craters from regular land masses.
Related content