TorchLean API

NN.Verification.Util.TextCursor

Text cursor primitives for verification parsers #

ODE and PINN certificates both contain small mathematical expression languages. This module owns their shared byte-position cursor, fuel-bounded scanning, and decimal literal parsing. Grammar and AST decisions remain in the respective verifier modules.

A source string paired with the current raw byte position.

Instances For
    @[inline]

    Inspect the current character without advancing the cursor.

    Instances For
      @[inline]

      Advance by one character, preserving the source text.

      Instances For
        @[inline]

        Remaining bytes plus one, suitable as a budget for a single linear scan.

        Instances For
          @[inline]

          Whether the cursor has reached or passed the source's raw end position.

          Instances For

            ASCII whitespace accepted by the verification expression languages.

            Instances For

              Skip characters satisfying predicate, bounded by explicit recursion fuel.

              Instances For
                def NN.Verification.Util.TextCursor.takeWhileFuel (fuel : ) (predicate : CharBool) (accumulator : String) (cursor : Cursor) :

                Consume characters satisfying predicate, bounded by explicit recursion fuel.

                Instances For

                  Convert a nonempty string of decimal digits to a natural number.

                  Instances For

                    Parse a whitespace-prefixed unsigned decimal natural using a caller-supplied scan budget.

                    Instances For

                      Parse a signed decimal Float without scientific notation.

                      Instances For