Generating program code for psychological experiments from high-level descriptions

Igor Dejanović\(^1\), Mirjana Dejanović\(^2\) (igord at uns ac rs)

University of Novi Sad\(^1\), University of Priština\(^2\), September, 2019 @ ERK Portorož Slovenia

Created 2024-10-01 Tue 14:23, press ESC for overview and use arrow keys for movement, press Ctrl+Shift+F for search

1. Introduction

1.1. Experiments in Psychology

1.2. An example – the Simon effect test

simon_experiment.png

1.3. Motivation

2. Domain-Specific Languages

2.1. SQL

SELECT player, stadium
    FROM game JOIN goal ON (id=matchid)

2.2. Business processes - BPMN

BPMN.png

2.3. But also…

MusicNotation-External.png

2.4. Or…

ChessNotation.png

2.5. textX

textX.png

https://github.com/textX/textX

  1. Dejanović, R. Vaderna, G. Milosavljević, Ž. Vuković, TextX: A Python tool for

Domain-Specific Languages implementation, Knowledge-Based Systems 115, 1-4, 2017.

3. pyFlies

3.1. pyFlies - DSL for psychological RT experiments

pyFliesGUI.png

3.2. pyFlies code for the Simon effect test

test Simon {
  conditions {
    position  color  congruency   response

    left      green  congruent    left
    left      red    incongruent  right
    right     green  incongruent  left
    right     red    congruent    right
  }
  
  stimuli{
    all: shape(rectangle, position position,
               color color)
    error: sound(1000)
    fixation: shape(cross)
  }
}

3.3. Connecting stimuli and conditions

   position=left and color=red

stimuli-conditions.png

3.4. Target code generators

architecture.png

3.5. Template engines

template_engine.png

4. Conclusion

5. Thanks! Q&A?