Standard: CRG v2.0 STRICT Current Grade: D Assessed: 2026-04-12 (promoted E → D after iteration 2) Assessor: Jonathan D.A. Jewell
Grade D criterion: "Works on some inputs, test matrix present."
- Parser implemented:
KRLAdapter.jl/src/parser/(Julia, Option B decision 2026-04-12)lexer.jl— full lexer with position tracking,KRLLexErrorast.jl— all AST node types (KRLProgram,KRLBinding,KRLGenerator,KRLCompose,KRLTensor,KRLPrefixOp,KRLParenExpr,KRLIdentifier,KRLQuery,KRLFilter,KRLIntValue,KRLStrValue,KRLIdentValue)parser.jl— recursive descent, full v0.1.0 grammarlower.jl— AST → TangleIR lowering withKRLLowerError
- Grammar ambiguity resolved:
;as sequential composition only fires inside parenthesised expressions (in_parens=true); at statement level;is the terminator. - Test matrix:
KRLAdapter.jl/test/parser_test.jl— 5 testsets, 57 tests- Lexer: keywords, identifiers, integers, strings, operators, punctuation, comments stripped, position tracking, lex error, unterminated string
- Parser: 20 grammar cases including all generators, let bindings, sequential
compose (with parens), tensor product, prefix ops, queries with
andchains - Parser errors: missing
;, unrecognised token, missing index, zero index - Example .krl files: all 4 examples in
krl/examples/parse without error - Lowering: sigma/sigma_inv → TangleIR, compose, trefoil, mirror, let binding, unbound identifier error, query → KRLQueryPlan
- 5577 tests pass (full KRLAdapter.jl suite including parser tests)
The implemented grammar (v0.1.0):
| Construct | Status |
|---|---|
let binding |
✅ |
sigma, sigma_inv, cup, cap generators |
✅ |
Sequential composition (a ; b) |
✅ |
Tensor product a | b |
✅ |
close, mirror, simplify, normalise, classify |
✅ |
find where queries with and |
✅ |
| Parenthesised sub-expressions | ✅ |
| Identifier references (let-bound) | ✅ |
Line comments -- |
✅ |
| String, integer, identifier filter values | ✅ |
- No typechecker. Port-arity compatibility (e.g. composing a 2-strand braid with a 3-strand tangle) not verified at parse time.
- R2 simplification across compose() boundaries.
simplify_irdetects R2 bigons by arc-index overlap, butcompose()renumbers arcs so adjacent sigma/sigma_inv pairs are not detected. Tracked inKRLAdapter.jlissues. - No pretty-printer.
KRLProgram → stringround-trip not yet implemented. - No RESOLVE family.
classifyis parsed and lowered (identity) but not dispatched to the query layer.
Grade E criterion: "At least 1 test, documented failures."
- Grammar drafted:
spec/grammar.ebnf,spec/grammar-overview.md - 4 examples in
examples/ - Shell smoke test:
tests/smoke/grammar_smoke.sh(16 lexical assertions)
After D: typechecker (port-arity + generator index validity), deeper TangleIR compilation correctness, annotation per-directory, dogfooding by parsing 20+ KRL programs from the knot table. Fix R2 simplification across compose() boundaries.
After C: 6+ diverse external targets (knot researchers, DSL authors, topology educators) write KRL programs and report back.
After D: typechecker (port-arity + generator index validity), compiler to TangleIR via KRLAdapter.jl, deep annotation per-directory, real dogfooding by parsing 20+ KRL programs representing knots from the knot table.
After C: 6+ diverse external targets (knot researchers, DSL authors, topology educators) write KRL programs and report back.
Templated from rsr-template-repo. Zero KRL-specific content.
- spec/grammar.ebnf (v0.1.0 EBNF)
- spec/grammar-overview.md
- 4 examples/ programs
- tests/smoke/grammar_smoke.sh (16 lexical assertions, all passing)
- Decision: Option B — Julia in KRLAdapter.jl
- Implemented: lexer, AST, recursive-descent parser, lowering (KRLAdapter.jl)
- Grammar ambiguity fixed:
;as compose only inside parentheses - 57 dedicated parser tests + all 4 example files parse cleanly
- 5577 total KRLAdapter.jl tests pass
Reassess on typechecker implementation or when 20+ knot-table programs have been parsed successfully.