scholarly journals Implementing a Library for Probabilistic Programming Using Non-strict Non-determinism

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.

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.


1997 ◽  
Vol 7 (2) ◽  
pp. 129-161 ◽  
Author(s):  
TETSUO IDA ◽  
KOICHI NAKAHARA

We present narrowing calculi that are computation models of functional-logic programming languages. The narrowing calculi are based on the notion of the leftmost outside-in reduction of Huet and Lévy. We note the correspondence between the narrowing and reduction derivations, and define the leftmost outside-in narrowing derivation. We then give a narrowing calculus OINC that generates the leftmost outside-in narrowing derivations. It consists of several inference rules that perform the leftmost outside-in narrowing. We prove the completeness of OINC using an ordering defined over a narrowing derivation space. To use the calculus OINC as a model of computation of functional-logic programming, we extend OINC to incorporate strict equality. The extension results in a new narrowing calculus, s-OINC. We show also that s-OINC enjoys the same completeness property as OINC.


1999 ◽  
Vol 9 (1) ◽  
pp. 33-75 ◽  
Author(s):  
MICHAEL HANUS ◽  
CHRISTIAN PREHOFER

Functional logic languages with a sound and complete operational semantics are mainly based on an inference rule called narrowing. Narrowing extends functional evaluation by goal solving capabilities, as in logic programming. Due to the huge search space of simple narrowing, steadily improved narrowing strategies have been developed in the past. Needed narrowing is currently the best narrowing strategy for first-order functional logic programs due to its optimality properties wrt the length of derivations and the number of computed solutions. In this paper, we extend the needed narrowing strategy to higher-order functions and λ-terms as data structures. By the use of definitional trees, our strategy computes only independent solutions. Thus, it is the first calculus for higher-order functional logic programming which provides for such an optimality result. Since we allow higher-order logical variables denoting λ-terms, applications go beyond current functional and logic programming languages. We show soundness and completeness of our strategy with respect to LNT reductions, a particular form of higher-order reductions defined via definitional trees. A general completeness result is only provided for terminating rewrite systems due to the lack of an overall theory of higher-order reduction which is outside the scope of this paper.


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.


2011 ◽  
Vol 21 (4-5) ◽  
pp. 413-465 ◽  
Author(s):  
SEBASTIAN FISCHER ◽  
OLEG KISELYOV ◽  
CHUNG-CHIEH SHAN

AbstractFunctional logic programming and probabilistic programming have demonstrated the broad benefits of combining laziness (nonstrict evaluation with sharing of the results) with nondeterminism. Yet these benefits are seldom enjoyed in functional programming because the existing features for nonstrictness, sharing, and nondeterminism in functional languages are tricky to combine. We present a practical way to write purely functional lazy nondeterministic programs that are efficient and perspicuous. We achieve this goal by embedding the programs into existing languages (such as Haskell, SML, and OCaml) with high-quality implementations, by making choices lazily and representing data with nondeterministic components, by working with custom monadic data types and search strategies, and by providing equational laws for the programmer to reason about their code.


Sign in / Sign up

Export Citation Format

Share Document