123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163(**************************************************************************)(* *)(* This file is part of Aorai plug-in of Frama-C. *)(* *)(* Copyright (C) 2007-2023 *)(* CEA (Commissariat à l'énergie atomique et aux énergies *)(* alternatives) *)(* INRIA (Institut National de Recherche en Informatique et en *)(* Automatique) *)(* INSA (Institut National des Sciences Appliquees) *)(* *)(* you can redistribute it and/or modify it under the terms of the GNU *)(* Lesser General Public License as published by the Free Software *)(* Foundation, version 2.1. *)(* *)(* It is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU Lesser General Public License for more details. *)(* *)(* See the GNU Lesser General Public License version 2.1 *)(* for more details (enclosed in the file licenses/LGPLv2.1). *)(* *)(**************************************************************************)(** The abstract tree of Ya representation. Such tree is used by
parser/lexer before its translation into Data_for_aorai module. *)typeexpression=|PVarofstring|PPrmofstring*string(* f().N *)|PMetavarofstring|PCstofLogic_ptree.constant|PBinopofLogic_ptree.binop*expression*expression|PUnopofLogic_ptree.unop*expression|PArrgetofexpression*expression|PFieldofexpression*string|PArrowofexpression*stringtypecondition=|PRelofLogic_ptree.relation*expression*expression|PTrue|PFalse|POrofcondition*condition|PAndofcondition*condition|PNotofcondition|PCallofstring*stringoption(** Call might be done in a given behavior *)|PReturnofstringandseq_elt={condition:conditionoption;nested:sequence;min_rep:expressionoption;max_rep:expressionoption;}andsequence=seq_eltlist(** Ya parsed abstract syntax trees. Either a sequence of event or the
otherwise keyword. A single condition is expressed with a singleton
having an empty nested sequence and min_rep and max_rep being equal to one.
*)typeguard=Seqofsequence|Otherwisetypeaction=|Metavar_assignofstring*expressiontypetyped_condition=|TOroftyped_condition*typed_condition(** Logical OR *)|TAndoftyped_condition*typed_condition(** Logical AND *)|TNotoftyped_condition(** Logical NOT *)|TCallofCil_types.kernel_function*Cil_types.funbehavioroption(** Predicate modelling the call of an operation *)|TReturnofCil_types.kernel_function(** Predicate modelling the return of an operation *)|TTrue(** Logical constant TRUE *)|TFalse(** Logical constant FALSE *)|TRelofCil_types.relation*Cil_types.term*Cil_types.term(** Condition. If one of the terms contains TResult, TRel is in
conjunction with exactly one TReturn event, and the TResult is
tied to the corresponding value.
*)(** Additional actions to perform when crossing a transition.
There is at most one Pebble_* action for each transition, and
each transition leading to a state with multi-state has such an action.
*)typetyped_action=|Counter_initofCil_types.term_lval|Counter_incrofCil_types.term_lval|Pebble_initofCil_types.logic_info*Cil_types.logic_var*Cil_types.logic_var(** adds a new pebble. [Pebble_init(set,aux,count)] indicates that
pebble [count] is put in [set] whose content is governed by C
variable [aux].
*)|Pebble_moveofCil_types.logic_info*Cil_types.logic_var*Cil_types.logic_info*Cil_types.logic_var(** [Pebble_move(new_set,new_aux,old_set,old_aux)]
moves pebbles from [old_set] to [new_set], governed by the
corresponding aux variables. *)|Copy_valueofCil_types.term_lval*Cil_types.term(** copy the current value of the given term into the given location
so that it can be accessed by a later state. *)(** Internal representation of a State from the Buchi automata. *)typestate={name:string;(** State name *)mutableacceptation:Bool3.t;(** True iff state is an acceptation state *)mutableinit:Bool3.t;(** True iff state is an initial state *)mutablenums:int;(** Numerical ID of the state *)mutablemulti_state:(Cil_types.logic_info*Cil_types.logic_var)option;(** Translation of some sequences might lead to some kind of pebble
automaton, where we need to distinguish various branches. This is
done by having a set of pebbles instead of just a zero/one switch
to know if we are in the given state. The guards apply to each
active pebble and are thus of the form
\forall integer x; in(x,multi_state) ==> guard.
multi_state is the first lvar of the pair, x is the second
*)}(** Internal representation of a transition from the Buchi automata. *)type('c,'a)trans={start:state;(** Starting state of the transition *)stop:state;(** Ending state of the transition *)mutablecross:'c;(** Cross condition of the transition *)mutableactions:'alist;(** Actions to execute while crossing *)mutablenumt:int(** Numerical ID of the transition *)}type('c,'a)graph=statelist*('c,'a)translisttypeparsed_trans=(guard,action)transtypetyped_trans=(typed_condition,typed_action)trans(** Internal representation of a Buchi automata : a list of states and a list
of transitions.*)type('c,'a)automaton={states:statelist;trans:('c,'a)translist;metavariables:Cil_types.varinfoDatatype.String.Map.t;observables:Datatype.String.Set.toption;}typeparsed_automaton=(guard,action)automatontypetyped_automaton=(typed_condition,typed_action)automaton(** An operation can have two status: currently calling or returning. *)typefuncStatus=|Call|Return(*
Local Variables:
compile-command: "make -C ../../.."
End:
*)