Module Var
Variables in terms
A variable is an instance of a state variable (see StateVar) in a state relative to an initial state. A variable can also be a free variable that is to be bound in a let expression.
- author
- Christoph Sticksel
Types and hash-consing
Hashtables, maps and sets
val hash_var : t -> intHashing function on variables
module VarHashtbl : Stdlib.Hashtbl.S with type VarHashtbl.key = tHash table over variables
Constructors
val mk_const_state_var : StateVar.t -> tReturn a constant state variable.
The state variable must be constant.
val mk_state_var_instance : StateVar.t -> Numeral.t -> tReturn an instance of a state variable.
The state variable may also be constant, in which case a variable created by
mk_const_state_varis returned.
Accessor functions
val state_var_of_state_var_instance : t -> StateVar.tReturn the state variable of a state variable instance
val is_state_var_instance : t -> boolReturn true if the variable is an instance of a state variable
val is_const_state_var : t -> boolReturn true if the variable is a constant state variable
val is_free_var : t -> boolReturn true if the variable is a free variable
Construct Variables of Variables
val bump_offset_of_state_var_instance : t -> Numeral.t -> tReturn a new variable with the offset of the state variable instance incremented by the given value
bump_offset_of_state_var_instance v ireturns a new variable, where the valueiis added to the offset of thevif it is a state variable instance. The valueimay be negative.If
vis a constant state variable or a free variable, it is returned unchanged.
val set_offset_of_state_var_instance : t -> Numeral.t -> tReturn a new variable with the offset of the state variable instance set to the given value
set_offset_of_state_var_instance v ireturns a new variable, where the offset of the state variablevis set toi, ifvis a state variable instance.If
vis a constant state variable or a free variable, it is returned unchanged.
val map_state_var : (StateVar.t -> StateVar.t) -> t -> tReturn a new variable with the state variable replaced
map_state_var v freturns a new variable where the state variablesis replaced by the result of the evaluationf sifvis a state variable instance or a constant state variable.If
vis a free variable, it is returned unchanged.
Pretty-printing
val pp_print_var : Stdlib.Format.formatter -> t -> unitPretty-print a hashconsed variable
val print_var : t -> unitPretty-print a hashconsed variable to the standard formatter
val string_of_var : t -> stringReturn a string representation of a hashconsed variable
val stats : unit -> int * int * int * int * int * intval state_var_instance_of_symbol : Symbol.t -> tGets the state var instance associated with a constant unrolled uf. Throws
Not_foundif the uf is unknown.
val state_var_instance_of_uf_symbol : UfSymbol.t -> tGets the state var instance associated with a constant unrolled uf. Throws
Not_foundif the uf is unknown.
val unrolled_uf_of_state_var_instance : t -> UfSymbol.tval declare_constant_vars : (UfSymbol.t -> unit) -> t list -> unitDeclares constant variables as constant ufsymbols using the provided function.
val declare_vars : (UfSymbol.t -> unit) -> t list -> unitDeclares non constant variables as constant ufsymbols using the provided function.
val encode_select : t -> UfSymbol.tencode array select operation