31 lines
755 B
OCaml
31 lines
755 B
OCaml
(*
|
|
|
|
open Lang.Exercises
|
|
(* let () = Printf.printf "%d\n" (eval_a_exp (Of_bool (Bval true))); *)
|
|
|
|
let myfsa: fsa = {vertices = (StringMap.add "node 2" true (StringMap.singleton "node 1" false));
|
|
edges = (StringMap.add "node 2" ("node 2", 'b') (StringMap.singleton "node 1" ("node 2", 'a')));
|
|
state = "node 1"}
|
|
|
|
let mystr = ['a'; 'b'; 'a'; 'b']
|
|
|
|
let ret = (Lang.Exercises.ex8 mystr myfsa);;
|
|
if ret
|
|
then print_endline "true"
|
|
else print_endline "false"
|
|
|
|
*)
|
|
|
|
open Lang.MiniImp
|
|
|
|
let program1 =
|
|
Main
|
|
("a",
|
|
"b",
|
|
(Sequence
|
|
((Assignment "x" (Integer 1)),
|
|
(Assignment "b" (Plus (Plus (Variable "a") (Variable "x")) (Variable "y"))))
|
|
)
|
|
)
|
|
Printf.printf "%d\n" (result program1 1)
|