Commit 1ec44203 authored by Maximilien Colange's avatar Maximilien Colange

Fix inconsistencies in array printing.

parent 87cad902
...@@ -205,15 +205,17 @@ struct ...@@ -205,15 +205,17 @@ struct
(function (function
| Constant c -> sprintf "%d" c | Constant c -> sprintf "%d" c
| Array(aid, indices) -> | Array(aid, indices) ->
List.fold_left (fun s x -> s ^ (string_of_exp x)) (VarContext.array_of_index ta.vars aid) indices let arrayName = VarContext.array_of_index ta.vars aid in
List.fold_left (fun s x -> s ^ "[" ^ (string_of_exp x) ^ "]") arrayName indices
| ConstArray(aid, indices) -> | ConstArray(aid, indices) ->
List.fold_left (fun s x -> s ^ (string_of_exp x)) (VarContext.array_of_index ta.constants aid) indices let arrayName = VarContext.array_of_index ta.constants aid in
| Variable(id) -> VarContext.var_of_index ta.vars id List.fold_left (fun s x -> s ^ "[" ^ (string_of_exp x) ^ "]") arrayName indices
| ConstVariable(id) -> VarContext.var_of_index ta.constants id
| Clock(id) -> VarContext.var_of_index ta.clocks id
| ClockArray(aid,indices) -> | ClockArray(aid,indices) ->
let arrayName = VarContext.array_of_index ta.clocks aid in let arrayName = VarContext.array_of_index ta.clocks aid in
List.fold_left (fun s x -> s ^ "[" ^ (string_of_exp x) ^ "]") arrayName indices List.fold_left (fun s x -> s ^ "[" ^ (string_of_exp x) ^ "]") arrayName indices
| Variable(id) -> VarContext.var_of_index ta.vars id
| ConstVariable(id) -> VarContext.var_of_index ta.constants id
| Clock(id) -> VarContext.var_of_index ta.clocks id
| Product(e1,e2) -> | Product(e1,e2) ->
sprintf "%s * %s" (string_of_exp e1) sprintf "%s * %s" (string_of_exp e1)
(string_of_exp e2) (string_of_exp e2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment