maat::VarContext class

A context that associates concrete values to symbolic variables

❱   Base classes

class Serializable
Virtual interface that serializable classes must implement.

❱   Constructors, destructors, conversion operators

VarContext(unsigned int id = 0)
Constructor.

❱   Public functions

void set(const std::string& var, cst_t value)
Give a concrete value to a symbolic variable.

void set(const std::string& var, const Number& number)
Give a concrete value to a symbolic variable as a maat::Number instance.

auto get(const std::string& var) const -> cst_t
Get the concrete value given to a symbolic variable.

void remove(const std::string& var)
Remove concrete value for symbolic variable.

auto contains(const std::string& var) const -> bool
Return true if a concrete value is associated to the symbolic variable.

auto new_symbolic_buffer(const std::string& name, int nb_elems, int elem_size = 1, std::optional<cst_t> trailing_value = std::nullopt) -> std::vector<Value>
Create a new buffer of symbolic variables.

auto new_concolic_buffer(const std::string& name, const std::vector<cst_t>& concrete_buffer, int nb_elems = -1, int elem_size = 1, std::optional<cst_t> trailing_value = std::nullopt) -> std::vector<Value>
Create a new buffer of concolic variables.

auto new_concolic_buffer(const std::string& name, const std::string& concrete_buffer, std::optional<cst_t> trailing_value = std::nullopt) -> std::vector<Value>
Create a new buffer of concolic variables.

void update_from(VarContext& other)
Copy the mapping between concrete values and symbolic variables from 'other'.

void print(std::ostream& os) const
Print the context to a stream.

auto class_uid() const -> serial::uid_t virtual
Return the class uid (see ClassId enum)

void dump(serial::Serializer&) const virtual
Dump the object contents in a serializer stream.

void load(serial::Deserializer&) virtual
Restore an object from a deserializer stream.

❱   Public variables

unsigned int id
Unique identifier for the VarContext instance.

❱   Function documentation

std::vector<Value> maat::VarContext::new_symbolic_buffer(const std::string& name, int nb_elems, int elem_size = 1, std::optional<cst_t> trailing_value = std::nullopt)

Create a new buffer of symbolic variables.

Parameters
name Base name after whom to name variables
nb_elems Number of variables in the buffer
elem_size Size in bytes of each variable
trailing_value Optional concrete value to add at the end of the buffer (not counted by 'nb_elems')

std::vector<Value> maat::VarContext::new_concolic_buffer(const std::string& name, const std::vector<cst_t>& concrete_buffer, int nb_elems = -1, int elem_size = 1, std::optional<cst_t> trailing_value = std::nullopt)

Create a new buffer of concolic variables.

Parameters
name Base name after whom to name variables
concrete_buffer The concrete values with whom to initialize variables
nb_elems Number of variables in the buffer
elem_size Size in bytes of each variable
trailing_value Optional concrete value to add at the end of the buffer (not counted by 'nb_elems')

std::vector<Value> maat::VarContext::new_concolic_buffer(const std::string& name, const std::string& concrete_buffer, std::optional<cst_t> trailing_value = std::nullopt)

Create a new buffer of concolic variables.

Parameters
name Base name after whom to name variables
concrete_buffer The concrete values with whom to initialize variables
trailing_value Optional concrete value to add at the end of the buffer (not counted by 'nb_elems')

void maat::VarContext::update_from(VarContext& other)

Copy the mapping between concrete values and symbolic variables from 'other'.

  • If a variable is contained in both 'other' and this context, it takes the value that it has in 'other'.
  • If a variable is contained only in 'other', it is added to this context.
  • Variables present in this context but not in 'other' are kept as they are