Syntax and operational semantics of a probabilistic programming language with scopes

Dzhafarov and Kujala (2015) have introduced a contextual probability theory called Contextuality-by-Default (C-b-D) which is based on three principles. The first of these principles states that each random variable should be automatically labelled by all conditions under which it is recorded. The aim of this article is to relate this principle to block structured computer programming languages where variables are declared local to a construct called a “scope”. Scopes are syntactic constructs which correspond to the notion of condition used by C-b-D. In this way a variable declared in two scopes can be safely overloaded meaning that they can have the same label but preserve two distinct identities without the need to label each variable in each condition as advocated by C-b-D. By means of examples, the notion of a probabilistic program, or P-program, is introduced which is based on scopes. The semantics of P-programs will be illustrated using the well known relational database language SQL which provides an efficient and understandable operational semantics. A core issue addressed is how to construct a single probabilistic model from the various interim probability distributions returned by each syntactic scope. For this purpose, a probabilistic variant of the natural join operator of relational algebra is used to “glue” together interim distributions into a single distribution. More generally, this article attempts to connect contextuality with probabilistic programming by means of relational database theory.

[1]  Kerrie Mengersen,et al.  Modeling the viability of the free-ranging cheetah population in Namibia : an object-oriented Bayesian network approach , 2013 .

[2]  N. N. Vorob’ev Consistent Families of Measures and Their Extensions , 1962 .

[3]  Samson Abramsky,et al.  Domain theory , 1995, LICS 1995.

[4]  Rui Soares Barbosa On monogamy of non-locality and macroscopic averages: examples and preliminary results , 2014, QPL.

[5]  S. K. Michael Wong The Relational Structure of Belief Networks , 2004, Journal of Intelligent Information Systems.

[6]  Weiyi Liu,et al.  Constructing the Bayesian network structure from dependencies implied in multiple relational schemas , 2011, Expert Syst. Appl..

[7]  S. K. Michael Wong,et al.  An Extended Relational Data Model For Probabilistic Reasoning , 1997, Journal of Intelligent Information Systems.

[8]  Peter Bruza,et al.  Perceptions of document relevance , 2014, Front. Psychol..

[9]  Samson Abramsky,et al.  Contextual Semantics: From Quantum Mechanics to Logic, Databases, Constraints, and Complexity , 2014, Bull. EATCS.

[10]  Thomas A. Henzinger,et al.  Probabilistic programming , 2014, FOSE.

[11]  Ehtibar N. Dzhafarov,et al.  Selectivity in Probabilistic Causality: Where Psychology Runs Into Quantum Physics , 2011, 1110.2388.

[12]  Jan-AAke Larsson,et al.  Contextuality in Three Types of Quantum-Mechanical Systems , 2014, 1411.2244.

[13]  Marc Gyssens,et al.  A Decomposition Methodology for Cyclic Databases , 1982, Advances in Data Base Theory.

[14]  Ehtibar N. Dzhafarov,et al.  Probabilistic Contextuality in EPR/Bohm-type Systems with Signaling Allowed , 2014, 1406.0243.

[15]  Samson Abramsky,et al.  The sheaf-theoretic structure of non-locality and contextuality , 2011, 1102.0264.