A typechecker plugin for units of measure: domain-specific constraint solving in GHC Haskell

Author(s):  
Adam Gundry
2019 ◽  
Vol 9 (1) ◽  
pp. 33-51
Author(s):  
Alejandro Serrano ◽  
Jurriaan Hage

Abstract Domain-specific languages (DSLs) permeate current programming practices. An important kind of DSLs includes those developed and integrated within a host language, which we call embedded or internal DSLs. Unfortunately, embedded DSLs usually fall short on domain-specific error diagnosis, that is, they do not give control to DSL authors over how errors are reported to the programmer. As a consequence, implementation details of the DSL leak through in error messages, and programmers need to understand the internals of the DSL implementation to fix their code in a productive way. This paper addresses the challenge of building a compiler with integrated support for domain-specific error diagnosis. We assume that the type system is described using a constraint-based approach, and constraint solving is specified using rewrite rules. Domain information can then be injected at constraint gathering time via type rules, during constraint solving via specialized rules and axioms, and finally at blaming and reparation time via transformations. Furthermore, we define error contexts as a way to control the order in which solving and blaming proceeds. We engineer domain-specific error diagnosis in such a way that the compiler can also reuse the techniques for improving general error diagnosis.


Author(s):  
Sunbeom So ◽  
Hakjoo Oh

We describe a programming-by-example system that automatically generates pattern programs from examples. Writing pattern programs, which produce various patterns of characters, is one of the most popular programming exercises for entry-level students. However, students often find it difficult to write correct solutions by themselves. In this paper, we present a method for synthesizing pattern programs from examples, allowing students to improve their programming skills efficiently. To that end, we first design a domain-specific language that supports a large class of pattern programs that students struggle with. Next, we develop a synthesis algorithm that efficiently finds a desired program by combining enumerative search, constraint solving, and program analysis. We implemented the algorithm in a tool and evaluated it on 40 exercises gathered from online forums. The experimental results and user study show that our tool can synthesize instructive solutions from 1–3 example patterns in 1.2 seconds on average.


2008 ◽  
Vol 67 (2) ◽  
pp. 71-83 ◽  
Author(s):  
Yolanda A. Métrailler ◽  
Ester Reijnen ◽  
Cornelia Kneser ◽  
Klaus Opwis

This study compared individuals with pairs in a scientific problem-solving task. Participants interacted with a virtual psychological laboratory called Virtue to reason about a visual search theory. To this end, they created hypotheses, designed experiments, and analyzed and interpreted the results of their experiments in order to discover which of five possible factors affected the visual search process. Before and after their interaction with Virtue, participants took a test measuring theoretical and methodological knowledge. In addition, process data reflecting participants’ experimental activities and verbal data were collected. The results showed a significant but equal increase in knowledge for both groups. We found differences between individuals and pairs in the evaluation of hypotheses in the process data, and in descriptive and explanatory statements in the verbal data. Interacting with Virtue helped all students improve their domain-specific and domain-general psychological knowledge.


2008 ◽  
Vol 16 (3) ◽  
pp. 112-115 ◽  
Author(s):  
Stephan Bongard ◽  
Volker Hodapp ◽  
Sonja Rohrmann

Abstract. Our unit investigates the relationship of emotional processes (experience, expression, and coping), their physiological correlates and possible health outcomes. We study domain specific anger expression behavior and associated cardio-vascular loads and found e.g. that particularly an open anger expression at work is associated with greater blood pressure. Furthermore, we demonstrated that women may be predisposed for the development of certain mental disorders because of their higher disgust sensitivity. We also pointed out that the suppression of negative emotions leads to increased physiological stress responses which results in a higher risk for cardiovascular diseases. We could show that relaxation as well as music activity like singing in a choir causes increases in the local immune parameter immunoglobuline A. Finally, we are investigating connections between migrants’ strategy of acculturation and health and found e.g. elevated cardiovascular stress responses in migrants when they where highly adapted to the German culture.


2009 ◽  
Vol 25 (1) ◽  
pp. 1-7 ◽  
Author(s):  
Jörg-Tobias Kuhn ◽  
Heinz Holling

The present study explores the factorial structure and the degree of measurement invariance of 12 divergent thinking tests. In a large sample of German students (N = 1328), a three-factor model representing verbal, figural, and numerical divergent thinking was supported. Multigroup confirmatory factor analyses revealed that partial strong measurement invariance was tenable across gender and age groups as well as school forms. Latent mean comparisons resulted in significantly higher divergent thinking skills for females and students in schools with higher mean IQ. Older students exhibited higher latent means on the verbal and figural factor, but not on the numerical factor. These results suggest that a domain-specific model of divergent thinking may be assumed, although further research is needed to elucidate the sources that negatively affect measurement invariance.


2020 ◽  
Author(s):  
Jamie Buck ◽  
Rena Subotnik ◽  
Frank Worrell ◽  
Paula Olszewski-Kubilius ◽  
Chi Wang

2012 ◽  
Author(s):  
Christine M. Szostak ◽  
Mark A. Pitt ◽  
Laura C. Dilley

2007 ◽  
Author(s):  
P. S. Kavanagh ◽  
G. J. O. Fletcher ◽  
B. J. Ellis
Keyword(s):  

Sign in / Sign up

Export Citation Format

Share Document