Documentation

Solanalib.SBPF.CommType

SBPF.CommType — machine words for the sBPF ISA #

Fixed-width machine words underpinning the Solana eBPF (sBPF) semantics, ported from the OOPSLA 2025 Isabelle/HOL formalisation (rBPFCommType.thy, Yuan et al., A Complete Formal Semantics of eBPF ISA for Solana).

Every width is modelled as BitVec n: a bit container with no inherent signedness. Signed vs. unsigned behaviour is a property of the operation (BitVec.sdiv / .smod / .sshiftRight vs / / % / >>>), exactly as on real hardware — so a single representation serves both the word and sword roles of the source theory.

Main definitions #

@[reducible, inline]

4-bit word — the register-index field of an encoded instruction.

Equations
Instances For
    @[reducible, inline]

    8-bit word — a byte.

    Equations
    Instances For
      @[reducible, inline]

      16-bit word — the instruction offset field.

      Equations
      Instances For
        @[reducible, inline]

        32-bit word — the instruction immediate field.

        Equations
        Instances For
          @[reducible, inline]

          64-bit word — the register width.

          Equations
          Instances For
            @[reducible, inline]

            128-bit word — wide-multiply results.

            Equations
            Instances For

              Smallest signed 8-bit value (-128), as raw bits.

              Equations
              Instances For

                Largest signed 8-bit value (127).

                Equations
                Instances For

                  Largest unsigned 8-bit value (255).

                  Equations
                  Instances For

                    Smallest signed 32-bit value, as raw bits.

                    Equations
                    Instances For

                      Largest signed 32-bit value.

                      Equations
                      Instances For

                        Largest unsigned 32-bit value.

                        Equations
                        Instances For

                          Smallest signed 64-bit value, as raw bits.

                          Equations
                          Instances For

                            Largest signed 64-bit value.

                            Equations
                            Instances For

                              Largest unsigned 64-bit value.

                              Equations
                              Instances For

                                A byte encoding of a boolean: 1 for true, 0 for false.

                                Equations
                                Instances For

                                  Little-endian bytes of a 16-bit word.

                                  Equations
                                  Instances For

                                    Little-endian bytes of a 32-bit word.

                                    Equations
                                    Instances For

                                      Little-endian bytes of a 64-bit word.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        Reassemble a little-endian 2-byte list into a 16-bit word.

                                        Equations
                                        Instances For

                                          Reassemble a little-endian 4-byte list into a 32-bit word.

                                          Equations
                                          Instances For

                                            Reassemble a little-endian 8-byte list into a 64-bit word.

                                            Equations
                                            Instances For