scholarly journals The Meaning of Logical Programs

1980 ◽  
Vol 9 (126) ◽  
Author(s):  
Brian H. Mayoh

The semantics of a programming language are given by a function M from Programs to Meanings. In this paper we bring some uniformity into the definition of logical programming languages like LUCID and PROLOG by specifying M in Logic -> (Control -> Meanings). We describe how a context-free grammar can be assigned to each logical program and we identify Control with the language generated by the grammar. After this reduction there is no difference between the semantics of logical and conventional programming languages.

Author(s):  
Muhammad Shumail Naveed ◽  
Muhammad Sarim ◽  
Kamran Ahsan

Programming is the core of computer science and due to this momentousness a special care is taken in designing the curriculum of programming courses. A substantial work has been conducted on the definition of programming courses, yet the introductory programming courses are still facing high attrition, low retention and lack of motivation. This paper introduced a tiny pre-programming language called LPL (Learners Programming Language) as a ZPL (Zeroth Programming Language) to illuminate novice students about elementary concepts of introductory programming before introducing the first imperative programming course. The overall objective and design philosophy of LPL is based on a hypothesis that the soft introduction of a simple and paradigm specific textual programming can increase the motivation level of novice students and reduce the congenital complexities and hardness of the first programming course and eventually improve the retention rate and may be fruitful in reducing the dropout/failure level. LPL also generates the equivalent high level programs from user source program and eventually very fruitful in understanding the syntax of introductory programming languages. To overcome the inherent complexities of unusual and rigid syntax of introductory programming languages, the LPL provide elementary programming concepts in the form of algorithmic and plain natural language based computational statements. The initial results obtained after the introduction of LPL are very encouraging in motivating novice students and improving the retention rate.


2019 ◽  
Author(s):  
Nick Papoulias

Background. Context-free grammars (CFGs) and Parsing-expression Grammars (PEGs) are the two main formalisms used by formal specifications and parsing frameworks to describe programming languages. They mainly differ in the definition of the choice operator, describing language alternatives. CFGs support the use of non-deterministic choice (i.e., unordered choice), where all alternatives are equally explored. PEGs support a deterministic choice (i.e., ordered choice), where alternatives are explored in strict succession. In practice the two formalisms, are used through concrete classes of parsing algorithms (such as Left-to-right, rightmost derivation (LR) for CFGs and Packrat parsing for PEGs), that follow the semantics of the formal operators. Problem Statement. Neither the two formalisms, nor the accompanying algorithms are sufficient for a complete description of common cases arising in language design. In order to properly handle ambiguity, recursion, precedence or associativity, parsing frameworks either introduce implementation specific directives or ask users to refactor their grammars to fit the needs of the framework/algorithm/formalism combo. This introduces significant complexity even in simple cases and results in incompatible grammar specifications. Our Proposal. We introduce Multi-Ordered Grammars (MOGs) as an alternative to the CFG and PEG formalisms. MOGs aim for a better exploration of ambiguity, ordering, recursion and associativity during language design. This is achieved by (a) allowing both deterministic and non-deterministic choices to co-exist, and (b) introducing a form of recursive and scoped ordering. The formalism is accompanied by a new parsing algorithm (Gray) that extends chart parsing (normally used for Natural Language Processing) with the proposed MOG operators. Results. We conduct two case-studies to assess the expressiveness of MOGs, compared to CFGs and PEGs. The first consists of two idealized examples from literature (an expression grammar and a simple procedural language). The second examines a real-world case (the entire Smalltalk grammar and eleven new Smalltalk extensions) probing the complexities of practical needs. We show that in comparison, MOGs are able to reduce complexity and naturally express language constructs, without resorting to implementation specific directives. Conclusion. We conclude that combining deterministic and non-deterministic choices in a single grammar specification is indeed not only possible but also beneficial. Moreover, augmented by operators for recursive and scoped ordering the resulting multi-ordered formalism presents a viable alternative to both CFGs and PEGs. Concrete implementations of MOGs can be constructed by extending chart parsing with MOG operators for recursive and scoped ordering.


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.


2021 ◽  
Author(s):  
María J. Blas ◽  
Clarisa Espertino ◽  
Silvio Gonnet

The Routed DEVS (RDEVS) formalism provides a reasonable formalization for the simulation of routing processes. In this paper, we introduce a context-free grammar for the definition of routing processes as a particular case of a constrained network model. Such grammar is based on a metamodel that defines the semantics over the syntactical elements. This metamodel allows a direct mapping between its concepts and RDEVS simulation models. A Java implementation is provided for the grammar as a plug-in for Eclipse IDE. The main benefit of this software tool is the feasibility of getting a simulation model without having programming skills.


2019 ◽  
Author(s):  
Nick Papoulias

Background. Context-free grammars (CFGs) and Parsing-expression Grammars (PEGs) are the two main formalisms used by formal specifications and parsing frameworks to describe programming languages. They mainly differ in the definition of the choice operator, describing language alternatives. CFGs support the use of non-deterministic choice (i.e., unordered choice), where all alternatives are equally explored. PEGs support a deterministic choice (i.e., ordered choice), where alternatives are explored in strict succession. In practice the two formalisms, are used through concrete classes of parsing algorithms (such as Left-to-right, rightmost derivation (LR) for CFGs and Packrat parsing for PEGs), that follow the semantics of the formal operators. Problem Statement. Neither the two formalisms, nor the accompanying algorithms are sufficient for a complete description of common cases arising in language design. In order to properly handle ambiguity, recursion, precedence or associativity, parsing frameworks either introduce implementation specific directives or ask users to refactor their grammars to fit the needs of the framework/algorithm/formalism combo. This introduces significant complexity even in simple cases and results in incompatible grammar specifications. Our Proposal. We introduce Multi-Ordered Grammars (MOGs) as an alternative to the CFG and PEG formalisms. MOGs aim for a better exploration of ambiguity, ordering, recursion and associativity during language design. This is achieved by (a) allowing both deterministic and non-deterministic choices to co-exist, and (b) introducing a form of recursive and scoped ordering. The formalism is accompanied by a new parsing algorithm (Gray) that extends chart parsing (normally used for Natural Language Processing) with the proposed MOG operators. Results. We conduct two case-studies to assess the expressiveness of MOGs, compared to CFGs and PEGs. The first consists of two idealized examples from literature (an expression grammar and a simple procedural language). The second examines a real-world case (the entire Smalltalk grammar and eleven new Smalltalk extensions) probing the complexities of practical needs. We show that in comparison, MOGs are able to reduce complexity and naturally express language constructs, without resorting to implementation specific directives. Conclusion. We conclude that combining deterministic and non-deterministic choices in a single gram- mar specification is indeed not only possible but also beneficial. Moreover, augmented by operators for recursive and scoped ordering the resulting multi-ordered formalism presents a viable alternative to both CFGs and PEGs. Concrete implementations of MOGs can be constructed by extending chart parsing with MOG operators for recursive and scoped ordering.


Author(s):  
Prof. Shilpa Shitole ◽  
Rohit Maurya ◽  
Tanaya Pawar ◽  
Siya Randhe

Industries evolve. Our thinking changes as well. Programming languages need evolvement too. “The thing is that ideas for new features with its ways of thinking will be flourished, and so perfectly designed those languages won’t be perfect anymore.” Where did logical programming go? “Notice that you can use this paradigm and just provide a set of constraints for a website and expect the website to develop automatically based on them.” It is possible to implement that. Likewise, new paradigms will sooner or later be born. It can’t be that we’ve explored everything. “Technologies are born likewise the old way of thinking, which represents by the previous programming languages might not be adequate. This project is an open-source modern object-oriented programming language that aims to bridge the gap between modern expressive programming paradigms like python and strictly typed rigid languages like Java and C#. Our goal is to provide the usefulness of an object-oriented programming language while holding the simplicity of an expressive programming language without having to sacrifice performance.


1982 ◽  
Vol 11 (155) ◽  
Author(s):  
Bent Bruun Kristensen ◽  
Ole Lehrmann Madsen ◽  
Birger Møller-Pedersen ◽  
Kristen Nygaard

<p>The intent of this paper is to illustrate the following general ideas:</p><p>-- Use of the context free grammar of a programming language as an integrated part of its programming system.</p><p>-- Reconsideration of the border line between language and system.</p><p>-- Systematic modularization of programs for the various translation phases.</p><p>The specific ideas presented in this paper are language independent methods for handling:</p><p>-- Modularization of programs.</p><p>-- Separate translation in the form of context sensitive parsing (type checking) of modules.</p><p>-- Protection of part of a module, e.g. protection of the representation of an abstract data type.</p><p>The mechanism for modularization is unusual as it is based on the context-free syntax of the language. A module may be a sentential form generated by any nonterminal of the grammar.</p>


Author(s):  
Valeri Pougatchev

The innovative and effective solutions for the strategic and operational planning management of organizations are discussed. The author reviews current and past challenges of the strategic and operational planning and describes two novel solutions with practical implementation for improving these processes. The first one is a numerical indicator V-index that represents the level of accomplishment of operational plans of the entire organization, its units, and members of staff. The V-index serves operational plans with hierarchical and non-hierarchical structures. The second solution is a novel context-free grammar operational planning language for a formal definition of the planning process. All examples and case-study presentation are based on fragments of the faculty/departments/programs of some fictional educational institution (university).


2020 ◽  
Vol 7 (2) ◽  
pp. 42-48
Author(s):  
VLADIMIR KISHKAN ◽  
◽  
KONSTANTIN SAFONOV ◽  

When developing promising programming languages designed to support the work of supercomputers, including quantum ones, there is a need for research related to testing the developed language under conditions when parsers do not yet exist for it. In particular, in the process of developing a programming language for a quantum computer, it becomes necessary to parse a certain program written in a new programming language, which, like all programming languages, belongs to the class of context-free languages (cf-languages). The problem of syntactical analysis of the monomials of cf-languages was posed in the 50-60s of the last century, however, there are some discrepancies in its formulation, and therefore there is a need to clarify the formulation of this problem. In this regard, we will call the expanded problem of parsing the problem of developing a stupid (non-stop, irrevocable) algorithm that allows establishing whether a given monomial can be deduced using a system of products that form a cf-language grammar, and also find all the conclusions of this monomial at once if the latter exists. The description of the monomial inference is understood as follows: it is necessary to determine for which products from the grammar of the cf-language, how many times and in what order they are used to derive this monomial, which is equivalent to constructing all the output trees. The article has developed a deadlockless algorithm for solving the extended problem of parsing, based on the method of hierarchy of marked brackets. The marked brackets order shows what products they are assigned to, and allows you to trace the order of its use. The algorithm uses the method of successive approximations to solve the Chomsky-Schützenberger system of equations associated with the cf-language grammar. The developed algorithm has a simple software implementation; an assessment of the complexity of the algorithm is also given.


2020 ◽  
Vol 11 (1) ◽  
pp. 2-11
Author(s):  
William Steingartner

AbstractIn this work we discuss the motivation for innovations and need of a teaching tool for the visualization of the natural semantics method of imperative programming languages. We present the rôle of the teaching software, its design, development and use in the teaching process. Our software module is able to visualize the natural semantics evaluation of programs. It serves as a compiler with environment that can visually interpret simple programming language Jane statements and to depict them into a derivation tree that represents the semantic method of natural semantics. A formal definition of programming language Jane used in the teaching of formal semantics and production rules in natural semantics for that language are shown as well. We present, how the presented teaching tool can provide particular visual steps in the process of finding the meaning of well-structured input program and to depict complete natural-semantic representation of an input program.


Sign in / Sign up

Export Citation Format

Share Document