STEP: 1532 / Test: 30/30 PASS / Lean 4: 4 theorem zero sorry / Type: STEP 1505 言語 2nd tool (47 defer 19 番目、 姉妹 tool 22)
❶ Balanced brackets / nesting → syntactic well-formedness verdict。 () [] {} <> default supported。
❂ 6 case 決定表: 空 → ZERO / mismatched → FALSE / unbalanced nesting → FALSE / 3+ consecutive open → NEITHER (ambiguous) / 均衡 → TRUE (well_formed)。
| Condition | Verdict | Reason |
|---|---|---|
| invalid (non-string) | NEITHER | invalid_input |
| empty | ZERO | empty_input |
| mismatched (close before open) | FALSE | mismatched_brackets |
| unclosed / wrong type close | FALSE | unbalanced_nesting |
| 3+ consecutive same open | NEITHER | ambiguous_parse |
| balanced | TRUE | well_formed |
syntaxVerdict({ input: '{[()]}' });
// { verdict: 'TRUE', reason: 'well_formed', maxNestingDepth: 3 }
syntaxVerdict({ input: '(]' });
// { verdict: 'FALSE', reason: 'unbalanced_nesting' }
syntaxVerdict({ input: '(' });
// { verdict: 'FALSE', reason: 'unbalanced_nesting' } (unclosed)
syntaxVerdict({ input: '((()))' });
// { verdict: 'NEITHER', reason: 'ambiguous_parse' } (3 consecutive open)
syntaxVerdict({ input: 'foo(bar[baz]qux)' });
// { verdict: 'TRUE' } (text with brackets)
syntaxVerdict({ input: 'hello world' });
// { verdict: 'TRUE' } (no brackets)
syntax_no_brackets_gives_true : 0 brackets → TRUE syntax_unbalanced_gives_false : open ≠ close → FALSE syntax_ambiguous_gives_neither : balanced + max_consec ≥ threshold → NEITHER syntax_well_formed_gives_true : balanced + max_consec < threshold → TRUE
❶ 簡易 bracket balance のみ、 real context-free grammar parsing 未 embed。
❂ Ambiguity detection は heuristic (3+ consecutive same open)、 real ambiguity classes (dangling else 等) 未 embed。
❸ 累計 defer 30 → 29 (STEP 1531 + 1532 で 2 tool 追加)。