Project 2 for the course 02257 Applied Functional Programming
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 forFsCheck
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
CrnDrawTree.fs
: Represents CRN programs as Drawing Tree.CrnString.fs
: Shows a string representation of CRN programs.CrnVisualizer.fs
: Visualizing chemical reactions usingPlotly.NET
.
script.fsx
: Demonstration of the implemented functionality.
Furthermore, F# test files can be found in the test
directory and includes:
CrnUnitTests.fs
: Unit tests used to properties on the sample CRN programs inCrnExamples.fs
.
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.
Next, you can run the tests with
> dotnet test
The script.fsx
program can be run either through an interactive terminal or by executing:
> dotnet run
[1] M. Vasic, D. Soloveichik, S. Khurshid (2020). CRN++: Molecular Programming Language Springer Nature B.V., 2020, 391-407.