let rec print_cmd (c: cmd) = match c with
Ass(l,r) -> "\tAss(" ^ (print_lexp l) ^ "," ^ (print_aexp r) ^ ")\n"
| Blk(clist) -> "Blk(\n\t" ^ (print_string_list (List.map print_cmd clist)) ^ ")\n"
| Ite(b,c1,c2) -> "\tIte(" ^ (print_bexp b) ^ "," ^ (print_cmd c1) ^ "," ^ (print_cmd c2) ^ ")\n"
| While(b,c) -> "\tWhile(" ^ (print_bexp b) ^ "," ^ (print_cmd c) ^ ")\n"
| Repeat(c,b) -> "\tRepeat(" ^ (print_cmd c) ^ "," ^ (print_bexp b) ^ ")\n"
| For(i,ex1,ex2,c) -> "\tFor(" ^ (print_ide i) ^ "," ^ (print_aexp ex1) ^ "," ^ (print_aexp ex2) ^ "," ^ (print_cmd c) ^ ")\n"
| Write(ex) -> "\tWrite(" ^ (print_aexp ex) ^ ")\n"
| PCall(id,exl) -> "\tPCall("^ (print_ide id) ^",["^ (print_string_list (List.map print_aexp exl)) ^"])\n"