Skip to content

Main content

Formula Free Variable Count Tool

Count explicitly annotated variable occurrences; binding scope is supplied rather than parsed.

Loading tool…

Description

Count explicitly annotated variable occurrences; binding scope is supplied rather than parsed.

A logical calculation operates on a stated representation: truth values, token lists, counts, or an explicitly supplied relation. Checking one assignment, pair, trace, or witness is different from proving a formula or validating an entire argument. Empty domains, duplicate tokens, and scope conventions can change the result.

Count explicitly annotated variable occurrences; binding scope is supplied rather than parsed.

When to use this tool

Use Formula Free Variable Count when you need this exact local truth, count, token, relation, or witness check within a larger logic workflow.

How to use the tool and how it works

  1. Enter variableOccurrences, boundOccurrences. 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 freeOccurrenceCount, distinctFreeVariables. Use the output convention below.

Require aligned variableOccurrences and boundOccurrences. Count false bound flags into freeOccurrenceCount and distinct corresponding variable tokens into distinctFreeVariables.1

Input fieldMeaning and unitsAccepted input
variableOccurrencesVariable OccurrencesRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
boundOccurrencesBoolean binding annotation for each variable occurrence; supplied rather than inferred.Required. Array of boolean; maximum items 256.
Output fieldInterpretationReturned shape
freeOccurrenceCountFree Occurrence CountRequired. Safe integer.
distinctFreeVariablesDistinct Free VariablesRequired. Safe integer.
json
{
  "input": {
    "variableOccurrences": [
      "x",
      "x",
      "y"
    ],
    "boundOccurrences": [
      false,
      true,
      false
    ]
  },
  "output": {
    "freeOccurrenceCount": 2,
    "distinctFreeVariables": 2
  }
}

Limitations and assumptions

  • Binding annotations are trusted. A variable can have both bound and free occurrences; no syntax tree, quantifier scope, or capture analysis is performed.
  • 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

Use a parser, scope-aware representation, model checker, or proof procedure when the supplied token or witness representation is insufficient. A local passing check should not be promoted to global validity.

References

  1. Calculation and input contract: philosophy/formula-free-variable-count — tool.io

Similar or alternative tools