let yyact = [|
(fun _ -> failwith "parser")
; (fun __caml_parser_env ->
let _3 = (Parsing.peek_val __caml_parser_env 2 : 'states) in
Obj.repr(
# 97 "src/aorai/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_aorai.setLtl_expressions observed_expressions;
Logic_simplification.setLtl_expressions observed_expressions;
let n=ref 0 in
let transitions = Logic_simplification.simplifyTrans _3 in
List.iter (fun t -> t.numt<-(!n); n:=!n+1) transitions;
((states , transitions),observed_vars,observed_funcs)
)
# 316 "src/aorai/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(
# 116 "src/aorai/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_aorai.setLtl_expressions observed_expressions;
Logic_simplification.setLtl_expressions observed_expressions;
let n=ref 0 in
let transitions = Logic_simplification.simplifyTrans _3 in
List.iter (fun t -> t.numt<-(!n); n:=!n+1) transitions;
((states , transitions),observed_vars,observed_funcs) )
# 341 "src/aorai/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(
# 140 "src/aorai/promelaparser_withexps.mly"
(
_1@_3
)
# 354 "src/aorai/promelaparser_withexps.ml"
: 'states))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'state) in
Obj.repr(
# 146 "src/aorai/promelaparser_withexps.mly"
( _1 )
# 361 "src/aorai/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(
# 150 "src/aorai/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
)
# 396 "src/aorai/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(
# 181 "src/aorai/promelaparser_withexps.mly"
(
let (stl1,trl1)=_1 in
let (stl2,trl2)=_2 in
(stl1@stl2,trl1@trl2)
)
# 408 "src/aorai/promelaparser_withexps.ml"
: 'state_labels))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'label) in
Obj.repr(
# 186 "src/aorai/promelaparser_withexps.mly"
( _1 )
# 415 "src/aorai/promelaparser_withexps.ml"
: 'state_labels))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in
Obj.repr(
# 190 "src/aorai/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
)
# 460 "src/aorai/promelaparser_withexps.ml"
: 'label))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 1 : 'transitions) in
Obj.repr(
# 233 "src/aorai/promelaparser_withexps.mly"
( (_2,false) )
# 467 "src/aorai/promelaparser_withexps.ml"
: 'state_body))
; (fun __caml_parser_env ->
Obj.repr(
# 234 "src/aorai/promelaparser_withexps.mly"
( ([],false) )
# 473 "src/aorai/promelaparser_withexps.ml"
: 'state_body))
; (fun __caml_parser_env ->
Obj.repr(
# 235 "src/aorai/promelaparser_withexps.mly"
( ([],true) )
# 479 "src/aorai/promelaparser_withexps.ml"
: 'state_body))
; (fun __caml_parser_env ->
Obj.repr(
# 236 "src/aorai/promelaparser_withexps.mly"
( ([],true) )
# 485 "src/aorai/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(
# 241 "src/aorai/promelaparser_withexps.mly"
( _1@[_2] )
# 493 "src/aorai/promelaparser_withexps.ml"
: 'transitions))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'transition) in
Obj.repr(
# 242 "src/aorai/promelaparser_withexps.mly"
( [_1] )
# 500 "src/aorai/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(
# 246 "src/aorai/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)
)
# 519 "src/aorai/promelaparser_withexps.ml"
: 'transition))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 262 "src/aorai/promelaparser_withexps.mly"
( if not (Hashtbl.mem observed_funcs _1) then Hashtbl.add observed_funcs _1 _1 ; PCallOrReturn _1 )
# 526 "src/aorai/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 264 "src/aorai/promelaparser_withexps.mly"
( if not (Hashtbl.mem observed_funcs _1) then Hashtbl.add observed_funcs _1 _1 ; PCall _1 )
# 533 "src/aorai/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 266 "src/aorai/promelaparser_withexps.mly"
( if not (Hashtbl.mem observed_funcs _1) then Hashtbl.add observed_funcs _1 _1 ; PReturn _1 )
# 540 "src/aorai/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
Obj.repr(
# 268 "src/aorai/promelaparser_withexps.mly"
( PTrue )
# 546 "src/aorai/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
Obj.repr(
# 270 "src/aorai/promelaparser_withexps.mly"
( PFalse )
# 552 "src/aorai/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'guard) in
Obj.repr(
# 272 "src/aorai/promelaparser_withexps.mly"
( PNot _2 )
# 559 "src/aorai/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(
# 274 "src/aorai/promelaparser_withexps.mly"
( PAnd (_1,_3) )
# 567 "src/aorai/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(
# 276 "src/aorai/promelaparser_withexps.mly"
( POr (_1,_3) )
# 575 "src/aorai/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 1 : 'guard) in
Obj.repr(
# 278 "src/aorai/promelaparser_withexps.mly"
( _2 )
# 582 "src/aorai/promelaparser_withexps.ml"
: 'guard))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'logic_relation) in
Obj.repr(
# 283 "src/aorai/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 ;
let res =
match !observed_expr_is_param with
| Only_vars -> PIndexedExp id
| Func_param (f,l) -> PFuncParam (id,f,l)
| Func_ret f -> PFuncReturn (id,f)
in
observed_expr_is_param := Only_vars;
res
)
# 610 "src/aorai/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(
# 313 "src/aorai/promelaparser_withexps.mly"
( ( Cil_types.Prel(Cil_types.Req, Logic_utils.expr_to_term ~cast:true _1 ,Logic_utils.expr_to_term ~cast:true _3),
Cil.new_exp (Cil_types.BinOp(Cil_types.Eq, _1 , _3 , Cil.intType)) )
)
# 620 "src/aorai/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(
# 317 "src/aorai/promelaparser_withexps.mly"
( ( Cil_types.Prel(Cil_types.Rlt, Logic_utils.expr_to_term ~cast:true _1 , Logic_utils.expr_to_term ~cast:true _3),
Cil.new_exp (Cil_types.BinOp(Cil_types.Lt, _1 , _3 , Cil.intType)) )
)
# 630 "src/aorai/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(
# 321 "src/aorai/promelaparser_withexps.mly"
( ( Cil_types.Prel(Cil_types.Rgt, Logic_utils.expr_to_term ~cast:true _1 , Logic_utils.expr_to_term ~cast:true _3),
Cil.new_exp(Cil_types.BinOp(Cil_types.Gt, _1 , _3 , Cil.intType)) )
)
# 640 "src/aorai/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(
# 325 "src/aorai/promelaparser_withexps.mly"
( ( Cil_types.Prel(Cil_types.Rle, Logic_utils.expr_to_term ~cast:true _1 , Logic_utils.expr_to_term ~cast:true _3),
Cil.new_exp (Cil_types.BinOp(Cil_types.Le, _1 , _3 , Cil.intType) ))
)
# 650 "src/aorai/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(
# 329 "src/aorai/promelaparser_withexps.mly"
( ( Cil_types.Prel(Cil_types.Rge, Logic_utils.expr_to_term ~cast:true _1 , Logic_utils.expr_to_term ~cast:true _3),
Cil.new_exp (Cil_types.BinOp(Cil_types.Ge, _1 , _3 , Cil.intType) ))
)
# 660 "src/aorai/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(
# 333 "src/aorai/promelaparser_withexps.mly"
( ( Cil_types.Prel(Cil_types.Rneq,Logic_utils.expr_to_term ~cast:true _1 , Logic_utils.expr_to_term ~cast:true _3),
Cil.new_exp (Cil_types.BinOp(Cil_types.Ne , _1 , _3 , Cil.intType) ))
)
# 670 "src/aorai/promelaparser_withexps.ml"
: 'logic_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation) in
Obj.repr(
# 337 "src/aorai/promelaparser_withexps.mly"
( ( Cil_types.Prel(Cil_types.Rneq,Logic_utils.expr_to_term ~cast:true _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)
)
# 682 "src/aorai/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(
# 349 "src/aorai/promelaparser_withexps.mly"
( Cil.new_exp (Cil_types.BinOp(Cil_types.PlusA, _1 , _3 , Cil.intType)) )
# 690 "src/aorai/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(
# 351 "src/aorai/promelaparser_withexps.mly"
( Cil.new_exp (Cil_types.BinOp(Cil_types.MinusA, _1 , _3 , Cil.intType)) )
# 698 "src/aorai/promelaparser_withexps.ml"
: 'arith_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation_mul) in
Obj.repr(
# 353 "src/aorai/promelaparser_withexps.mly"
( _1 )
# 705 "src/aorai/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(
# 359 "src/aorai/promelaparser_withexps.mly"
( Cil.new_exp (Cil_types.BinOp(Cil_types.Div, _1 , _3 , Cil.intType)) )
# 713 "src/aorai/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(
# 361 "src/aorai/promelaparser_withexps.mly"
( Cil.new_exp (Cil_types.BinOp(Cil_types.Mult, _1 , _3 , Cil.intType)) )
# 721 "src/aorai/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(
# 363 "src/aorai/promelaparser_withexps.mly"
( Cil.new_exp (Cil_types.BinOp(Cil_types.Mod, _1 , _3 , Cil.intType)) )
# 729 "src/aorai/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(
# 365 "src/aorai/promelaparser_withexps.mly"
( _1 )
# 736 "src/aorai/promelaparser_withexps.ml"
: 'arith_relation_mul))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 371 "src/aorai/promelaparser_withexps.mly"
( Cil.new_exp (Cil_types.Const(Cil_types.CInt64(Int64.of_string _1,Cil_types.IInt, Some(_1)))))
# 743 "src/aorai/promelaparser_withexps.ml"
: 'access_or_const))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'access) in
Obj.repr(
# 373 "src/aorai/promelaparser_withexps.mly"
( Cil.new_exp (Cil_types.Lval(_1)) )
# 750 "src/aorai/promelaparser_withexps.ml"
: 'access_or_const))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 1 : 'arith_relation) in
Obj.repr(
# 375 "src/aorai/promelaparser_withexps.mly"
( _2 )
# 757 "src/aorai/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(
# 382 "src/aorai/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))
# 769 "src/aorai/promelaparser_withexps.ml"
: 'access))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'access_array) in
Obj.repr(
# 389 "src/aorai/promelaparser_withexps.mly"
(_1)
# 776 "src/aorai/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(
# 393 "src/aorai/promelaparser_withexps.mly"
( Cil.addOffsetLval (Cil_types.Index (_3,Cil_types.NoOffset)) _1)
# 784 "src/aorai/promelaparser_withexps.ml"
: 'access_array))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'access_leaf) in
Obj.repr(
# 395 "src/aorai/promelaparser_withexps.mly"
(_1)
# 791 "src/aorai/promelaparser_withexps.ml"
: 'access_array))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'access) in
Obj.repr(
# 400 "src/aorai/promelaparser_withexps.mly"
( Aorai_option.fatal "NOT YET IMPLEMENTED : *A dereferencement access." )
# 798 "src/aorai/promelaparser_withexps.ml"
: 'access_leaf))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 3 : string) in
let _4 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 405 "src/aorai/promelaparser_withexps.mly"
(
if(String.compare _4 "return")=0 then
begin
if not (!observed_expr_is_param=Only_vars) then
Aorai_option.abort "An expression can not contain at same time a reference of a returned value and itself or a reference to a param";
observed_expr_is_param := Func_ret _1;
Cil.var ( Data_for_aorai.get_returninfo _1)
end
else
begin
match !observed_expr_is_param with
| Func_ret _ ->
Aorai_option.abort "An expression can not contain both a reference of a returned value and another reference to itself or a reference to a param";
| Func_param (f,_) when not (f=_1) ->
Aorai_option.abort "An expression can not contain both references two different called functions.";
| Only_vars ->
observed_expr_is_param:=Func_param (_1,[_4]);
Cil.var ( Data_for_aorai.get_paraminfo _1 _4)
| Func_param (_,l) ->
observed_expr_is_param:=Func_param (_1,_4::l);
Cil.var ( Data_for_aorai.get_paraminfo _1 _4)
end
)
# 832 "src/aorai/promelaparser_withexps.ml"
: 'access_leaf))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 437 "src/aorai/promelaparser_withexps.mly"
( Cil.var ( Data_for_aorai.get_varinfo _1) )
# 839 "src/aorai/promelaparser_withexps.ml"
: 'access_leaf))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 1 : 'access) in
Obj.repr(
# 439 "src/aorai/promelaparser_withexps.mly"
( _2 )
# 846 "src/aorai/promelaparser_withexps.ml"
: 'access_leaf))
; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
|]