Module CCHLibTypes

Machine sizes

Adapted from the automatically generated machdep in CIL

type machine_sizes_t = {
  1. sizeof_short : XprTypes.xpr_t;
  2. sizeof_int : XprTypes.xpr_t;
  3. sizeof_bool : XprTypes.xpr_t;
  4. sizeof_long : XprTypes.xpr_t;
  5. sizeof_longlong : XprTypes.xpr_t;
  6. sizeof_int128 : XprTypes.xpr_t;
  7. sizeof_ptr : XprTypes.xpr_t;
  8. sizeof_enum : XprTypes.xpr_t;
  9. sizeof_float : XprTypes.xpr_t;
  10. sizeof_double : XprTypes.xpr_t;
  11. sizeof_longdouble : XprTypes.xpr_t;
  12. sizeof_complex_float : XprTypes.xpr_t;
  13. sizeof_complex_double : XprTypes.xpr_t;
  14. sizeof_complex_longdouble : XprTypes.xpr_t;
  15. sizeof_void : XprTypes.xpr_t;
  16. sizeof_fun : XprTypes.xpr_t;
  17. alignof_short : XprTypes.xpr_t;
  18. alignof_int : XprTypes.xpr_t;
  19. alignof_bool : XprTypes.xpr_t;
  20. alignof_long : XprTypes.xpr_t;
  21. alignof_longlong : XprTypes.xpr_t;
  22. alignof_int128 : XprTypes.xpr_t;
  23. alignof_ptr : XprTypes.xpr_t;
  24. alignof_enum : XprTypes.xpr_t;
  25. alignof_float : XprTypes.xpr_t;
  26. alignof_double : XprTypes.xpr_t;
  27. alignof_longdouble : XprTypes.xpr_t;
  28. alignof_complex_float : XprTypes.xpr_t;
  29. alignof_complex_double : XprTypes.xpr_t;
  30. alignof_complex_longdouble : XprTypes.xpr_t;
  31. alignof_str : XprTypes.xpr_t;
  32. alignof_fun : XprTypes.xpr_t;
  33. alignof_aligned : XprTypes.xpr_t;
}
type max_sizes_t = {
  1. sizeof_int : int;
  2. sizeof_float : int;
  3. sizeof_void : int;
  4. sizeof_ptr : int;
  5. sizeof_fun : int;
  6. sizeof_enum : int;
}
class type type_range_int = object ... end
class type 'a sumtype_string_converter_int = object ... end

Dictionary

type constantstring = string * bool * int
class type cdictionary_int = object ... end

Declarations

class type cdeclarations_int = object ... end

Context

class type cfg_context_int = object ... end
class type exp_context_int = object ... end
class type program_context_int = object ... end
class type ccontexts_int = object ... end

Environments

class type file_environment_int = object ... end

Transformers

class type exp_transformer_int = object ... end
class type exp_walker_int = object ... end

Function summary

type api_parameter_t =
  1. | ParFormal of int
  2. | ParGlobal of string
type s_offset_t =
  1. | ArgNoOffset
  2. | ArgFieldOffset of string * s_offset_t
  3. | ArgIndexOffset of CHNumerical.numerical_t * s_offset_t
type s_term_t =
  1. | ArgValue of api_parameter_t * s_offset_t
  2. | LocalVariable of string
  3. | ExternalState of string
  4. | ReturnValue
  5. | NamedConstant of string
  6. | NumConstant of CHNumerical.numerical_t
  7. | IndexSize of s_term_t
  8. | ByteSize of s_term_t
  9. | ArgAddressedValue of s_term_t * s_offset_t
  10. | ArgNullTerminatorPos of s_term_t
  11. | ArgSizeOfType of s_term_t
  12. | ArithmeticExpr of CCHBasicTypes.binop * s_term_t * s_term_t
  13. | FormattedOutputSize of s_term_t
  14. | Region of s_term_t
  15. | RuntimeValue
  16. | ChoiceValue of s_term_t option * s_term_t option
type xpredicate_t =
  1. | XAllocationBase of s_term_t
    (*

    term points to start of allocated region that can be freed

    *)
  2. | XControlledResource of string * s_term_t
    (*

    term is not/must not be tainted

    *)
  3. | XBlockWrite of s_term_t * s_term_t
    (*

    unstructured write of bytes to pointed adress with given length (used as a side effect)

    *)
  4. | XBuffer of s_term_t * s_term_t
    (*

    XBuffer (t1, t2): t1 points to a memory region with at least t2 bytes after pointer

    *)
  5. | XConfined of s_term_t
    (*

    pointer expression is out of scope without leaking references

    *)
  6. | XConstTerm of s_term_t
    (*

    pointed to term is not modified

    *)
  7. | XFormattedInput of s_term_t
    (*

    term corresponds to argument that provides the format string

    *)
  8. | XFalse
    (*

    always false, used as post condition

    *)
  9. | XFreed of s_term_t
    (*

    term pointed to is freed

    *)
  10. | XFunctional
    (*

    function has no observable side effects

    *)
  11. | XInitialized of s_term_t
    (*

    lval denoted is initialized

    *)
  12. | XInitializedRange of s_term_t * s_term_t
    (*

    term pointed to is initialized for t2 length

    *)
  13. | XInitializesExternalState of s_term_t * s_term_t
    (*

    term t2 initializes the external state denoted by t1

    *)
  14. | XExternalStateValue of s_term_t * s_term_t
    (*

    term t1 has the same value as the external state denoted by t2

    *)
  15. | XInputFormatString of s_term_t
    (*

    term points to scanf format string

    *)
  16. | XInvalidated of s_term_t
    (*

    term pointed to may not be valid any more

    *)
  17. | XNewMemory of s_term_t
    (*

    term points to newly allocated memory (since the start of the function), stack or heap

    *)
  18. | XStackAddress of s_term_t
    (*

    term points to stack memory

    *)
  19. | XHeapAddress of s_term_t
    (*

    term points to heap memory

    *)
  20. | XGlobalAddress of s_term_t
    (*

    term points to global memory

    *)
  21. | XNoOverlap of s_term_t * s_term_t
    (*

    the two pointed-to memory regions do not overlap

    *)
  22. | XNotNull of s_term_t
    (*

    term is not null

    *)
  23. | XNull of s_term_t
    (*

    term is null

    *)
  24. | XNotZero of s_term_t
    (*

    term is not zero

    *)
  25. | XNonNegative of s_term_t
    (*

    term is not negative

    *)
  26. | XNullTerminated of s_term_t
    (*

    term pointed to is null-terminated

    *)
  27. | XOutputFormatString of s_term_t
    (*

    term points to printf format string

    *)
  28. | XPreservesAllMemory
    (*

    function does not free any external memory

    *)
  29. | XPreservesAllMemoryX of s_term_t list
    (*

    function does not free any external memory except given terms

    *)
  30. | XPreservesMemory of s_term_t
    (*

    function does not free pointed to memory

    *)
  31. | XPreservesValue of s_term_t
    (*

    function does not modify the value of s_term

    *)
  32. | XPreservesNullTermination
    (*

    function does not strip null-terminating bytes

    *)
  33. | XPreservesValidity of s_term_t
    (*

    validity of pointed to resource is maintained

    *)
  34. | XRelationalExpr of CCHBasicTypes.binop * s_term_t * s_term_t
  35. | XRepositioned of s_term_t
    (*

    term pointed to may be freed and reassigned

    *)
  36. | XRevBuffer of s_term_t * s_term_t
    (*

    term points to memory region with at least t2 bytes before pointer

    *)
  37. | XTainted of s_term_t * s_term_t option * s_term_t option
    (*

    value of term is externally controlled with optional lower and upper bound

    *)
  38. | XUniquePointer of s_term_t
    (*

    pointer reference is the only one

    *)
  39. | XValidMem of s_term_t
    (*

    pointed-to memory has not been freed (at time of delivery)

    *)
  40. | XPolicyPre of s_term_t * string * string list
    (*

    the term has to be in one of the given states

    *)
  41. | XPolicyValue of s_term_t * string * string option
    (*

    the term is a newly created policy value and optionally makes a first transition

    *)
  42. | XPolicyTransition of s_term_t * string * string
    (*

    the term transitions according to a named transition in the policy

    *)

predicate used in representation of external conditions

type postrequest_t = int * xpredicate_t
type postassume_t = int * xpredicate_t
type summary_annotation_t =
  1. | ExternalCondition of string
  2. | EnvironmentCondition of string
  3. | UnmodeledArgumentDependency of string
  4. | NoAnnotation
type annotated_xpredicate_t = xpredicate_t * summary_annotation_t
type ds_condition_t = {
  1. dsc_name : string;
  2. dsc_ckey : int;
  3. dsc_fields : xpredicate_t list;
}
type function_summary_t = {
  1. fs_fname : string;
  2. fs_domainref : (string * string) option;
  3. fs_params : (string * int) list;
  4. fs_preconditions : annotated_xpredicate_t list;
  5. fs_postconditions : annotated_xpredicate_t list;
  6. fs_error_postconditions : annotated_xpredicate_t list;
  7. fs_sideeffects : annotated_xpredicate_t list;
}
class type function_summary_library_int = object ... end

Interface dictionary

class type interface_dictionary_int = object ... end

Contracts

type contract_instr_t =
  1. | SetVar of int * s_term_t * s_term_t
type contract_note_t = {
  1. cn_tag : string;
  2. cn_prq : string;
  3. cn_txt : string;
}
class type function_contract_int = object ... end
class type globalvar_contract_int = object ... end
class type file_contract_int = object ... end
class type global_contract_int = object ... end

System settings

type analysis_level_t =
  1. | UndefinedBehavior
    (*

    only indicate undefined behavior (Red)

    *)
  2. | ImplementationDefinedBehavior
    (*

    indicate undefined behavior and implementation defined behavior (Red,Purple) (default)

    *)
  3. | ValueWrapAround
    (*

    indicate undefined behavior, implementation-defined behavior, and value wrap around of unsigned integers (Red, Purple, Blue)

    *)
class type system_settings_int = object ... end

Paths and analysis options