Skip to content

Main content

List Bounded Prefix Equality Witness Tool

Calculate list bounded prefix equality witness from explicit caller-supplied inputs.

Loading tool…

Description

Compare up to limit and both list lengths, recording the first mismatch.

Token lists preserve element boundaries that raw character matching can lose. Prefix-suffix overlap and separator placement depend on exact element and empty-list conventions.

Compare up to limit and both list lengths, recording the first mismatch.

When to use this tool

Use List Bounded Prefix Equality Witness when you need a token-boundary overlap or separator-count calculation.

How to use the tool and how it works

  1. Enter first, second, limit. Keep parallel arrays aligned. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read equal, compared, mismatch. Inspect equal before interpreting the associated values.

Compare up to limit and both list lengths, recording the first mismatch. If a list ends before limit and lengths differ, use the compared length as the mismatch; otherwise return -1.1

Input fieldMeaning and unitsAccepted input
firstFirst value or boundary under the stated formula.Required. Array of text; maximum UTF-16 length 8192; maximum items 256.
secondSecond value or boundary under the stated formula.Required. Array of text; maximum UTF-16 length 8192; maximum items 256.
limitLimitRequired. Safe integer; minimum 0; maximum 256.
Output fieldInterpretationReturned shape
equalEqualRequired. Boolean.
comparedComparedRequired. Safe integer.
mismatchMismatchRequired. Safe integer.
json
{
  "input": {
    "first": [
      "a",
      "b"
    ],
    "second": [
      "a",
      "c"
    ],
    "limit": 2
  },
  "output": {
    "equal": false,
    "compared": 2,
    "mismatch": 1
  }
}

Limitations and assumptions

  • Equality is bounded by limit rather than necessarily covering both whole lists; -1 denotes no witness found.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Choose token normalization and escaping rules before joining or merging the actual list contents.

References

  1. Calculation and input contract: list/list-bounded-prefix-equality-witness — tool.io

Similar or alternative tools