[Lustre -> intermediate] fix for the [pre] construct

This commit is contained in:
Arnaud DABY-SEESARAM 2022-12-18 17:36:10 +01:00
parent 77c865e360
commit aa7f7514d3
2 changed files with 6 additions and 6 deletions

View File

@ -19,6 +19,9 @@ let ast_to_intermediate_ast (nodes: t_nodelist) (h: node_states): i_nodelist =
| None -> IEVar (CVInput (name_of_var v))
| Some (s, i) -> IEVar (CVStored (s, i))
end
| EMonOp (_, MOp_pre, EVar (_, v)) ->
let s, i = Hashtbl.find hloc (Utils.name_of_var v, true) in
IEVar (CVStored (s, i))
| EMonOp (_, op, e) -> IEMonOp (op, ast_to_intermediate_ast_expr hloc e)
| EBinOp (_, op, e, e') ->
IEBinOp (op, ast_to_intermediate_ast_expr hloc e, ast_to_intermediate_ast_expr hloc e')

View File

@ -1,9 +1,6 @@
node n (i: int) returns (o: int);
var v, t: int; a, b: bool;
var v: int;
let
a = true -> false;
b = a and not (pre a);
o = 1;
v = pre o;
t = o + pre i;
tel