CBMC
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
string_set_char_builtin_functiont Class Reference

Setting a character at a particular position of a string. More...

#include <string_builtin_function.h>

+ Inheritance diagram for string_set_char_builtin_functiont:
+ Collaboration diagram for string_set_char_builtin_functiont:

Public Member Functions

  Constructor from arguments of a function application.
 
std::optional< exprteval (const std::function< exprt(const exprt &)> &get_value) const override
  Given a function get_value which gives a valuation to expressions, attempt to find the result of the builtin function.
 
std::string  name () const override
 
  Set of constraints ensuring that result is similar to input where the character at index position is set to character.
 
  Constraint ensuring that the length of the strings are coherent with the function call.
 
- Public Member Functions inherited from string_transformation_builtin_functiont
 
  Constructor from arguments of a function application.
 
 
 
  Tells whether the builtin function can be a testing function, that is a function that does not return a string, for instance like equals, indexOf or compare.
 
- Public Member Functions inherited from string_builtin_functiont
 
 
 

Public Attributes

 
 
- Public Attributes inherited from string_transformation_builtin_functiont
 
 
- Public Attributes inherited from string_builtin_functiont
 

Additional Inherited Members

- Protected Member Functions inherited from string_builtin_functiont
 
- Protected Attributes inherited from string_builtin_functiont
 

Detailed Description

Setting a character at a particular position of a string.

Definition at line 208 of file string_builtin_function.h.

Constructor & Destructor Documentation

◆  string_set_char_builtin_functiont()

string_set_char_builtin_functiont::string_set_char_builtin_functiont ( const exprtreturn_code,
const std::vector< exprt > &  fun_args,
array_pooltarray_pool 
)
inline

Constructor from arguments of a function application.

The arguments in fun_args should be in order: an integer result.length, a character pointer &result[0], a string arg1 of type refined_string_typet, a position and a character.

Definition at line 219 of file string_builtin_function.h.

Member Function Documentation

◆  constraints()

string_constraintst string_set_char_builtin_functiont::constraints ( string_constraint_generatortgenerator,
message_handlertmessage_handler 
) const
overridevirtual

Set of constraints ensuring that result is similar to input where the character at index position is set to character.

If position is out of bounds, input and result are identical. These constraints are:

  1. res.length = str.length && return_code = (position >= res.length || position < 0) ? 1 : 0
  2. 0 <= pos < res.length ==> res[pos]=char
  3. forall 0 <= i < max(0, min(res.length, pos)). res[i] = str[i]
  4. forall max(0, pos+1) <= i < res.length. res[i] = str[i]

Implements string_builtin_functiont.

Definition at line 154 of file string_builtin_function.cpp.

◆  eval()

std::optional< exprt > string_set_char_builtin_functiont::eval ( const std::function< exprt(const exprt &)> &  get_value ) const
overridevirtual

Given a function get_value which gives a valuation to expressions, attempt to find the result of the builtin function.

If not enough information can be gathered from get_value, return an empty optional.

Implements string_builtin_functiont.

Definition at line 129 of file string_builtin_function.cpp.

◆  length_constraint()

exprt string_set_char_builtin_functiont::length_constraint ( ) const
overridevirtual

Constraint ensuring that the length of the strings are coherent with the function call.

Implements string_builtin_functiont.

Definition at line 191 of file string_builtin_function.cpp.

◆  name()

std::string string_set_char_builtin_functiont::name ( ) const
inlineoverridevirtual

Implements string_builtin_functiont.

Definition at line 233 of file string_builtin_function.h.

Member Data Documentation

◆  character

exprt string_set_char_builtin_functiont::character

Definition at line 213 of file string_builtin_function.h.

◆  position

exprt string_set_char_builtin_functiont::position

Definition at line 212 of file string_builtin_function.h.


The documentation for this class was generated from the following files:

AltStyle によって変換されたページ (->オリジナル) /