Syntax and operational semantics of a probabilistic programming language with scopes

Bruza, Peter D. (2016) Syntax and operational semantics of a probabilistic programming language with scopes. Journal of Mathematical Psychology. (In Press)

[img] Accepted Version (PDF 709kB)
Administrators only | Request a copy from author

View at publisher


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.

Impact and interest:

1 citations in Scopus
Search Google Scholar™

Citation counts are sourced monthly from Scopus and Web of Science® citation databases.

These databases contain citations from different subsets of available publications and different time periods and thus the citation count from each is usually different. Some works are not in either database and no count is displayed. Scopus includes citations from articles published in 1996 onwards, and Web of Science® generally from 1980 onwards.

Citations counts from the Google Scholar™ indexing service can be viewed at the linked Google Scholar™ search.

ID Code: 97610
Item Type: Journal Article
Refereed: Yes
Keywords: Probabilistic programming, Probabilistic modelling, Programming language semantics, Contextuality, Contextuality-by-Default
DOI: 10.1016/
ISSN: 0022-2496
Divisions: Current > Institutes > Institute for Future Environments
Current > QUT Faculties and Divisions > Science & Engineering Faculty
Copyright Owner: Copyright 2016 Elsevier
Copyright Statement: Licensed under the Creative Commons Attribution; Non-Commercial; No-Derivatives 4.0 International. DOI: 10.1016/
Deposited On: 24 Jul 2016 23:02
Last Modified: 31 Jul 2016 04:22

Export: EndNote | Dublin Core | BibTeX

Repository Staff Only: item control page