The corpus was recording equality where the language does predicate application - #75
Merged
Merged
Conversation
does predicate application Two defects in the generator, both found by adding `define` cases. **It never built a predicate table.** `validate_line` called `parse(tokens)` with neither `composition_names` nor `predicate_names`, which the CLI supplies from the session. So `define large: is above 50` registered nothing, `is large` fell through to string equality, and the corpus recorded that as the language's behaviour. `is not large` — which is locked at v31 §83 and implemented — was recorded as a parse error. The port would have been taught both. **Rendering cannot tell the two apart.** `require total is large` and `require total is overdue` render identically; the first is a predicate application and the second is equality against a bareword. The corpus compared status, canonical and error kind, so a port that implemented `define` as a no-op would have passed every new case. So each success now records `nodes`: every AST node kind in the tree, sorted. Predicate application carries `PredicateApplicationNode`; equality carries `BareWord` and `ConditionNode`. Kind names already agree across the two implementations — `RequireNode` is `RequireNode` on both sides — so the comparison needs no translation layer. Six `define` cases added: application, negation, field elision in the body, a predicate referencing a predicate, a bareword that is not a predicate staying equality, and a predicate used before it is defined. That last pair is what makes `define` non-breaking, and the corpus now says so rather than implying it. 48 cases. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E6qcDj1e1dEYvc8jLnpGZy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two defects in the generator, both surfaced by adding
definecases ahead of porting it.It never built a predicate table
validate_linecalledparse(tokens)with neithercomposition_namesnorpredicate_names— the two sets the CLI supplies from the session. Sodefine large: is above 50registered nothing,is largefell through to string equality, and the corpus recorded that as the language's behaviour.Worse,
require total is not large— locked at v31 §83 and implemented — came out as a parse error. I briefly believed §83 was unimplemented on the strength of the corpus, before probing the interpreter directly and findingPredicateApplicationNode(negated=True)right there in the parser.Rendering cannot tell the two apart
Identical. The corpus compared status, canonical rendering and error kind — so a port that implemented
defineas a no-op would have passed every case I had just added.So each success now records
nodes: every AST node kind in the tree, sorted.Kind names already agree across implementations —
RequireNodeisRequireNodeon both sides — so this needs no translation layer.Six
definecasesApplication, negation, field elision in the body (§90), a predicate referencing a predicate (§84), a bareword that is not a predicate staying equality, and a predicate used before it is defined. The last two are what make
definenon-breaking per §82, and the corpus now says so rather than implying it.One case was renamed: "an undefined predicate is refused" was wrong — it is not refused, it is equality, which is the point.
48 cases. 1748 passed, 2 skipped.
🤖 Generated with Claude Code
https://claude.ai/code/session_01E6qcDj1e1dEYvc8jLnpGZy