let yyact = [|
(fun _ -> failwith "parser")
; (fun __caml_parser_env ->
let _3 = (Parsing.peek_val __caml_parser_env 2 : 'states) in
Obj.repr(
# 87 "src/ltl_to_acsl/promelaparser_withexps.mly"
(
let states=
Hashtbl.fold (fun _ st l ->
if st.acceptation=Undefined or st.init=Undefined then
begin
Format.print_string ("Error: the state '"^(st.name)^"' is used but never defined.\n");
exit 1
end;
st::l
) observed_states []
in
Data_for_ltl.setLtl_expressions observed_expressions;
Ltl_logic.setLtl_expressions observed_expressions;
let n=ref 0 in
let transitions = Ltl_logic.simplifyTrans _3 in
List.iter (fun t -> t.numt<-(!n); n:=!n+1) transitions;
((states , transitions),observed_vars,observed_funcs)
)
# 297 "src/ltl_to_acsl/promelaparser_withexps.ml"
: (Promelaast.buchautomata * (string, string) Hashtbl.t * (string, string) Hashtbl.t)))
; (fun __caml_parser_env ->
let _3 = (Parsing.peek_val __caml_parser_env 3 : 'states) in
Obj.repr(
# 106 "src/ltl_to_acsl/promelaparser_withexps.mly"
(
let states=
Hashtbl.fold (fun _ st l ->
if st.acceptation=Undefined or st.init=Undefined then
begin
Format.print_string ("Error: the state '"^(st.name)^"' is used but never defined.\n");
exit 1
end;
st::l
) observed_states []
in
Data_for_ltl.setLtl_expressions observed_expressions;
Ltl_logic.setLtl_expressions observed_expressions;
let n=ref 0 in
let transitions = Ltl_logic.simplifyTrans _3 in
List.iter (fun t -> t.numt<-(!n); n:=!n+1) transitions;
((states , transitions),observed_vars,observed_funcs) )
# 322 "src/ltl_to_acsl/promelaparser_withexps.ml"
: (Promelaast.buchautomata * (string, string) Hashtbl.t * (string, string) Hashtbl.t)))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'states) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'state) in
Obj.repr(
# 130 "src/ltl_to_acsl/promelaparser_withexps.mly"
(
_1@_3
)
# 335 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'states))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'state) in
Obj.repr(
# 136 "src/ltl_to_acsl/promelaparser_withexps.mly"
( _1 )
# 342 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'states))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 1 : 'state_labels) in
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'state_body) in
Obj.repr(
# 140 "src/ltl_to_acsl/promelaparser_withexps.mly"
(
let (stl,trans)=_1 in
let (trl,force_final)=_2 in
if force_final then
begin
List.iter (fun s ->
try
(Hashtbl.find observed_states s.name).acceptation <- True
with
| Not_found -> assert false
) stl
end;
if trl=[] then
trans
else
let tr_list=
List.fold_left (fun l1 (cr,stop_st) ->
List.fold_left (fun l2 st ->
{start=st;stop=stop_st;cross=cr;numt=(-1)}::l2
) l1 stl
) [] trl
in
(List.rev tr_list)@trans
)
# 377 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'state))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 1 : 'label) in
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'state_labels) in
Obj.repr(
# 171 "src/ltl_to_acsl/promelaparser_withexps.mly"
(
let (stl1,trl1)=_1 in
let (stl2,trl2)=_2 in
(stl1@stl2,trl1@trl2)
)
# 389 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'state_labels))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'label) in
Obj.repr(
# 176 "src/ltl_to_acsl/promelaparser_withexps.mly"
( _1 )
# 396 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'state_labels))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in
Obj.repr(
# 180 "src/ltl_to_acsl/promelaparser_withexps.mly"
(
begin
let trans = ref [] in
let old=
try
Hashtbl.find observed_states _1
with
| Not_found ->
let s={name=_1;acceptation=Undefined;init=Undefined;nums=(Hashtbl.length observed_states)} in
Hashtbl.add observed_states _1 s;
s
in
old.acceptation <- False;
if (String.length _1>=10) && (String.compare (String.sub _1 0 10) "accept_all")=0 then
trans:={start=old;stop=old;cross=PTrue;numt=(-1)}::!trans;
if (String.length _1>=7) && (String.compare (String.sub _1 0 7) "accept_")=0 then
old.acceptation <- True;
if (String.length _1>=5) && (String.compare (String.sub _1 ((String.length _1)-5) 5) "_init" ) = 0
then
old.init <- True
else
old.init <- False;
([old],!trans)
end
)
# 441 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'label))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 1 : 'transitions) in
Obj.repr(
# 223 "src/ltl_to_acsl/promelaparser_withexps.mly"
( (_2,false) )
# 448 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'state_body))
; (fun __caml_parser_env ->
Obj.repr(
# 224 "src/ltl_to_acsl/promelaparser_withexps.mly"
( ([],false) )
# 454 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'state_body))
; (fun __caml_parser_env ->
Obj.repr(
# 225 "src/ltl_to_acsl/promelaparser_withexps.mly"
( ([],true) )
# 460 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'state_body))
; (fun __caml_parser_env ->
Obj.repr(
# 226 "src/ltl_to_acsl/promelaparser_withexps.mly"
( ([],true) )
# 466 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'state_body))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 1 : 'transitions) in
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'transition) in
Obj.repr(
# 231 "src/ltl_to_acsl/promelaparser_withexps.mly"
( _1@[_2] )
# 474 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'transitions))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'transition) in
Obj.repr(
# 232 "src/ltl_to_acsl/promelaparser_withexps.mly"
( [_1] )
# 481 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'transitions))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 3 : 'guard) in
let _5 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 236 "src/ltl_to_acsl/promelaparser_withexps.mly"
(
let s=
try
Hashtbl.find observed_states _5
with
Not_found ->
let r={name=_5;init=Undefined;acceptation=Undefined;nums=(Hashtbl.length observed_states)} in
Hashtbl.add observed_states _5 r;
r
in
(_2,s)
)
# 500 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'transition))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 252 "src/ltl_to_acsl/promelaparser_withexps.mly"
( if not (Hashtbl.mem observed_funcs _1) then Hashtbl.add observed_funcs _1 _1 ; PCallOrReturn _1 )
# 507 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 254 "src/ltl_to_acsl/promelaparser_withexps.mly"
( if not (Hashtbl.mem observed_funcs _1) then Hashtbl.add observed_funcs _1 _1 ; PCall _1 )
# 514 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 256 "src/ltl_to_acsl/promelaparser_withexps.mly"
( if not (Hashtbl.mem observed_funcs _1) then Hashtbl.add observed_funcs _1 _1 ; PReturn _1 )
# 521 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
Obj.repr(
# 258 "src/ltl_to_acsl/promelaparser_withexps.mly"
( PTrue )
# 527 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
Obj.repr(
# 260 "src/ltl_to_acsl/promelaparser_withexps.mly"
( PFalse )
# 533 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'guard) in
Obj.repr(
# 262 "src/ltl_to_acsl/promelaparser_withexps.mly"
( PNot _2 )
# 540 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'guard) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'guard) in
Obj.repr(
# 264 "src/ltl_to_acsl/promelaparser_withexps.mly"
( PAnd (_1,_3) )
# 548 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'guard) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'guard) in
Obj.repr(
# 266 "src/ltl_to_acsl/promelaparser_withexps.mly"
( POr (_1,_3) )
# 556 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 1 : 'guard) in
Obj.repr(
# 268 "src/ltl_to_acsl/promelaparser_withexps.mly"
( _2 )
# 563 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'logic_relation) in
Obj.repr(
# 273 "src/ltl_to_acsl/promelaparser_withexps.mly"
(
let id = get_fresh_ident () in
let (pred,exp) = _1 in
Hashtbl.add observed_expressions id
(exp, (Pretty_utils.sfprintf "%a" Cil.d_exp exp), pred);
Hashtbl.add observed_vars id id ;
PIndexedExp id
)
# 579 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'arith_relation) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation) in
Obj.repr(
# 291 "src/ltl_to_acsl/promelaparser_withexps.mly"
( ( Cil_types.Prel(Cil_types.Req, Logic_utils.expr_to_term _1 ,Logic_utils.expr_to_term _3),
Cil.new_exp (Cil_types.BinOp(Cil_types.Eq, _1 , _3 , Cil.intType)) )
)
# 589 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'logic_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'arith_relation) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation) in
Obj.repr(
# 295 "src/ltl_to_acsl/promelaparser_withexps.mly"
( ( Cil_types.Prel(Cil_types.Rlt, Logic_utils.expr_to_term _1 , Logic_utils.expr_to_term _3),
Cil.new_exp (Cil_types.BinOp(Cil_types.Lt, _1 , _3 , Cil.intType)) )
)
# 599 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'logic_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'arith_relation) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation) in
Obj.repr(
# 299 "src/ltl_to_acsl/promelaparser_withexps.mly"
( ( Cil_types.Prel(Cil_types.Rgt, Logic_utils.expr_to_term _1 , Logic_utils.expr_to_term _3),
Cil.new_exp(Cil_types.BinOp(Cil_types.Gt, _1 , _3 , Cil.intType)) )
)
# 609 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'logic_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'arith_relation) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation) in
Obj.repr(
# 303 "src/ltl_to_acsl/promelaparser_withexps.mly"
( ( Cil_types.Prel(Cil_types.Rle, Logic_utils.expr_to_term _1 , Logic_utils.expr_to_term _3),
Cil.new_exp (Cil_types.BinOp(Cil_types.Le, _1 , _3 , Cil.intType) ))
)
# 619 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'logic_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'arith_relation) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation) in
Obj.repr(
# 307 "src/ltl_to_acsl/promelaparser_withexps.mly"
( ( Cil_types.Prel(Cil_types.Rge, Logic_utils.expr_to_term _1 , Logic_utils.expr_to_term _3),
Cil.new_exp (Cil_types.BinOp(Cil_types.Ge, _1 , _3 , Cil.intType) ))
)
# 629 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'logic_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'arith_relation) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation) in
Obj.repr(
# 311 "src/ltl_to_acsl/promelaparser_withexps.mly"
( ( Cil_types.Prel(Cil_types.Rneq,Logic_utils.expr_to_term _1 , Logic_utils.expr_to_term _3),
Cil.new_exp (Cil_types.BinOp(Cil_types.Ne , _1 , _3 , Cil.intType) ))
)
# 639 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'logic_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation) in
Obj.repr(
# 315 "src/ltl_to_acsl/promelaparser_withexps.mly"
( ( Cil_types.Prel(Cil_types.Rneq,Logic_utils.expr_to_term _1 ,
Logic_const.term
(Cil_types.TConst(Cil_types.CInt64(Int64.of_int 0,Cil_types.IInt,Some("0"))))
(Cil_types.Ctype Cil.intType)),
_1)
)
# 651 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'logic_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'arith_relation_mul) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation) in
Obj.repr(
# 327 "src/ltl_to_acsl/promelaparser_withexps.mly"
( Cil.new_exp (Cil_types.BinOp(Cil_types.PlusA, _1 , _3 , Cil.intType)) )
# 659 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'arith_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'arith_relation_mul) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation) in
Obj.repr(
# 329 "src/ltl_to_acsl/promelaparser_withexps.mly"
( Cil.new_exp (Cil_types.BinOp(Cil_types.MinusA, _1 , _3 , Cil.intType)) )
# 667 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'arith_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation_mul) in
Obj.repr(
# 331 "src/ltl_to_acsl/promelaparser_withexps.mly"
( _1 )
# 674 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'arith_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'arith_relation_mul) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'access_or_const) in
Obj.repr(
# 337 "src/ltl_to_acsl/promelaparser_withexps.mly"
( Cil.new_exp (Cil_types.BinOp(Cil_types.Div, _1 , _3 , Cil.intType)) )
# 682 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'arith_relation_mul))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'arith_relation_mul) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'access_or_const) in
Obj.repr(
# 339 "src/ltl_to_acsl/promelaparser_withexps.mly"
( Cil.new_exp (Cil_types.BinOp(Cil_types.Mult, _1 , _3 , Cil.intType)) )
# 690 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'arith_relation_mul))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'arith_relation_mul) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'access_or_const) in
Obj.repr(
# 341 "src/ltl_to_acsl/promelaparser_withexps.mly"
( Cil.new_exp (Cil_types.BinOp(Cil_types.Mod, _1 , _3 , Cil.intType)) )
# 698 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'arith_relation_mul))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'access_or_const) in
Obj.repr(
# 343 "src/ltl_to_acsl/promelaparser_withexps.mly"
( _1 )
# 705 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'arith_relation_mul))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 349 "src/ltl_to_acsl/promelaparser_withexps.mly"
( Cil.new_exp (Cil_types.Const(Cil_types.CInt64(Int64.of_string _1,Cil_types.IInt, Some(_1)))))
# 712 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'access_or_const))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'access) in
Obj.repr(
# 351 "src/ltl_to_acsl/promelaparser_withexps.mly"
( Cil.new_exp (Cil_types.Lval(_1)) )
# 719 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'access_or_const))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 1 : 'arith_relation) in
Obj.repr(
# 353 "src/ltl_to_acsl/promelaparser_withexps.mly"
( _2 )
# 726 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'access_or_const))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'access) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 360 "src/ltl_to_acsl/promelaparser_withexps.mly"
(
let (my_host,my_offset) = (_1) in
let new_offset = Utils_parser.add_offset my_offset (Utils_parser.get_new_offset my_host my_offset _3) in
(my_host,new_offset))
# 738 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'access))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'access_array) in
Obj.repr(
# 367 "src/ltl_to_acsl/promelaparser_withexps.mly"
(_1)
# 745 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'access))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 3 : 'access_array) in
let _3 = (Parsing.peek_val __caml_parser_env 1 : 'access_or_const) in
Obj.repr(
# 371 "src/ltl_to_acsl/promelaparser_withexps.mly"
( Cil.addOffsetLval (Cil_types.Index (_3,Cil_types.NoOffset)) _1)
# 753 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'access_array))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'access_leaf) in
Obj.repr(
# 373 "src/ltl_to_acsl/promelaparser_withexps.mly"
(_1)
# 760 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'access_array))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'access) in
Obj.repr(
# 378 "src/ltl_to_acsl/promelaparser_withexps.mly"
( Ltl_to_acsl_option.fatal "NOT YET IMPLEMENTED : *A dereferencement access." )
# 767 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'access_leaf))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 380 "src/ltl_to_acsl/promelaparser_withexps.mly"
( Cil.var ( Data_for_ltl.get_varinfo _1) )
# 774 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'access_leaf))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 1 : 'access) in
Obj.repr(
# 382 "src/ltl_to_acsl/promelaparser_withexps.mly"
( _2 )
# 781 "src/ltl_to_acsl/promelaparser_withexps.ml"
: 'access_leaf))
; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
|]