diff --git a/bin/main.ml b/bin/main.ml index 4c33a5c..5c3f91b 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -23,10 +23,12 @@ let () = let pgm = Parser.program Lexer.start lexbuf in let _ = print_endline "=== Printing Input Program ===" in pp pgm; - let _ = print_endline "=== Printing Output Program ===" in + let _ = print_endline "=== Gathering Functions ===" in let open Compiler in let env = gather_functions pgm in - let graph, _de = compile env Pred.Empty pgm.exp in + let _ = print_endline "=== Compiling Output Program ===" in + let graph, _de = compile''' env Pred.Empty pgm.exp in + let _ = print_endline "=== Printing Output Program ===" in Printf.printf "%s" (Graph.pp graph) with Parsing.Parse_error -> print_endline ("Parsing Error: " ^ lexbuf_contents lexbuf) diff --git a/lib/compiler.ml b/lib/compiler.ml index 9804448..8196065 100644 --- a/lib/compiler.ml +++ b/lib/compiler.ml @@ -57,9 +57,10 @@ let gather_functions (prog : program) : Env.t = exception Not_closed_observation -let compile (env : Env.t) (pred : Pred.t) (exp : Exp.t) : Graph.t * Det_exp.t = +let compile''' (env : Env.t) (pred : Pred.t) (exp : Exp.t) : Graph.t * Det_exp.t + = let rec compile pred = - let compile' = compile pred in + let compile' e = compile pred e in let open Graph in function | Exp.Int n -> (Graph.empty, Det_exp.Int n) diff --git a/lib/compiler.mli b/lib/compiler.mli index f25fefe..d2be1bb 100644 --- a/lib/compiler.mli +++ b/lib/compiler.mli @@ -5,4 +5,4 @@ val gather_functions : Program.program -> Env.t exception Not_closed_observation -val compile : Env.t -> Pred.t -> Program.Exp.t -> Graph.t * Program.Det_exp.t +val compile''' : Env.t -> Pred.t -> Program.Exp.t -> Graph.t * Program.Det_exp.t