Module StateVar
State variables
Every state variable is associated with an uninterpreted function symbol that is substituted for the state variable when creating expressions for the SMT solvers.
State variables do not occur directly in terms, but as instances in a particular state, see Var.
- author
- Christoph Sticksel
Types and hash-consing
Hashtables, maps and sets
val hash_state_var : t -> intHashing function on state variables
module StateVarHashtbl : Stdlib.Hashtbl.S with type StateVarHashtbl.key = tHash table over state variables
module StateVarSet : sig ... endSet over state variables
module StateVarMap : Stdlib.Map.S with type StateVarMap.key = tMap over state variables
Constructor
val mk_state_var : ?is_input:bool -> ?is_const:bool -> ?for_inv_gen:bool -> string -> string list -> Type.t -> tmk_state_var n s tdeclares a state variable of namenwith scopes, and typet. The optional labeled arguments?is_input,?is_constand?for_inv_genflag the variable as an input, as constant and as usable as a candidate for invariant generation, respectively. Their defaults arefalse,falseandtrue.Declaring a state variable again with the same signature is harmless and will simply return the previously declared state variable. However, re-declaring a state variable with a different signature will raise an
Invalid_argumentexception.
val mk_init_flag : string list -> tCreates a scoped init flag.
val mk_depth_input : string list -> tCreates a scoped depth input.
val mk_max_depth_input : string list -> tCreates a scoped depth input.
Accessor functions
val state_var_of_string : (string * string list) -> tReturn a previously declared state variable
val state_var_of_long_string : string -> tReturn a previously declared state variable from a string consisting of the concatenation of all scopes and the state variable. Raises
Not_foundif it was not previously declared.
val name_of_state_var : t -> stringReturn the name of the state variable
val scope_of_state_var : t -> string listReturn the scope of the state variable
val uf_symbol_of_state_var : t -> UfSymbol.tReturn the uninterpreted function symbol of the variable
val state_var_of_uf_symbol : UfSymbol.t -> tReturn the state variable corresponding to an uninterpreted function symbol
val is_input : t -> boolReturn true if the state variable is an input
val is_const : t -> boolReturn true if the state variable is constant
val for_inv_gen : t -> boolReturn true if state variable is to be used in invariant generation
val set_for_inv_gen : bool -> t -> unitSet or unset flag to use state variable in invariant generation
Iterators over defined state variables
val fold : (t -> 'a -> 'a) -> 'a -> 'afold f acomputes(f sN tN uN ... (f s2 t2 u2 (f s1 t1 u1 a))...), wheresI,tIanduI, respectively are the name of the state variable, its types and its associated uninterpreted function symbol.
val iter : (t -> unit) -> unititer fcallsf s t ufor every state variable withsbeing the name of the variable,tits type anduits associated uninterpreted function symbol.
val encode_select : t -> UfSymbol.tencode array select operation. Encoding select funtion is done byt type (i.e. one select by array type). The select function performs all projections if the array is multidimensional. This means you should have something like
(select_1 m 0 3)in casemis a matrix
val get_select_ufs : unit -> UfSymbol.t listReturn select function that were created
Pretty-printing
val pp_print_state_var : Stdlib.Format.formatter -> t -> unitPretty-print a state variable
val string_of_state_var : t -> stringReturn a string representation of a symbol