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
- Enter variableOccurrences, boundOccurrences. Keep parallel arrays aligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| variableOccurrences | Variable Occurrences | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| boundOccurrences | Boolean binding annotation for each variable occurrence; supplied rather than inferred. | Required. Array of boolean; maximum items 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| freeOccurrenceCount | Free Occurrence Count | Required. Safe integer. |
| distinctFreeVariables | Distinct Free Variables | Required. Safe integer. |
{
"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
Similar or alternative tools
- Quantifier Bound Variable Shadow Count
Count shadowing in an explicitly ordered nested binder path, without parsing formulas or proving equivalence.
- Alpha Equivalence Bound Variable Pair
Compare flat single-binder token bodies, rejecting potential free-variable capture; nested binders are outside this model.