Guth
NewsDocs
Page actions
View as Markdown ↗
Explore MCP tools ↗

instrument mechanism / verified-clean

Big Integer Base-N Arithmetic mechanism

The inspectable method record for Big Integer Base-N Arithmetic, kept separate from implementation and qualification.

Status: VERIFIED_CLEANLifecycle: verified-clean

Model scope

The four vectors assume conventional unsigned base-16 digit arrays with signed subtraction permitted, quotient-and-remainder division, and least-significant-first trace reporting. The exact ambiguities requiring resolution are signed-number representation, division semantics, digit-array order, base and digit validation, and carry/borrow trace schema.

  • The specification gives only the phrase "schoolbook algorithms generalized to base b digit arrays" rather than explicit addition, subtraction, multiplication, and division formulas or pseudocode.
  • Signed-integer behavior is unspecified: subtraction may produce a negative result, but the digit-array representation and sign handling are not defined.
  • Division semantics are unspecified, including quotient rounding, remainder sign, and whether division returns quotient only or quotient plus remainder.
  • Digit order is unspecified: the implementation must define whether arrays are least-significant-digit first or most-significant-digit first.
  • The allowed base range and digit alphabet are unspecified. A standard positional representation requires an integer base b >= 2 and digits in the range 0 through b-1.
  • The carry/borrow trace format is unspecified, so the stated output cannot be verified consistently.

Units and conventions

  • Inputs are dimensionless integers represented in a common integer base b.
  • For these test vectors, digits are written most-significant first, the base is explicitly supplied, and hexadecimal digits A-F represent values 10-15.
  • The base is an integer b >= 2; every input digit must be in the range 0 through b-1.
  • Results are returned without unnecessary leading zero digits, except that zero is represented as "0".
  • Subtraction uses signed results; division uses nonnegative dividend and divisor and returns truncating quotient plus nonnegative remainder satisfying dividend = divisor * quotient + remainder.
  • Carry and borrow traces below are listed from least-significant processed digit to most-significant processed digit.

Inspectable vector

One of 4 source-bound review vectors:

{
  "inputs": {
    "base": 16,
    "left": "FFFF",
    "right": "1",
    "operation": "add"
  },
  "expected_outputs": {
    "result": "10000",
    "carry_borrow_trace": {
      "carry_out_by_position": [
        1,
        1,
        1,
        1
      ],
      "final_carry": 1
    }
  },
  "working": "Process right to left: F + 1 = 16, write 0 and carry 1; F + 0 + 1 = 16, write 0 and carry 1; F + 0 + 1 = 16, write 0 and carry 1; F + 0 + 1 = 16, write 0 and carry 1. Append the final carry 1. Result = 10000 base 16."
}

Failure boundary

  • Division by zero must be rejected before any division step.
  • Invalid digits, a base below 2, noninteger bases, and mismatched operand bases must be rejected.
  • If negative integers are supported, sign normalization and subtraction cases such as a smaller minuend must be explicitly defined and tested.
  • A JavaScript Number used for intermediate digit products or carry accumulation can lose precision; arbitrary precision requires BigInt or carefully bounded digit arithmetic.
  • Malformed inputs, empty digit arrays, leading signs, leading zeros, and zero normalization need explicit validation rules.
  • The division output must state whether it is quotient-only or quotient-plus-remainder and must define behavior for negative operands.
  • The empty honest_label field is a labeling concern: the catalog should not imply fully verified arbitrary-precision support until base validation, signed arithmetic, division semantics, and precision guarantees are specified and tested.

Other records

Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

  • VERIFIED_LEDGER.json
  • evidence-tranche5/tranche5-results.json