r-doz / SOGA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SOGA

Contents

  • The folder "experiments" contains the scripts and data to reproduce the main results of of the paper (i.e., Table 3).
  • The folder "grammars" contains the file with the grammar of SOGA (SOGA.g4) and the two sub-grammars ASGMT (ASGMT.g4) and TRUNC (TRUNC.g4).
  • The folder "programs" contains the scripts of the models analyzed in the paper, divided by tools.
  • The folder "src" contains the code implementing the tool SOGA, whose usage is described below;
  • The folder "tools" contains the implementation of the tools AQUA, BLOG, cmdstan and PSI, to which SOGA is compared.

Implementation

The module producecfg.py contains the classes definition for CFG objects and the function produce_cfg, that extracts a CFG from a program script in a .txt file.

The module libSOGA.py contains the function start_soga, which is used to invoke SOGA on a CFG object and the recursive function SOGA, which, depending on the type of the visited node, calls the functions needed to update the current distribution.

Such functions are contained in the auxiliary modules:

  • libSOGAtruncate.py, containing functions for computing the resulting distribution when a truncation occurs (in conditional or observe instructions);
  • libSOGAupdate.py, containing functions for computing the resulting distribution after applying an assignment instruction;
  • libSOGAmerge,py, containing functions for computing the resulting distribution when a merge or a prune instruction is encountered;

Additional functions for general purpose are defined in the module libSOGAshared.py, which is imported by all previous libraries.

Parsing of the scripts, expressions and truncations is performed using ANTLR. Definition of the respective grammars can be found in the files SOGA.g4, ASGMT.g4 and TRUNC.g4.

About

License:GNU General Public License v3.0


Languages

Language:C++ 91.4%Language:C 3.9%Language:Fortran 1.2%Language:HTML 1.0%Language:Python 0.6%Language:CMake 0.4%Language:Assembly 0.3%Language:XSLT 0.3%Language:Cuda 0.2%Language:R 0.1%Language:Shell 0.1%Language:Jupyter Notebook 0.1%Language:NASL 0.1%Language:Makefile 0.0%Language:Ada 0.0%Language:Pascal 0.0%Language:C# 0.0%Language:Perl 0.0%Language:Batchfile 0.0%Language:Stan 0.0%Language:DIGITAL Command Language 0.0%Language:JavaScript 0.0%Language:Roff 0.0%Language:Yacc 0.0%Language:QMake 0.0%Language:CSS 0.0%Language:M4 0.0%Language:Starlark 0.0%Language:Ruby 0.0%Language:SWIG 0.0%Language:Meson 0.0%Language:ANTLR 0.0%Language:Smarty 0.0%Language:SAS 0.0%Language:Module Management System 0.0%Language:Dockerfile 0.0%Language:Objective-C 0.0%Language:Objective-C++ 0.0%Language:Scala 0.0%