scholarly journals Theoretical foundations of the organization of branches and repetitions in programs in the logic programming language Prolog

2021 ◽  
Vol 21 (2) ◽  
pp. 200-206
Author(s):  
D. V. Zdor

Introduction. The organization of branches and repetitions in the context of logical programming is considered by an example of the Prolog language. The fundamental feature of the program in a logical programming language is the fact that a computer must solve a problem by reasoning like a human. Such a program contains a description of objects and relations between them in the language of mathematical logic. At the same time, the software implementation of branching and repetition remains a challenge in the absence of special operators for the indicated constructions in the logical language. The objectives of the study are to identify the most effective ways to solve problems using branching and repetition by means of the logic programming language Prolog, as well as to demonstrate the results obtained by examples of computational problems.  Materials and Methods. An analysis of the literature on the subject of the study was carried out. Methods of generalization and systematization of knowledge, of the program testing, and analysis of the program execution were used.  Results. Constructions of branching and repetition organization in a Prolog program are proposed. To organize repetitions, various options for completing a recursive cycle when solving problems are given.  Discussion and Conclusions. The methods of organizing branches and repetitions in the logic programming language Prolog are considered. All these methods are illustrated by examples of solving computational problems. The results obtained can be used in the further development of the recursive predicates in logical programming languages, as well as in the educational process when studying logical programming in the Prolog language. The examples of programs given in the paper provide using them as a technological basis for programming branches and repetitions in the logic programming language Prolog.

2019 ◽  
Vol 20 (1) ◽  
pp. 147-175 ◽  
Author(s):  
SANDRA DYLUS ◽  
JAN CHRISTIANSEN ◽  
FINN TEEGEN

AbstractThis paper presentsPFLP, a library for probabilistic programming in the functional logic programming language Curry. It demonstrates how the concepts of a functional logic programming language support the implementation of a library for probabilistic programming. In fact, the paradigms of functional logic and probabilistic programming are closely connected. That is, language characteristics from one area exist in the other and vice versa. For example, the concepts of non-deterministic choice and call-time choice as known from functional logic programming are related to and coincide with stochastic memoization and probabilistic choice in probabilistic programming, respectively. We will further see that an implementation based on the concepts of functional logic programming can have benefits with respect to performance compared to a standard list-based implementation and can even compete with full-blown probabilistic programming languages, which we illustrate by several benchmarks.


2014 ◽  
Vol 14 (4-5) ◽  
pp. 493-507 ◽  
Author(s):  
FLAVIO CRUZ ◽  
RICARDO ROCHA ◽  
SETH COPEN GOLDSTEIN ◽  
FRANK PFENNING

AbstractWe have designed a new logic programming language called LM (Linear Meld) for programming graph-based algorithms in a declarative fashion. Our language is based on linear logic, an expressive logical system where logical facts can be consumed. Because LM integrates both classical and linear logic, LM tends to be more expressive than other logic programming languages. LM programs are naturally concurrent because facts are partitioned by nodes of a graph data structure. Computation is performed at the node level while communication happens between connected nodes. In this paper, we present the syntax and operational semantics of our language and illustrate its use through a number of examples.


Mathematics ◽  
2021 ◽  
Vol 10 (1) ◽  
pp. 113
Author(s):  
Sergey Goncharov ◽  
Andrey Nechesov

The problems associated with the construction of polynomial complexity computer programs require new techniques and approaches from mathematicians. One of such approaches is representing some class of polynomial algorithms as a certain class of special logical programs. Goncharov and Sviridenko described a logical programming language L0, where programs inductively are obtained from the set of Δ0-formulas using special terms. In their work, a new idea has been proposed to look at the term as a program. The computational complexity of such programs is polynomial. In the same years, a number of other logical languages with similar properties were created. However, the following question remained: can all polynomial algorithms be described in these languages? It is a long-standing problem, and the method of describing some polynomial algorithm in a not Turing complete logical programming language was not previously clear. In this paper, special types of terms and formulas have been found and added to solve this problem. One of the main contributions is the construction of p-iterative terms that simulate the work of the Turing machine. Using p-iterative terms, the work showed that class P is equal to class L, which extends the programming language L0 with p-iterative terms. Thus, it is shown that L is quite expressive and has no halting problem, which occurs in high-level programming languages. For these reasons, the logical language L can be used to create fast and reliable programs. The main limitation of the language L is that the implementation of algorithms of complexity is not higher than polynomial.


2003 ◽  
Vol 10 (25) ◽  
Author(s):  
Dariusz Biernacki ◽  
Olivier Danvy

Starting from a continuation-based interpreter for a simple logic programming language, propositional Prolog with cut, we derive the corresponding logic engine in the form of an abstract machine. The derivation originates in previous work (our article at PPDP 2003) where it was applied to the lambda-calculus. The key transformation here is Reynolds's defunctionalization that transforms a tail-recursive, continuation-passing interpreter into a transition system, i.e., an abstract machine. Similar denotational and operational semantics were studied by de Bruin and de Vink in previous work (their article at TAPSOFT 1989), and we compare their study with our derivation. Additionally, we present a direct-style interpreter of propositional Prolog expressed with control operators for delimited continuations.<br /><br />Superseded by BRICS-RS-04-5.


Sign in / Sign up

Export Citation Format

Share Document