Concurrent constraint programming languages
暂无分享,去创建一个
This thesis develops the framework of concurrent constraint programming. In this paradigm, concurrently executing agents interact by placing, checking and instantiating constraints on shared variables that range over some (usually implicit) domain of discourse. Constraints are partial specifications of possibly infinite sets of values, and the agents may either collaborate or compete in placing constraints. The major form of concurrency control in the system is through the notion of Atomic Tell--an agent may (instantaneously) place constraints only if they are consistent with constraints that have already been placed--and Blocking Ask--an agent must block when it checks a relationship that is not yet known to hold. My thesis is that this paradigm is an elegant, rich, real and semantically tractable framework for concurrent computation.
The paradigm is based on the idea of "constraint logic programming" and is a far-reaching generalization of research in concurrent logic programming languages. I instantiate the ideas of concurrent constraint programming by developing the cc family of programming languages, closely related to CCS, which provide an algebra of behaviors closed under prefixing, products, two forms of choices, a form of hiding and (mutual) recursion. Of these, don't-know choice is particularly novel in concurrent languages: it allows the specification of generators, that is, agents capable of exploring alternative contexts in parallel, and succeeding if any one succeeds. I also examine a number of constraint systems which may be used to instantiate the cc family of languages. In particular, I look at various constraint systems based on the algebra of trees to obtain the functionality of lists, records, arrays etc. in a very rich setting.
With the presence of control constructs, it is no longer possible to prove a straight-forward model-theoretic semantics for the programming language. Instead, I define the operational semantics of some of the cc languages via Plotkin-style transition systems. The semantics is developed in a step-wise manner from the semantics of simpler languages, obtained by considering only some of the control constructs.
To provide a concrete realization of these ideas on a sequential machine, I present a compiler for a (superset of) Atomic Herbrand, a cc language over the Herbrand constraint system. To demonstrate the interestingness of this approach to concurrency, I present a number of constraint-based concurrent programming techniques, for such problems as mutual and single exclusion, repeated many-client many-server communication, bidirectional communication using a single variable, and recursive doubling.