Skip to content

High-level programming language designed to simplify the implementation and execution of probabilistic models and computations.

Notifications You must be signed in to change notification settings

jumorap/PScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PScript (Probabilistic Script)

PScript (Probabilistic Script) is a programming language designed to facilitate the implementation and execution of probabilistic models and computations. It provides a set of syntax and constructs that allow developers to express and manipulate probabilistic distributions, statistical models, and inference algorithms in a concise and intuitive manner.

  • It was build using PLY (Python lex yacc).
  • Previous work that was used to build this project can be found as SigmaScript, a project developed by members of the current team.

Features

  • Basic arithmetic operations
  • Basic logical operations
  • Basic conditional statements
  • Basic loops (while)
  • Basic functions
  • Basic multidimensional arrays
  • Basic variables without type inference
  • Basic probability distributions (Exponential, Normal, Uniform, Poisson, Geometric)
  • Stochastic variables (when the variable is called, always returns different values)
  • Stochastic arrays (when the array is called, always returns different values)
  • Console input and output
  • File input and output un txt format with PScript syntax

How to use

  1. Clone this repository using :

    git clone https://github.com/jumorap/PScript
    
  2. Move into the repository using:

    cd PScript
    
  3. Install the required packages using:

    pip install -r requirements.txt
    
  4. Write PScript in the scripts folder and save it as <file_name>.psc.

  5. Run your code using :

    python3 pscript.py scripts/<file_name>.psc -t
    

    where -t is a flag to show each token generated by the lexer.

    • To only show the output of the program you can also run the code using:
      python3 pscript.py scripts/<file_name>.psc
      
    • To write and run PScript code through the terminal line by line you can also run the code using:
      python3 pscript.py
      

NOTE:

  • The scripts folder contains some examples of PScript code.
  • You can run some examples of PScript using:
    python3 pscript.py scripts/while_bucle.psc
    

About

High-level programming language designed to simplify the implementation and execution of probabilistic models and computations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •