let yyact = [|
(fun _ -> failwith "parser")
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 1 : 'options) in
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'states) in
Obj.repr(
# 101 "src/aorai/yaparser.mly"
(
List.iter
(fun(key, ids) ->
match key with
"init" ->
List.iter
(fun id -> try
(Hashtbl.find observed_states id).init <- True
with
Not_found ->
Aorai_option.abort "Error: no state '%s'\n" id)
ids
| "accept" ->
List.iter
(fun id -> try
(Hashtbl.find observed_states id).acceptation <- True
with Not_found ->
Aorai_option.abort "no state '%s'\n" id) ids
| oth ->
Aorai_option.abort "unknown option '%s'\n" oth
) _1
;
let states=
Hashtbl.fold
(fun _ st l ->
if st.acceptation=Undefined or st.init=Undefined then
begin
Aorai_option.abort
"Error: the state '%s' is used but never defined.\n" st.name
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 _2 in
List.iter (fun t -> t.numt<-(!n); n:=!n+1) transitions;
((states , transitions),observed_vars,observed_funcs)
)
# 346 "src/aorai/yaparser.ml"
: (Promelaast.buchautomata * (string, string) Hashtbl.t * (string, string) Hashtbl.t)))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 1 : 'options) in
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'option) in
Obj.repr(
# 146 "src/aorai/yaparser.mly"
( _1@[_2] )
# 354 "src/aorai/yaparser.ml"
: 'options))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'option) in
Obj.repr(
# 147 "src/aorai/yaparser.mly"
( [_1] )
# 361 "src/aorai/yaparser.ml"
: 'options))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 3 : string) in
let _4 = (Parsing.peek_val __caml_parser_env 1 : 'opt_identifiers) in
Obj.repr(
# 151 "src/aorai/yaparser.mly"
( (_2, _4) )
# 369 "src/aorai/yaparser.ml"
: 'option))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'opt_identifiers) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 155 "src/aorai/yaparser.mly"
( _1@[_3] )
# 377 "src/aorai/yaparser.ml"
: 'opt_identifiers))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 156 "src/aorai/yaparser.mly"
( [_1] )
# 384 "src/aorai/yaparser.ml"
: 'opt_identifiers))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 1 : 'states) in
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'state) in
Obj.repr(
# 164 "src/aorai/yaparser.mly"
( _1@_2 )
# 392 "src/aorai/yaparser.ml"
: 'states))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'state) in
Obj.repr(
# 165 "src/aorai/yaparser.mly"
( _1 )
# 399 "src/aorai/yaparser.ml"
: 'states))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 3 : string) in
let _3 = (Parsing.peek_val __caml_parser_env 1 : 'transitions) in
Obj.repr(
# 170 "src/aorai/yaparser.mly"
(
let start_state = fetch_and_create_state _1 in
let (all_conds, otherwise, transitions) =
List.fold_left
(fun (all_conds, otherwise, transitions) (cross,stop_state) ->
match otherwise, cross with
None, Pred cross ->
(POr (cross, all_conds), otherwise,
{ start=start_state; stop=stop_state;
cross=cross; numt=(-1) }::transitions)
| None, Otherwise ->
let trans = { start=start_state; stop=stop_state;
cross = PFalse; numt= (-1) }
in
(all_conds, Some trans, trans::transitions)
| Some _, _ ->
Aorai_option.abort
"'other' directive in definition of %s transitions is not the last one" start_state.name)
(PFalse,None,[]) _3
in
match otherwise with
None -> List.rev transitions
| Some trans ->
List.rev
({trans with cross = PNot all_conds} ::
(List.filter (fun x -> x != trans) transitions))
)
# 434 "src/aorai/yaparser.ml"
: 'state))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'transitions) in
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'transition) in
Obj.repr(
# 202 "src/aorai/yaparser.mly"
( _1@[_3] )
# 442 "src/aorai/yaparser.ml"
: 'transitions))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'transition) in
Obj.repr(
# 203 "src/aorai/yaparser.mly"
( [_1] )
# 449 "src/aorai/yaparser.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(
# 208 "src/aorai/yaparser.mly"
( (Pred _2, fetch_and_create_state _5) )
# 457 "src/aorai/yaparser.ml"
: 'transition))
; (fun __caml_parser_env ->
let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 209 "src/aorai/yaparser.mly"
((Otherwise, fetch_and_create_state _3) )
# 464 "src/aorai/yaparser.ml"
: 'transition))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 210 "src/aorai/yaparser.mly"
( (Pred PTrue, fetch_and_create_state _2) )
# 471 "src/aorai/yaparser.ml"
: 'transition))
; (fun __caml_parser_env ->
let _3 = (Parsing.peek_val __caml_parser_env 1 : string) in
Obj.repr(
# 217 "src/aorai/yaparser.mly"
( if not (Hashtbl.mem observed_funcs _3) then Hashtbl.add observed_funcs _3 _3 ; PCallOrReturn _3 )
# 478 "src/aorai/yaparser.ml"
: 'guard))
; (fun __caml_parser_env ->
let _3 = (Parsing.peek_val __caml_parser_env 1 : string) in
Obj.repr(
# 219 "src/aorai/yaparser.mly"
( if not (Hashtbl.mem observed_funcs _3) then Hashtbl.add observed_funcs _3 _3 ; PCall _3 )
# 485 "src/aorai/yaparser.ml"
: 'guard))
; (fun __caml_parser_env ->
let _3 = (Parsing.peek_val __caml_parser_env 1 : string) in
Obj.repr(
# 221 "src/aorai/yaparser.mly"
( if not (Hashtbl.mem observed_funcs _3) then Hashtbl.add observed_funcs _3 _3 ; PReturn _3 )
# 492 "src/aorai/yaparser.ml"
: 'guard))
; (fun __caml_parser_env ->
Obj.repr(
# 223 "src/aorai/yaparser.mly"
( PTrue )
# 498 "src/aorai/yaparser.ml"
: 'guard))
; (fun __caml_parser_env ->
Obj.repr(
# 225 "src/aorai/yaparser.mly"
( PFalse )
# 504 "src/aorai/yaparser.ml"
: 'guard))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'guard) in
Obj.repr(
# 227 "src/aorai/yaparser.mly"
( PNot _2 )
# 511 "src/aorai/yaparser.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(
# 229 "src/aorai/yaparser.mly"
( PAnd (_1,_3) )
# 519 "src/aorai/yaparser.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(
# 231 "src/aorai/yaparser.mly"
( POr (_1,_3) )
# 527 "src/aorai/yaparser.ml"
: 'guard))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 1 : 'guard) in
Obj.repr(
# 233 "src/aorai/yaparser.mly"
( _2 )
# 534 "src/aorai/yaparser.ml"
: 'guard))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'logic_relation) in
Obj.repr(
# 235 "src/aorai/yaparser.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
)
# 562 "src/aorai/yaparser.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(
# 264 "src/aorai/yaparser.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)) ) )
# 573 "src/aorai/yaparser.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(
# 268 "src/aorai/yaparser.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)) ) )
# 584 "src/aorai/yaparser.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(
# 272 "src/aorai/yaparser.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)) ) )
# 595 "src/aorai/yaparser.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(
# 276 "src/aorai/yaparser.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)) ) )
# 606 "src/aorai/yaparser.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(
# 280 "src/aorai/yaparser.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) )) )
# 617 "src/aorai/yaparser.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(
# 284 "src/aorai/yaparser.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) )) )
# 628 "src/aorai/yaparser.ml"
: 'logic_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation) in
Obj.repr(
# 288 "src/aorai/yaparser.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) )
# 638 "src/aorai/yaparser.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(
# 296 "src/aorai/yaparser.mly"
(
Cil.new_exp (Cil_types.BinOp(Cil_types.PlusA, _1 , _3 , Cil.intType)) )
# 647 "src/aorai/yaparser.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(
# 298 "src/aorai/yaparser.mly"
(
Cil.new_exp (Cil_types.BinOp(Cil_types.MinusA, _1 , _3 , Cil.intType)) )
# 656 "src/aorai/yaparser.ml"
: 'arith_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation_mul) in
Obj.repr(
# 300 "src/aorai/yaparser.mly"
( _1 )
# 663 "src/aorai/yaparser.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(
# 305 "src/aorai/yaparser.mly"
(
Cil.new_exp (Cil_types.BinOp(Cil_types.Div, _1 , _3 , Cil.intType)) )
# 672 "src/aorai/yaparser.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(
# 307 "src/aorai/yaparser.mly"
(
Cil.new_exp (Cil_types.BinOp(Cil_types.Mult, _1 , _3 , Cil.intType)) )
# 681 "src/aorai/yaparser.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(
# 309 "src/aorai/yaparser.mly"
(
Cil.new_exp (Cil_types.BinOp(Cil_types.Mod, _1 , _3 , Cil.intType)) )
# 690 "src/aorai/yaparser.ml"
: 'arith_relation_mul))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'access_or_const) in
Obj.repr(
# 311 "src/aorai/yaparser.mly"
( _1 )
# 697 "src/aorai/yaparser.ml"
: 'arith_relation_mul))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 317 "src/aorai/yaparser.mly"
( Cil.new_exp (Cil_types.Const(Cil_types.CInt64(Int64.of_string _1,Cil_types.IInt, Some(_1)))))
# 704 "src/aorai/yaparser.ml"
: 'access_or_const))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'access) in
Obj.repr(
# 319 "src/aorai/yaparser.mly"
( Cil.new_exp (Cil_types.Lval(_1)) )
# 711 "src/aorai/yaparser.ml"
: 'access_or_const))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 1 : 'arith_relation) in
Obj.repr(
# 321 "src/aorai/yaparser.mly"
( _2 )
# 718 "src/aorai/yaparser.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(
# 329 "src/aorai/yaparser.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)
)
# 732 "src/aorai/yaparser.ml"
: 'access))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 3 : 'access) in
let _3 = (Parsing.peek_val __caml_parser_env 1 : 'access_or_const) in
Obj.repr(
# 338 "src/aorai/yaparser.mly"
( Cil.addOffsetLval (Cil_types.Index (_3,Cil_types.NoOffset)) _1)
# 740 "src/aorai/yaparser.ml"
: 'access))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'access_leaf) in
Obj.repr(
# 339 "src/aorai/yaparser.mly"
(_1)
# 747 "src/aorai/yaparser.ml"
: 'access))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'access) in
Obj.repr(
# 344 "src/aorai/yaparser.mly"
( Aorai_option.fatal "NOT YET IMPLEMENTED : *A dereferencement access." )
# 754 "src/aorai/yaparser.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(
# 346 "src/aorai/yaparser.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
)
# 788 "src/aorai/yaparser.ml"
: 'access_leaf))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 374 "src/aorai/yaparser.mly"
( Cil.var ( Data_for_aorai.get_varinfo _1) )
# 795 "src/aorai/yaparser.ml"
: 'access_leaf))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 1 : 'access) in
Obj.repr(
# 376 "src/aorai/yaparser.mly"
( _2 )
# 802 "src/aorai/yaparser.ml"
: 'access_leaf))
; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
|]