Dynamic symbolic computation for domain-specific language implementation

Abstract

A domain-specific language (DSL) is a specification language designed to facilitate programming in a certain application domain. A well-designed DSL reflects the natural structure of the modeled domain, enforces abstraction, and its implementation exploits domain-specific properties for safety and performance. Expounding on the latter, in this paper we describe a simple, but powerful method for gradually enhancing a base implementation with computational performance improvements. It consists of adding constructors for expensive operations if this facilitates asymptotic performance improvements in some contexts, with at most constant-factor overhead. The resulting implementation can be thought of as executing "standard" computation steps from the base implementation interleaved with symbolic computation steps on the newly introduced constructors. Evaluation of constructor expressions is lazy in a strong sense: It does not only delay evaluation by thunkifying its standard evaluation, but performs run-time inspection to evaluate constructor expressions in a nonstandard way. Extending earlier work by Henglein and Larsen [1] on generic multiset programming we arrive at novel multiset representations with constructors for unions, Cartesian products, scalar multiplication, and mapping binary functions over Cartesian products. We show how the resulting implementation can be used to implement finite probability distributions with exact (rational) probabilities. It supports computing both the expected value and, what we believe to be novel, the variance of random variables over n-ary product distributions efficiently by avoiding enumeration of the product sample space.

OriginalsprogEngelsk
TitelLogic-Based Program Synthesis and Transformation : 21st International Symposium, LOPSTR 2011, Odense, Denmark, July 18-20, 2011. Revised Selected Papers
RedaktørerGermán Vidal
Antal sider21
ForlagSpringer
Publikationsdato2012
Sider4-24
ISBN (Trykt)978-3-642-32210-5
ISBN (Elektronisk)978-3-642-32211-2
DOI
StatusUdgivet - 2012
Begivenhed21st International Symposium on Logic-Based Program Synthesis and Transformation - Odense, Danmark
Varighed: 18 jul. 201120 jul. 2011
Konferencens nummer: 21

Konference

Konference21st International Symposium on Logic-Based Program Synthesis and Transformation
Nummer21
Land/OmrådeDanmark
ByOdense
Periode18/07/201120/07/2011
NavnLecture notes in computer science
Vol/bind7225
ISSN0302-9743

Fingeraftryk

Dyk ned i forskningsemnerne om 'Dynamic symbolic computation for domain-specific language implementation'. Sammen danner de et unikt fingeraftryk.

Citationsformater