rocqrt

    Runtime support for MoonBit code extracted from Rocq by rocq2mbt

    rocq
    coq
    extraction
    runtime
    Download zip
    Author
    Version
    0.1.0
    License
    MIT
    Last updated
    12 hours ago
    Downloads
    9

    No dependencies

    #GreckF/rocqrt

    Runtime support for MoonBit code extracted from Rocq by rocq2mbt: Rocq's native 63-bit integers (Uint63), floats (Float64) and persistent arrays (PArray, as diff-arrays).

    Extracted code that uses Rocq's native types depends on this module:

    // moon.mod import { "GreckF/rocqrt@0.1.0" } // moon.pkg of the extracted package import { "GreckF/rocqrt" @rocqrt }

    See the rocq2mbt repository for the extraction plugin and its documentation.

    Carry

    pub(all) enum Carry[A] {
    C0(A)
    C1(A)
    } derive(Eq,
    Debug
    )

    Constructor results of the carry type.

    Comparison

    pub(all) enum Comparison {
    Eq
    Lt
    Gt
    } derive(Eq,
    Debug
    )

    Rocq's comparison type.

    FloatClass

    pub(all) enum FloatClass {
    PNormal
    NNormal
    PSubn
    NSubn
    PZero
    NZero
    PInf
    NInf
    NaN
    } derive(Eq,
    Debug
    )

    FloatComparison

    pub(all) enum FloatComparison {
    FEq
    FLt
    FGt
    FNotComparable
    } derive(Eq,
    Debug
    )

    PArray

    pub struct PArray[A] {
    // private fields
    }

    PArray::copy

    fn[A] PArray::copy(p : PArray[A]) -> PArray[A]

    PArray::default

    fn[A] PArray::default(p : PArray[A]) -> A

    PArray::get

    fn[A] PArray::get(p : PArray[A], n : UInt64) -> A

    PArray::length

    fn[A] PArray::length(p : PArray[A]) -> UInt64

    PArray::make

    fn[A] PArray::make(n : UInt64, def : A) -> PArray[A]

    PArray::of_array

    fn[A] PArray::of_array(a : Array[A], def : A) -> PArray[A]

    Literal arrays produced by extraction.

    PArray::set

    fn[A] PArray::set(p : PArray[A], n : UInt64, e : A) -> PArray[A]

    PArray::to_array

    fn[A] PArray::to_array(p : PArray[A]) -> Array[A]

    Snapshot of the contents, for interoperability.

    f64_abs

    fn f64_abs(x : Double) -> Double

    f64_add

    fn f64_add(x : Double, y : Double) -> Double

    f64_classify

    fn f64_classify(x : Double) -> FloatClass

    f64_compare

    fn f64_compare(x : Double, y : Double) -> FloatComparison

    f64_div

    fn f64_div(x : Double, y : Double) -> Double

    f64_eqb

    fn f64_eqb(x : Double, y : Double) -> Bool

    f64_equal

    fn f64_equal(x : Double, y : Double) -> Bool

    Leibniz equality: NaNs are equal, +0 and -0 are not.

    f64_frshiftexp

    fn f64_frshiftexp(x : Double) -> (Double, UInt64)

    f64_ldexp

    fn f64_ldexp(x : Double, n : Int) -> Double

    x * 2^n, correctly rounded (port of musl's scalbn).

    f64_ldshiftexp

    fn f64_ldshiftexp(x : Double, e : UInt64) -> Double

    f64_leb

    fn f64_leb(x : Double, y : Double) -> Bool

    f64_ltb

    fn f64_ltb(x : Double, y : Double) -> Bool

    f64_mul

    fn f64_mul(x : Double, y : Double) -> Double

    f64_next_down

    fn f64_next_down(x : Double) -> Double

    f64_next_up

    fn f64_next_up(x : Double) -> Double

    f64_normfr_mantissa

    fn f64_normfr_mantissa(x : Double) -> UInt64

    f64_of_uint63

    fn f64_of_uint63(x : UInt64) -> Double

    f64_opp

    fn f64_opp(x : Double) -> Double

    f64_sqrt

    fn f64_sqrt(x : Double) -> Double

    f64_sub

    fn f64_sub(x : Double, y : Double) -> Double

    max_length

    let max_length : UInt64

    u63_add

    fn u63_add(x : UInt64, y : UInt64) -> UInt64

    u63_addc

    fn u63_addc(x : UInt64, y : UInt64) -> Carry[UInt64]

    u63_addcarryc

    fn u63_addcarryc(x : UInt64, y : UInt64) -> Carry[UInt64]

    u63_addmuldiv

    fn u63_addmuldiv(p : UInt64, x : UInt64, y : UInt64) -> UInt64

    u63_asr

    fn u63_asr(x : UInt64, y : UInt64) -> UInt64

    u63_compare

    fn u63_compare(x : UInt64, y : UInt64) -> Comparison

    Unsigned comparison.

    u63_compares

    fn u63_compares(x : UInt64, y : UInt64) -> Comparison

    Signed comparison.

    u63_div

    fn u63_div(x : UInt64, y : UInt64) -> UInt64

    u63_diveucl

    fn u63_diveucl(x : UInt64, y : UInt64) -> (UInt64, UInt64)

    u63_diveucl_21

    fn u63_diveucl_21(xh : UInt64, xl : UInt64, y : UInt64) -> (UInt64, UInt64)

    Division of the 126-bit number xh * 2^63 + xl by y.

    u63_divs

    fn u63_divs(x : UInt64, y : UInt64) -> UInt64

    u63_eqb

    fn u63_eqb(x : UInt64, y : UInt64) -> Bool

    u63_head0

    fn u63_head0(x : UInt64) -> UInt64

    u63_land

    fn u63_land(x : UInt64, y : UInt64) -> UInt64

    u63_leb

    fn u63_leb(x : UInt64, y : UInt64) -> Bool

    u63_lesb

    fn u63_lesb(x : UInt64, y : UInt64) -> Bool

    u63_lor

    fn u63_lor(x : UInt64, y : UInt64) -> UInt64

    u63_lsl

    fn u63_lsl(x : UInt64, y : UInt64) -> UInt64

    u63_lsr

    fn u63_lsr(x : UInt64, y : UInt64) -> UInt64

    u63_ltb

    fn u63_ltb(x : UInt64, y : UInt64) -> Bool

    u63_ltsb

    fn u63_ltsb(x : UInt64, y : UInt64) -> Bool

    u63_lxor

    fn u63_lxor(x : UInt64, y : UInt64) -> UInt64

    u63_mod

    fn u63_mod(x : UInt64, y : UInt64) -> UInt64

    u63_mods

    fn u63_mods(x : UInt64, y : UInt64) -> UInt64

    u63_mul

    fn u63_mul(x : UInt64, y : UInt64) -> UInt64

    u63_mulc

    fn u63_mulc(x : UInt64, y : UInt64) -> (UInt64, UInt64)

    Exact product as (high, low) 63-bit words: x * y = high * 2^63 + low.

    u63_of_int

    fn u63_of_int(x : Int) -> UInt64

    Conversions for interoperability with MoonBit integers.

    u63_of_int64

    fn u63_of_int64(x : Int64) -> UInt64

    u63_sub

    fn u63_sub(x : UInt64, y : UInt64) -> UInt64

    u63_subc

    fn u63_subc(x : UInt64, y : UInt64) -> Carry[UInt64]

    u63_subcarryc

    fn u63_subcarryc(x : UInt64, y : UInt64) -> Carry[UInt64]

    u63_tail0

    fn u63_tail0(x : UInt64) -> UInt64

    u63_to_int

    fn u63_to_int(x : UInt64) -> Int

    u63_to_int64

    fn u63_to_int64(x : UInt64) -> Int64