Skip to content

Main content

Set Inclusion Counterexample Tool

Return exact string witnesses disproving finite-set inclusion, in the subset's first-occurrence order.

Loading tool…

Description

Deduplicate subset and return its elements absent from superset as counterexamples.

A set contains distinct values, so duplicate input items do not contribute additional members. Ordered output is a serialization convention; membership, equality, and the chosen universe determine the underlying set result.

Deduplicate subset and return its elements absent from superset as counterexamples.

When to use this tool

Use Set Inclusion Counterexample when you need a deterministic operation on explicitly supplied sets or a finite membership representation.

How to use the tool and how it works

  1. Enter subset, superset. 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 included, counterexamples. Inspect included before interpreting the associated values.

Deduplicate subset and return its elements absent from superset as counterexamples. Included is true only when that list is empty.1

Input fieldMeaning and unitsAccepted input
subsetSubsetRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
supersetSupersetRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
Output fieldInterpretationReturned shape
includedIncludedRequired. Boolean.
counterexamplesCounterexamplesRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
json
{
  "input": {
    "subset": [
      "a",
      "b",
      "b"
    ],
    "superset": [
      "a",
      "c"
    ]
  },
  "output": {
    "included": false,
    "counterexamples": [
      "b"
    ]
  }
}

Limitations and assumptions

  • Exact equality and first-occurrence order are used; an empty subset is included and no ordering relation beyond membership is inferred.
  • 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.

Alternative or Complementary methods

Specify the universe and equality convention before combining this result with other set operations.

References

  1. Calculation and input contract: set/set-inclusion-counterexample — tool.io

Similar or alternative tools