cozy.claripy_ext

Module Contents

Functions

twos_comp_range_constraint(→ claripy.ast.Bool)

Generates a constraint which bounds the input argument in range [low, high), assuming a two's complement representation.

simplify_kb(→ claripy.ast.bits)

Simplifies a claripy AST expression, given some knowledge base (kb) of information

cozy.claripy_ext.twos_comp_range_constraint(x: claripy.ast.bits, low: int, high: int) claripy.ast.Bool

Generates a constraint which bounds the input argument in range [low, high), assuming a two’s complement representation.

Parameters:
  • x (clairpy.ast.bits) – The bits to constrain. Typically, this is a symbolic bitvector.

  • low (int) – The lower bound on the range. This number may be negative.

  • high (int) – The upper bound on the range.

cozy.claripy_ext.simplify_kb(expr: claripy.ast.bits, kb: claripy.ast.Bool) claripy.ast.bits

Simplifies a claripy AST expression, given some knowledge base (kb) of information

Parameters:
  • expr (claripy.ast.bits) – The expression to simplify

  • kb (claripy.ast.Bool) – The knowledge base which is used to simplify the expr. This is typically a series of equalities conjoined together.

Returns:

A simplified version of the input expression, or the original expression if no simplification occurred.

Return type:

claripy.ast.bits