Skip to content

tjarker/molecular-programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Molecular Programming Language parser in F#

Project 2 for the course 02257 Applied Functional Programming

Build and test F# library

Link to Overleaf

Project structure

The project is structures as a .NET class library called MolecularProgrammingLib.

The F# source files are included in the src directory and organized into three subdirectories and a standalone script:

  • domain
    • CrnTypes.fs: F# type declaration of the main CRN++ syntactic elements.
    • CrnParser.fs: Parser for CRN++ programs into F# type representations.
    • CrnTypeChecker.fs: Module used to test whether CRN satisfies well-formed properties.
    • CrnProperties.fs: Module used to validate other properties on CRNs, such as comparing interpreted and compiled output reactions and to check the dependency ordering of step commands.
    • CrnGenerator.fs: Custom generator for FsCheck that constructs well-formed CRNs.
    • CrnExamples.fs: Sample CRN++ programs from the paper [1].
  • reactions
    • CrnInterpreter.fs: Evaluates the input CRN program and generates a sequence of output states.
    • CrnCompiler.fs: Computes a sequence of output states based on networks of chemical reactions [1].
    • CrnSimulator: Module used to simulate a list of chemical reactions and plot the results.
  • visualization
  • script.fsx: Demonstration of the implemented functionality.

Furthermore, F# test files can be found in the test directory and includes:

Building the project

Software requirements: .NET SDK 6.0 or higher

Open a CLI tool of your choice and navigate to the `MolecularProgrammingLib`` root directory and build the project with

> dotnet build

The modules are now ready to be imported in another project or .fsx script file.

Running the tests

Next, you can run the tests with

> dotnet test

Running the script

The script.fsx program can be run either through an interactive terminal or by executing:

> dotnet run

References

[1] M. Vasic, D. Soloveichik, S. Khurshid (2020). CRN++: Molecular Programming Language Springer Nature B.V., 2020, 391-407.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published