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(
# 116 "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
if Hashtbl.length prefetched_states >0 then
begin
let r = Hashtbl.fold
(fun s n _ -> s^"Error: the state '"^n^"' is used but never defined.\n")
prefetched_states
""
in
Aorai_option.abort "%s" r
end;
Data_for_aorai.setLtl_expressions observed_expressions;
Logic_simplification.setLtl_expressions observed_expressions;
let n=ref 0 in
let (transitions,pcondsl) = Logic_simplification.simplifyTrans _2 in
let conds = Array.make (List.length transitions) [] in
List.iter2 (fun t pc -> t.numt<-(!n); conds.(!n)<-pc; n:=!n+1) transitions pcondsl;
Data_for_aorai.setCondOfParametrizedTransition conds;
((states , transitions),observed_vars,observed_funcs)
)
# 374 "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(
# 174 "src/aorai/yaparser.mly"
( _1@[_2] )
# 382 "src/aorai/yaparser.ml"
: 'options))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'option) in
Obj.repr(
# 175 "src/aorai/yaparser.mly"
( [_1] )
# 389 "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(
# 179 "src/aorai/yaparser.mly"
( (_2, _4) )
# 397 "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(
# 183 "src/aorai/yaparser.mly"
( _1@[_3] )
# 405 "src/aorai/yaparser.ml"
: 'opt_identifiers))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 184 "src/aorai/yaparser.mly"
( [_1] )
# 412 "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(
# 192 "src/aorai/yaparser.mly"
( _1@_2 )
# 420 "src/aorai/yaparser.ml"
: 'states))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'state) in
Obj.repr(
# 193 "src/aorai/yaparser.mly"
( _1 )
# 427 "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(
# 198 "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))
)
# 462 "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(
# 230 "src/aorai/yaparser.mly"
( _1@[_3] )
# 470 "src/aorai/yaparser.ml"
: 'transitions))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'transition) in
Obj.repr(
# 231 "src/aorai/yaparser.mly"
( [_1] )
# 477 "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(
# 236 "src/aorai/yaparser.mly"
( (Pred _2, prefetch_and_create_state _5) )
# 485 "src/aorai/yaparser.ml"
: 'transition))
; (fun __caml_parser_env ->
let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 237 "src/aorai/yaparser.mly"
((Otherwise, prefetch_and_create_state _3) )
# 492 "src/aorai/yaparser.ml"
: 'transition))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 238 "src/aorai/yaparser.mly"
( (Pred PTrue, prefetch_and_create_state _2) )
# 499 "src/aorai/yaparser.ml"
: 'transition))
; (fun __caml_parser_env ->
let _3 = (Parsing.peek_val __caml_parser_env 1 : string) in
Obj.repr(
# 245 "src/aorai/yaparser.mly"
( if not (Hashtbl.mem observed_funcs _3) then Hashtbl.add observed_funcs _3 _3 ; PCallOrReturn _3 )
# 506 "src/aorai/yaparser.ml"
: 'guard))
; (fun __caml_parser_env ->
let _3 = (Parsing.peek_val __caml_parser_env 1 : string) in
Obj.repr(
# 247 "src/aorai/yaparser.mly"
( if not (Hashtbl.mem observed_funcs _3) then Hashtbl.add observed_funcs _3 _3 ; PCall _3 )
# 513 "src/aorai/yaparser.ml"
: 'guard))
; (fun __caml_parser_env ->
let _3 = (Parsing.peek_val __caml_parser_env 1 : string) in
Obj.repr(
# 249 "src/aorai/yaparser.mly"
( if not (Hashtbl.mem observed_funcs _3) then Hashtbl.add observed_funcs _3 _3 ; PReturn _3 )
# 520 "src/aorai/yaparser.ml"
: 'guard))
; (fun __caml_parser_env ->
Obj.repr(
# 251 "src/aorai/yaparser.mly"
( PTrue )
# 526 "src/aorai/yaparser.ml"
: 'guard))
; (fun __caml_parser_env ->
Obj.repr(
# 253 "src/aorai/yaparser.mly"
( PFalse )
# 532 "src/aorai/yaparser.ml"
: 'guard))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'guard) in
Obj.repr(
# 255 "src/aorai/yaparser.mly"
( PNot _2 )
# 539 "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(
# 257 "src/aorai/yaparser.mly"
( PAnd (_1,_3) )
# 547 "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(
# 259 "src/aorai/yaparser.mly"
( POr (_1,_3) )
# 555 "src/aorai/yaparser.ml"
: 'guard))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 1 : 'guard) in
Obj.repr(
# 261 "src/aorai/yaparser.mly"
( _2 )
# 562 "src/aorai/yaparser.ml"
: 'guard))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'logic_relation) in
Obj.repr(
# 263 "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
)
# 590 "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(
# 292 "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),
new_exp(Cil_types.BinOp(Cil_types.Eq, _1 , _3 , Cil.intType)) ) )
# 601 "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(
# 296 "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),
new_exp(Cil_types.BinOp(Cil_types.Lt, _1 , _3 , Cil.intType)) ) )
# 612 "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(
# 300 "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),
new_exp(Cil_types.BinOp(Cil_types.Gt, _1 , _3 , Cil.intType)) ) )
# 623 "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(
# 304 "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),
new_exp(Cil_types.BinOp(Cil_types.Le, _1 , _3 , Cil.intType)) ) )
# 634 "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(
# 308 "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),
new_exp(Cil_types.BinOp(Cil_types.Ge, _1 , _3 , Cil.intType) )) )
# 645 "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(
# 312 "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),
new_exp(Cil_types.BinOp(Cil_types.Ne, _1 , _3 , Cil.intType) )) )
# 656 "src/aorai/yaparser.ml"
: 'logic_relation))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'arith_relation) in
Obj.repr(
# 316 "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) )
# 666 "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(
# 324 "src/aorai/yaparser.mly"
(
new_exp (Cil_types.BinOp(Cil_types.PlusA, _1 , _3 , Cil.intType)) )
# 675 "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(
# 326 "src/aorai/yaparser.mly"
(
new_exp (Cil_types.BinOp(Cil_types.MinusA, _1 , _3 , Cil.intType)) )
# 684 "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(
# 328 "src/aorai/yaparser.mly"
( _1 )
# 691 "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(
# 333 "src/aorai/yaparser.mly"
(
new_exp (Cil_types.BinOp(Cil_types.Div, _1 , _3 , Cil.intType)) )
# 700 "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(
# 335 "src/aorai/yaparser.mly"
(
new_exp (Cil_types.BinOp(Cil_types.Mult, _1 , _3 , Cil.intType)) )
# 709 "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(
# 337 "src/aorai/yaparser.mly"
(
new_exp (Cil_types.BinOp(Cil_types.Mod, _1 , _3 , Cil.intType)) )
# 718 "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(
# 339 "src/aorai/yaparser.mly"
( _1 )
# 725 "src/aorai/yaparser.ml"
: 'arith_relation_mul))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 345 "src/aorai/yaparser.mly"
( new_exp (Cil_types.Const(Cil_types.CInt64(Int64.of_string _1,Cil_types.IInt, Some(_1)))))
# 732 "src/aorai/yaparser.ml"
: 'access_or_const))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 347 "src/aorai/yaparser.mly"
( new_exp (Cil_types.Const(Cil_types.CInt64(Int64.of_string ("-"^_2),Cil_types.IInt, Some("-"^_2)))))
# 739 "src/aorai/yaparser.ml"
: 'access_or_const))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'access) in
Obj.repr(
# 349 "src/aorai/yaparser.mly"
( new_exp (Cil_types.Lval(_1)) )
# 746 "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(
# 351 "src/aorai/yaparser.mly"
( _2 )
# 753 "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(
# 359 "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)
)
# 767 "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(
# 368 "src/aorai/yaparser.mly"
( Cil.addOffsetLval (Cil_types.Index (_3,Cil_types.NoOffset)) _1)
# 775 "src/aorai/yaparser.ml"
: 'access))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'access_leaf) in
Obj.repr(
# 369 "src/aorai/yaparser.mly"
(_1)
# 782 "src/aorai/yaparser.ml"
: 'access))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'access) in
Obj.repr(
# 374 "src/aorai/yaparser.mly"
( Aorai_option.fatal "NOT YET IMPLEMENTED : *A dereferencement access." )
# 789 "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(
# 376 "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
)
# 823 "src/aorai/yaparser.ml"
: 'access_leaf))
; (fun __caml_parser_env ->
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
Obj.repr(
# 404 "src/aorai/yaparser.mly"
( Cil.var ( Data_for_aorai.get_varinfo _1) )
# 830 "src/aorai/yaparser.ml"
: 'access_leaf))
; (fun __caml_parser_env ->
let _2 = (Parsing.peek_val __caml_parser_env 1 : 'access) in
Obj.repr(
# 406 "src/aorai/yaparser.mly"
( _2 )
# 837 "src/aorai/yaparser.ml"
: 'access_leaf))
; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
|]