Source: PROOF-NARRATIVE.md §3 KR-6 (added in PR #23).
Claim
For every input string s, KRLAdapter.jl::parse_krl(s) and quandledb/server/krl/Parser.jl::parse_any(s) either both succeed with equal ASTs or both fail.
Why valuable
Two implementations exist by design — one for end-user code (KRLAdapter.jl, canonical), one for query-time parsing (quandledb/server/krl/, server-side). If they accept different languages, the server can run queries the canonical parser rejects, and vice versa. Soundness regression.
Assumptions
[[A-KR-6.1]] Both implementations target the same EBNF grammar (spec/grammar.ebnf v0.1.0).
[[A-KR-6.2]] Both implementations share the same Token enumeration: keyword set, identifier shape, integer/string literal shapes.
Acceptance criteria
Effort
~1 day. The hard part is the ast_equal canonicaliser; both parsers produce structurally similar but not byte-equal ASTs.
Cross-references
- PROOF-NARRATIVE.md §3 KR-6
- ASSUMPTIONS.md A-KR-6.1, A-KR-6.2
- Cross-repo:
hyperpolymath/quandledb QD-10 (same obligation, mirrored).
Out of scope
- Semantic equivalence after lowering. KR-6 is about the surface ASTs only.
- Performance comparison. Worth doing separately; not in scope here.
Source: PROOF-NARRATIVE.md §3 KR-6 (added in PR #23).
Claim
For every input string
s,KRLAdapter.jl::parse_krl(s)andquandledb/server/krl/Parser.jl::parse_any(s)either both succeed with equal ASTs or both fail.Why valuable
Two implementations exist by design — one for end-user code (
KRLAdapter.jl, canonical), one for query-time parsing (quandledb/server/krl/, server-side). If they accept different languages, the server can run queries the canonical parser rejects, and vice versa. Soundness regression.Assumptions
[[A-KR-6.1]]Both implementations target the same EBNF grammar (spec/grammar.ebnfv0.1.0).[[A-KR-6.2]]Both implementations share the sameTokenenumeration: keyword set, identifier shape, integer/string literal shapes.Acceptance criteria
KRLAdapter.jl/test/differential_test.jl(or inquandledb/server/krl/test/— pick one canonical home and cross-reference).krl/examples/*.krl(4 known + any added).KRLAdapter.jl/test/parser_test.jl.quandledb/server/krl/test/parser_test.jl.s:ast_equalhelper must canonicalise across the two AST representations (the two implementations have slightly different node types — seeKRLAdapter.jl/src/parser/ast.jlvsquandledb/server/krl/Ast.jl). Either pick a common canonical form or define an explicit isomorphism.Effort
~1 day. The hard part is the
ast_equalcanonicaliser; both parsers produce structurally similar but not byte-equal ASTs.Cross-references
hyperpolymath/quandledbQD-10 (same obligation, mirrored).Out of scope