let make_enum_states () =
let state_list =fst (Data_for_aorai.getAutomata()) in
let state_list =
List.map (fun x -> (x.Promelaast.name, x.Promelaast.nums)) state_list
in
let state_list =
if not (Aorai_option.Deterministic.get ()) then state_list
else
(*[VP] Strictly speaking this is not needed, but Jessie tends
to consider that a value of enum type can only be one of the
tags, so that we must add this dummy state that is always a
possible value, even when a contract concludes that curState
is none of the others. Note that ISO C does not impose this
limitation to values of enum types.
*)
(get_fresh "aorai_reject_state", -2)::state_list
in
let enum = mk_global_c_enum_type_tagged states state_list in
let mapping =
List.map
(fun (name,id) ->
let item =
List.find (fun y -> y.einame = name) enum.eitems
in
(id, item))
state_list
in
set_enum mapping