Concurrent constraint logic programming: Difference between revisions

Content deleted Content added
m Disambiguating links to Deadlock (link changed to Deadlock (computer science)) using DisamAssist.
 
(3 intermediate revisions by 3 users not shown)
Line 1:
'''Concurrent constraint logic programming''' is a version of [[constraint logic programming]] aimed primarily at programming [[concurrent process]]es rather than (or in addition to) solving [[constraint satisfaction problem]]s. Goals in constraint logic programming are evaluated concurrently; a concurrent process is therefore programmed as the evaluation of a goal by the [[Interpreter (computing)|interpreter]].
 
[[syntax (logic)|Syntactically]], concurrent constraintsconstraint logic programs are similar to non-concurrent programs, the only exception being that clauses include [[Guard (computing)|guards]], which are constraints that may block the applicability of the clause under some conditions. Semantically, concurrent constraint logic programming differs from its non-concurrent versions because a goal evaluation is intended to realize a concurrent process rather than finding a solution to a problem. Most notably, this difference affects how the interpreter behaves when more than one clause is applicable: non-concurrent constraint logic programming [[Recursion|recursively]] tries all clauses; concurrent constraint logic programming chooses only one. This is the most evident effect of an intended ''directionality'' of the interpreter, which never revise a choice it has previously taken. Other effects of this are the semantical possibility of having a goal that cannot be proved while the whole evaluation does not fail, and a particular way for equating a goal and a clause head.
 
[[Constraint handling rules]] can be seen as a form of concurrent constraint logic programming,<ref>Frühwirth, Thom. "[https://www.sciencedirect.com/science/article/pii/S0743106698100055 Theory and practice of constraint handling rules]." [[The Journal of Logic Programming]] 37.1-3 (1998): 95-138.</ref> but are used for programming a constraint simplifier or solver rather than concurrent processes.
 
==Description==
Line 20:
A second effect of the difference between the non-concurrent and the concurrent version is that concurrent constraint logic programming is specifically designed to allow processes to run without terminating. Non-terminating processes are common in general in concurrent processing; the concurrent version of constraint logic programming implements them by not using the condition of failure: if no clause is applicable for rewriting a goal, the process evaluating this goal stops instead of making the whole evaluation fail like in non-concurrent constraint logic programming. As a result, the process evaluating a goal may be stopped because no clause is available to proceed, but at the same time the other processes keep running.
Synchronization among processes that are solving different goals is achieved via the use of guards. If a goal cannot be rewritten because all clauses that could be used have a guard that is not entailed by the constraint store, the process solving this goal is blocked until the other processes add the constraints that are necessary to entail the guard of at least one of the applicable clauses. This synchronization is subject to [[Deadlock (computer science)|deadlock]]s: if all goals are blocked, no new constraints will be added and therefore no goal will ever be unblocked.
 
A third effect of the difference between concurrent and non-concurrent logic programming is in the way a goal is equated to the head of a fresh variant of a clause. Operationally, this is done by checking whether the variables in the head can be equated to terms in such a way the head is equal to the goal. This rule differs from the corresponding rule for constraint logic programming in that it only allows adding constraints in the form variable=term, where the variable is one of the head. This limitation can be seen as a form of directionality, in that the goal and the clause head are treated differently.
Line 30:
==History==
 
The study of concurrent constraint logic programming started at the end of the 1980s, when some of the principles of [[concurrent logic programming]] were integrated into constraint logic programming by [[Michael J. Maher]]. The theoretical properties of concurrent constraint logic programming were later studied by various authors, including [httpsMartin Rinard and Vijay A. Saraswat.<ref>{{Cite book |last=Saraswat |first=Vijay A. |url=http://peopledx.csaildoi.mitorg/10.edu7551/rinardmitpress/paper/popl902086.pdf001.0001 Martin|title=Concurrent RinardConstraint andProgramming Vijay|date=1993 A.|publisher=The Saraswat]MIT Press |doi=10.7551/mitpress/2086.001.0001 |isbn=978-0-262-29097-5}}</ref>
 
==See also==
Line 39:
* [[Alice (programming language)|Alice]]
 
== References ==
{{reflist}}
 
==Bibliography==
 
*{{cite book
Line 70 ⟶ 73:
}}
 
 
;Specific
<references />
 
[[Category:Constraint logic programming]]