Created
March 21, 2017 01:57
-
-
Save evanlh/c8211a7493f0803f00b407081717e52e to your computer and use it in GitHub Desktop.
yertle_ocaml.ml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
Spitballing... | |
L system = { | |
alphabet: set of symbols, terminals and variables, | |
start: initial list of symbols, | |
rules: set of tuples from a symbol to a list of symbols | |
} | |
*) | |
type symbol = Symbol of string;; | |
type rule = Rule of symbol * symbol list;; | |
type lSystem = { alphabet: symbol list; start: symbol list; rules: rule list; } | |
type lSysTuple = symbol list * symbol list * rule list;; | |
let a = Symbol "a";; | |
let b = Symbol "b";; | |
let r1 = Rule (a, [a;b]);; | |
let r2 = Rule (b, [b;b]);; | |
let lSys1 = ([a;b], [a;a;b], [r1;r2]);; | |
(* | |
type rule = { symbol: char; expansion: char list };; | |
*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment