Alma-0

Last updated

Alma-0
Paradigm multi-paradigm: constraint, imperative, logic
Family Wirth Modula
Designed by Krzysztof Apt, Marc Bezem, Jacob Brunekree, Vincent Partington, Andrea Schaerf
Developer Centrum Wiskunde & Informatica
First appeared1997;26 years ago (1997)
Typing discipline static
Scope Lexical (static)
Website www.cwi.nl/en/alma
Major implementations
Alma-0
Influenced by
Modula-2

Alma-0 is a multi-paradigm computer programming language. This language is an augmented version of the imperative Modula-2 language with logic-programming features and convenient backtracking ability. [1] It is small, strongly typed, and combines constraint programming, a limited number of features inspired by logic programming and supports imperative paradigms. The language advocates declarative programming. The designers claim that search-oriented solutions built with it are substantially simpler than their counterparts written in purely imperative or logic programming style. [2] Alma-0 provides natural, high-level constructs for building search trees. [3]

Contents

Overview

Since the designers of Alma-0 wanted to create a distinct and substantially simpler proposal than prior attempts to integrate declarative programming constructs (such as automatic backtracking) into imperative programming, the design of Alma-0 was guided by four principles:

Alma-0 can be viewed not only as a specific and concrete programming language proposal, but also as an example of a generic method for extending any imperative programming language with features that support declarative programming.

The feasibility of the Alma-0 approach has been demonstrated through a full implementation of the language (including a description of its semantics) for a subset of Modula-2. [4]

Features

The implemented features in Alma-0 include:

Imperative and logic programming modes

The Alma-0 designers claim that the assignment, which is usually shunned in pure declarative and logic programming, is actually needed in a number of natural situations, including for counting and recording purposes. They also affirm that the means of expression of such "natural" uses of assignment within the logic programming paradigm are unnatural.

Related Research Articles

In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that map values to other values, rather than a sequence of imperative statements which update the running state of the program.

Logic programming is a programming paradigm which is largely based on formal logic. Any program written in a logic programming language is a set of sentences in logical form, expressing facts and rules about some problem domain. Major logic programming language families include Prolog, answer set programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:

Prolog is a logic programming language associated with artificial intelligence and computational linguistics.

Procedural programming is a programming paradigm, derived from imperative programming, based on the concept of the procedure call. Procedures simply contain a series of computational steps to be carried out. Any given procedure might be called at any point during a program's execution, including by other procedures or itself. The first major procedural programming languages appeared circa 1957–1964, including Fortran, ALGOL, COBOL, PL/I and BASIC. Pascal and C were published circa 1970–1972.

Programming paradigms are a way to classify programming languages based on their features. Languages can be classified into multiple paradigms.

Constraint programming (CP) is a paradigm for solving combinatorial problems that draws on a wide range of techniques from artificial intelligence, computer science, and operations research. In constraint programming, users declaratively state the constraints on the feasible solutions for a set of decision variables. Constraints differ from the common primitives of imperative programming languages in that they do not specify a step or sequence of steps to execute, but rather the properties of a solution to be found. In addition to constraints, users also need to specify a method to solve these constraints. This typically draws upon standard methods like chronological backtracking and constraint propagation, but may use customized code like a problem-specific branching heuristic.

In computer science, declarative programming is a programming paradigm—a style of building the structure and elements of computer programs—that expresses the logic of a computation without describing its control flow.

Programming languages can be grouped by the number and types of paradigms supported.

Backtracking is a class of algorithms for finding solutions to some computational problems, notably constraint satisfaction problems, that incrementally builds candidates to the solutions, and abandons a candidate ("backtracks") as soon as it determines that the candidate cannot possibly be completed to a valid solution.

Oz is a multiparadigm programming language, developed in the Programming Systems Lab at Université catholique de Louvain, for programming language education. It has a canonical textbook: Concepts, Techniques, and Models of Computer Programming.

In artificial intelligence and operations research, constraint satisfaction is the process of finding a solution through a set of constraints that impose conditions that the variables must satisfy. A solution is therefore a set of values for the variables that satisfies all constraints—that is, a point in the feasible region.

Constraint Handling Rules (CHR) is a declarative, rule-based programming language, introduced in 1991 by Thom Frühwirth at the time with European Computer-Industry Research Centre (ECRC) in Munich, Germany. Originally intended for constraint programming, CHR finds applications in grammar induction, type systems, abductive reasoning, multi-agent systems, natural language processing, compilation, scheduling, spatial-temporal reasoning, testing, and verification.

Answer set programming (ASP) is a form of declarative programming oriented towards difficult search problems. It is based on the stable model semantics of logic programming. In ASP, search problems are reduced to computing stable models, and answer set solvers—programs for generating stable models—are used to perform search. The computational process employed in the design of many answer set solvers is an enhancement of the DPLL algorithm and, in principle, it always terminates.

ECLiPSe is a software system for the development and deployment of Constraint Programming applications, e.g. in the areas of optimization, planning, scheduling, resource allocation, timetabling, transport etc. It is also suited for teaching most aspects of combinatorial problem solving, e.g. problem modeling, constraint programming, mathematical programming, and search techniques. It contains constraint solver libraries, a high-level modeling and control language, interfaces to third-party solvers, an integrated development environment and interfaces for embedding into host environments.

Constraint logic programming is a form of constraint programming, in which logic programming is extended to include concepts from constraint satisfaction. A constraint logic program is a logic program that contains constraints in the body of clauses. An example of a clause including a constraint is A(X,Y):-X+Y>0,B(X),C(Y). In this clause, X+Y>0 is a constraint; A(X,Y), B(X), and C(Y) are literals as in regular logic programming. This clause states one condition under which the statement A(X,Y) holds: X+Y is greater than zero and both B(X) and C(Y) are true.

Logtalk is an object-oriented logic programming language that extends and leverages the Prolog language with a feature set suitable for programming in the large. It provides support for encapsulation and data hiding, separation of concerns and enhanced code reuse. Logtalk uses standard Prolog syntax with the addition of a few operators and directives.

In information technology a reasoning system is a software system that generates conclusions from available knowledge using logical techniques such as deduction and induction. Reasoning systems play an important role in the implementation of artificial intelligence and knowledge-based systems.

Krzysztof R. Apt is a Polish computer scientist. He defended his PhD in mathematical logic in Warsaw, Poland in 1974. His research interests include program correctness and semantics, use of logic as a programming language, distributed computing, and game theory. Besides his own research, he has been heavily involved in service to the computing community, notably by promoting the use of logic in computer science and by advocating open access to scientific literature.

Logic programming is a programming paradigm that includes languages based on formal logic, including Datalog and Prolog. This article describes the syntax and semantics of the purely declarative subset of these languages. Confusingly, the name "logic programming" also refers to a specific programming language that roughly corresponds to the declarative subset of Prolog. Unfortunately, the term must be used in both senses in this article.

References

  1. Liu, Jed; Myers, Andrew C. (2003). "JMatch: Iterable Abstract Pattern Matching for Java". Practical Aspects of Declarative Languages. Lecture Notes in Computer Science. Vol. 2562/2003. pp. 110–127. doi:10.1007/3-540-36388-2_9. ISBN   978-3-540-00389-2.
  2. Partington, Vincent (July 1997). Implementation of an Imperative Programming Language with Backtracking (PDF) (Report). University of Amsterdam Programming, Research Group. Retrieved 15 February 2021. Also in Postscript.
  3. Van Hentenryck, Pascal; Perron, Laurent; Puget, Jean-François (October 2000). "Search and strategies in OPL". ACM Transactions on Computational Logic. 1 (2): 285–320. CiteSeerX   10.1.1.17.836 . doi:10.1145/359496.359529. S2CID   15926704.
  4. Dahl, Veronica (12 February 2003). Practical Aspects of Declarative Languages: 5th International Symposium, PADL 2003, New Orleans, LA, USA, January 13-14, 2003, Proceedings. Springer Science & Business Media. ISBN   978-3-540-00389-2.