structure IntInfM = IntInf
signature INT_INF_ADAPT =
   sig
      include INTEGER

      val divMod: int * int -> int * int
      val quotRem: int * int -> int * int
      val pow: int * int -> int
      val log2: int -> int
      val orb: int * int -> int
      val xorb: int * int -> int
      val andb: int * int -> int
      val notb: int -> int
      val << : int * Word.word -> int
      val ~>> : int * Word.word -> int
   end

structure IntInfAdapt : INT_INF_ADAPT =
  struct
    type int = IntInfM.int
    val op * = op IntInfM.*
    val op + = op IntInfM.+
    val op - = op IntInfM.-
    val op < = op IntInfM.<
    val op << = op IntInfM.<<
    val op <= = op IntInfM.<=
    val op > = op IntInfM.>
    val op >= = op IntInfM.>=
    val op div = op IntInfM.div
    val op mod = op IntInfM.mod
    val abs = IntInfM.abs
    val andb = IntInfM.andb
    val compare = IntInfM.compare
    val divMod = IntInfM.divMod
    val fmt = IntInfM.fmt
    val fromInt = op IntInfM.fromInt
    val fromLarge = op IntInfM.fromLarge
    val fromString = op IntInfM.fromString
    val max = IntInfM.max
    val maxInt = IntInfM.maxInt
    val min = IntInfM.min
    val minInt = IntInfM.minInt
    val notb = IntInfM.notb
    val orb = IntInfM.orb
    val precision = IntInfM.precision
    val quot = IntInfM.quot
    val quotRem = IntInfM.quotRem
    val rem = IntInfM.rem
    val sameSign = IntInfM.sameSign
    val scan = IntInfM.scan
    val sign = IntInfM.sign
    val toInt = IntInfM.toInt
    val toLarge = IntInfM.toLarge
    val toString = IntInfM.toString
    val xorb = IntInfM.xorb
    val ~ = IntInfM.~
    val ~>> = IntInfM.~>>
    (* adaptation (safe): *)
    val log2 = fromInt o IntInfM.log2
    (* adaptation (partially correct): *)
    fun pow (a, b) = IntInfM.pow (a, toInt b)
  end
