ocaml: phase 5.1 expr_simp.ml baseline (symbolic simplifier, eval(simp e) = 22)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 28s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 28s
Recursive ADT with three constructors (Num/Add/Mul). simp does bottom-up rewrite using algebraic identities: x + 0 -> x 0 + x -> x x * 0 -> 0 0 * x -> 0 x * 1 -> x 1 * x -> x constant folding for Num + Num and Num * Num Uses tuple pattern in nested match: 'match (simp a, simp b) with'. Add (Mul (Num 3, Num 5), Add (Num 0, Mul (Num 1, Num 7))) -> simp -> Add (Num 15, Num 7) -> eval -> 22 51 baseline programs total.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
"csv.ml": 10,
|
||||
"exception_handle.ml": 4,
|
||||
"expr_eval.ml": 16,
|
||||
"expr_simp.ml": 22,
|
||||
"factorial.ml": 3628800,
|
||||
"fraction.ml": 7,
|
||||
"frequency.ml": 5,
|
||||
|
||||
Reference in New Issue
Block a user