Commit 39e824e0 authored by Maximilien Colange's avatar Maximilien Colange

Turn a test into an assertion.

parent 709e0e4e
......@@ -380,19 +380,17 @@ struct
*)
let rec eval_exp ta vars = function
| Constant c -> Constant c
| ConstVariable(id) ->
if ( id < 0 || id >= Array.length ta.constvalues ) then
failwith (sprintf "Const var index %d out of bounds (%d)" id (Array.length ta.constvalues));
| ConstVariable id ->
assert(id >= 0 && id < Array.length ta.constvalues);
Constant ta.constvalues.(id)
| Variable(id) ->
if ( id < 0 || id >= Array.length vars ) then
failwith (sprintf "Var index %d out of bounds (%d)" id (Array.length vars));
| Variable id ->
assert(id >= 0 && id < Array.length vars);
Constant vars.(id)
| Clock(c) -> Clock(c)
| Clock c -> Clock c
| ClockArray(arrayId, l) ->
let indices = List.map (fun x -> eval_disc_exp ta vars x) l in
let cellindex = VarContext.index_of_cell ta.clocks arrayId indices in
Clock(cellindex)
Clock cellindex
| Array(arrayId, l) ->
let indices = List.map (fun x -> eval_disc_exp ta vars x) l in
let cellindex = VarContext.index_of_cell ta.vars arrayId indices in
......
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