First commit
This commit is contained in:
4
bin/dune
Normal file
4
bin/dune
Normal file
@ -0,0 +1,4 @@
|
||||
(executable
|
||||
(public_name main)
|
||||
(name main)
|
||||
(libraries lang))
|
||||
30
bin/main.ml
Normal file
30
bin/main.ml
Normal file
@ -0,0 +1,30 @@
|
||||
(*
|
||||
|
||||
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)
|
||||
Reference in New Issue
Block a user