This assignment builds on the DNA fragment analyzer from Winter 2003. The following discussion assumes that you have read and understood that project's definitions, assignment, examples, hints, and solution.
Your company Frenetic Genetics Lab (FGL) is using some DNA sequence analysis software that is written in Scheme. Unfortunately, FGL is having continuing problems with software reliability. FGL's software engineers like the flexibility and power of Scheme, but the lack of run-time checking is making it difficult for FGL to write large, reliable DNA analysis software.
Your boss is considering translating FGL's software to another programming language that will support greater reliability while not giving up Scheme's advantages. She assigns to you the job of investigating the feasibility of rewriting FGL's software in Ocaml. She suggests that you start by rewriting the solution to the Winter 2003 assignment in Ocaml, and seeing how well it works.
Translate the solution to the Winter 2003 project from Scheme to Ocaml. Write Ocaml code that is as idiomatic as possible: your goal is to have a clear, clean translation that uses Ocaml well; it is not to generate a literal translation. For example, you don't need to translate all instances of Scheme #f to Ocaml false if there is a more natural translation in some cases.
Also, translate all ten test cases into Ocaml as well. Each test case is labeled with ===> in the Winter 2003 assignment. Call the test cases test1, test2, etc. You may add extra test cases after test10 if you like.
An important part of this assignment is to come up with a proper set of types for fragments, acceptors, patterns, etc. This will help you determine whether Ocaml's type system is helping to make the code more reliable and/or getting in the way of writing flexible code.
Submit a file named pr1.tgz. It should be a gzipped tar file containing all the source files that are needed to build and run your project. These files must consist of at least the following files, and perhaps other files if you find them useful (however do not submit byte code or executables):
#! /bin/sh ocamlc -c dnafa.mli ocamlc -c dnafa.ml ocamlc -c dnafatest.ml ocaml dnafa.cmo dnafatest.cmoYou can test the script by executing the shell command sh runtest.sh.
For example, you might use the following shell command to create pr1.tgz:
tar cf - README runtest.sh dnafa.ml dnafa.mli dnafatest.ml | gzip -9 >pr1.tgz
Use the shell command gunzip <pr1.tgz | tar tvf - to list the table of contents of your pr1.tgz file.