package dolmen

  1. Overview
  2. Docs

Module Builtin.BitvSource

Sourcetype _ t =
  1. | T of {
    1. n : int;
    }
    (*

    Bitv.T{n}: ttype: type constructor for bitvectors of length n. Ensures that n > 0.

    *)
  2. | Binary_lit of string
    (*

    Lit s: Bitv.T: bitvector litteral. The string s should be a binary representation of bitvectors using characters '0', and '1' (lsb last)

    *)
  3. | To_int of {
    1. n : int;
    2. signed : bool;
    }
    (*

    To_int{n; signed; }: Bitv.T{n} -> Int: conversion from bitvectors to signed integers.

    *)
  4. | Of_int of {
    1. n : int;
    }
    (*

    Of_int{n}: Int -> Bitv.T{n}: conversion fromm (signed) integers to bitvectors.

    *)
  5. | Concat of {
    1. n : int;
    2. m : int;
    }
    (*

    Concat{n;m}: Bitv.T{n} -> Bitv.T{m} -> Bitv.T{n+m}: concatenation operator on bitvectors.

    *)
  6. | Extract of {
    1. n : int;
    2. i : int;
    3. j : int;
    }
    (*

    Extract{n; i; j}: Bitv.T{n} -> Bitv.T{i - j + 1}: bitvector extraction, from index j up to i (both included). Ensures that 0 <= j <= i < n.

    *)
  7. | Repeat of {
    1. n : int;
    2. k : int;
    }
    (*

    Repeat{n;k}: Bitv.T{n} -> Bitv.T{n*k}: bitvector repeatition.

    *)
  8. | Zero_extend of {
    1. n : int;
    2. k : int;
    }
    (*

    Zero_extend{n;k}: Bitv.T{n} -> Bitv.T{n + k}: zero extension for bitvectors (produces a representation of the same unsigned integer).

    *)
  9. | Sign_extend of {
    1. n : int;
    2. k : int;
    }
    (*

    Sign_extend{n;k}: Bitv.T{n} -> Bitv.T{n + k}: sign extension for bitvectors ((produces a representation of the same signed integer).

    *)
  10. | Rotate_right of {
    1. n : int;
    2. i : int;
    }
    (*

    Rotate_right{n;i}: Bitv.T{n} -> Bitv.T{n}: logical rotate right for bitvectors by i.

    *)
  11. | Rotate_left of {
    1. n : int;
    2. i : int;
    }
    (*

    Rotate_left{n;i}: Bitv.T{n} -> Bitv.T{n}: logical rotate left for bitvectors by i.

    *)
  12. | Not of {
    1. n : int;
    }
    (*

    Not{n}: Bitv.T{n} -> Bitv.T{n}: bitwise negation for bitvectors.

    *)
  13. | And of {
    1. n : int;
    }
    (*

    And{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: bitwise conjunction for bitvectors.

    *)
  14. | Or of {
    1. n : int;
    }
    (*

    Or{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: bitwise disjunction for bitvectors.

    *)
  15. | Nand of {
    1. n : int;
    }
    (*

    Nand{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: bitwise negated conjunction for bitvectors. Nand s t abbreviates Not (And s t)).

    *)
  16. | Nor of {
    1. n : int;
    }
    (*

    Nor{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: bitwise negated disjunction for bitvectors. Nor s t abbreviates Not (Or s t)).

    *)
  17. | Xor of {
    1. n : int;
    }
    (*

    Xor{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: bitwise exclusive disjunction for bitvectors. Xor s t abbreviates Or (And s (Not t)) (And (Not s) t) .

    *)
  18. | Xnor of {
    1. n : int;
    }
    (*

    Xnor{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: bitwise negated exclusive disjunction for bitvectors. Xnor s t abbreviates Or (And s t) (And (Not s) (Not t)).

    *)
  19. | Comp of {
    1. n : int;
    }
    (*

    Comp{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{1}: Returns the constant bitvector "1" is all bits are equal, and the bitvector "0" if not.

    *)
  20. | Neg of {
    1. n : int;
    }
    (*

    Neg{n}: Bitv.T{n} -> Bitv.T{n}: 2's complement unary minus.

    *)
  21. | Add of {
    1. n : int;
    }
    (*

    Add{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: addition modulo 2^n.

    *)
  22. | Sub of {
    1. n : int;
    }
    (*

    Sub{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: 2's complement subtraction modulo 2^n.

    *)
  23. | Mul of {
    1. n : int;
    }
    (*

    Mul{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: multiplication modulo 2^n.

    *)
  24. | Udiv of {
    1. n : int;
    }
    (*

    Udiv{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: unsigned division, truncating towards 0.

    *)
  25. | Urem of {
    1. n : int;
    }
    (*

    Urem{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: unsigned remainder from truncating division.

    *)
  26. | Sdiv of {
    1. n : int;
    }
    (*

    Sdiv{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: 2's complement signed division.

    *)
  27. | Srem of {
    1. n : int;
    }
    (*

    Srem{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: 2's complement signed remainder (sign follows dividend).

    *)
  28. | Smod of {
    1. n : int;
    }
    (*

    Smod{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: 2's complement signed remainder (sign follows divisor).

    *)
  29. | Shl of {
    1. n : int;
    }
    (*

    Shl{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: shift left (equivalent to multiplication by 2^x where x is the value of the second argument).

    *)
  30. | Lshr of {
    1. n : int;
    }
    (*

    Lshr{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: logical shift right (equivalent to unsigned division by 2^x, where x is the value of the second argument).

    *)
  31. | Ashr of {
    1. n : int;
    }
    (*

    Ashr{n}: Bitv.T{n} -> Bitv.T{n} -> Bitv.T{n}: Arithmetic shift right, like logical shift right except that the most significant bits of the result always copy the most significant bit of the first argument.

    *)
  32. | Ult of {
    1. n : int;
    }
    (*

    Ult{n}: Bitv.T{n} -> Bitv.T{n} -> Prop.T: binary predicate for unsigned less-than.

    *)
  33. | Ule of {
    1. n : int;
    }
    (*

    Ule{n}: Bitv.T{n} -> Bitv.T{n} -> Prop.T: binary predicate for unsigned less than or equal.

    *)
  34. | Ugt of {
    1. n : int;
    }
    (*

    Ugt{n}: Bitv.T{n} -> Bitv.T{n} -> Prop.T: binary predicate for unsigned greater-than.

    *)
  35. | Uge of {
    1. n : int;
    }
    (*

    Uge{n}: Bitv.T{n} -> Bitv.T{n} -> Prop.T: binary predicate for unsigned greater than or equal.

    *)
  36. | Slt of {
    1. n : int;
    }
    (*

    Slt{n}: Bitv.T{n} -> Bitv.T{n} -> Prop.T: binary predicate for signed less-than.

    *)
  37. | Sle of {
    1. n : int;
    }
    (*

    Sle{n}: Bitv.T{n} -> Bitv.T{n} -> Prop.T: binary predicate for signed less than or equal.

    *)
  38. | Sgt of {
    1. n : int;
    }
    (*

    Sgt{n}: Bitv.T{n} -> Bitv.T{n} -> Prop.T: binary predicate for signed greater-than.

    *)
  39. | Sge of {
    1. n : int;
    }
    (*

    Sge{n}: Bitv.T{n} -> Bitv.T{n} -> Prop.T: binary predicate for signed greater than or equal.

    *)
  40. | Overflow_neg of {
    1. n : int;
    }
    (*

    Overflow_neg{n} : Bitv.T{n} -> Prop.T: unary overflow predicate for signed unary minus (i.e. returns true if the negation would overflow)

    *)
  41. | Overflow_add of {
    1. n : int;
    2. signed : bool;
    }
    (*

    Overflow_add{n;signed} : Bitv.T{n} -> Bitv.T{n} -> Prop.T: binary overflow predicate for signed/unsigned addition (i.e. returns true if the operation would overflow)

    *)
  42. | Overflow_sub of {
    1. n : int;
    2. signed : bool;
    }
    (*

    Overflow_sub{n;signed}: Bitv.T{n} -> Bitv.T{n} -> Prop.T binary overflow predicate for signed/unsigned subtraction (i.e. returns [true] if the operation would overflow)

    *)
  43. | Overflow_mul of {
    1. n : int;
    2. signed : bool;
    }
    (*

    Overflow_mul{n;signed}: Bitv.T{n} -> Bitv.T{n} -> Prop.T binary overflow predicate for signed/unsigned multiplication (i.e. returns [true] if the operation would overflow)

    *)
  44. | Overflow_div of {
    1. n : int;
    }
    (*

    Overflow_div{n}: Bitv.T{n} -> Bitv.T{n} -> Prop.T binary overflow predicate for signed division (i.e. returns [true] if the operation would overflow)

    *)