Non-ASCII characters in symbol names
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 75/100
Hướng nghiên cứu
Start from pyk/src/pyk/konvert/_utils.py to fix munge to encode non-ASCII characters as 4-hex-digit UTF-16 chunks. Then update the decoders: KoreToK.mapCode in k-frontend/src/main/scala/org/kframework/parser/kore/parser/KoreToK.scala, decodeKoreString in k-frontend/src/main/java/org/kframework/utils/StringUtil.java, and decode_kore in llvm-backend/lib/ast/AST.cpp to recognize [0-9a-f]{4} chunks and convert them back to characters. Run the relevant test suites to verify the round-trip.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
ModuleToKORE encodes each non-ASCII UTF-16 code unit as a 4-hex-digit chunk inside the '...' block, so λ → Lbl'03bb' and 𐔷 (U+10537, a surrogate pair) → Lbl'd801dd37':
Every chunk is exactly 4 characters (the overrides below make sure of that) and lowercase hex never collides with a mnemonic, so the encoding is unambiguous:
Both backends accept these names, since ' is a legal identifier character:
- https://github.com/runtimeverification/haskell-backend/blob/ec0486c03af923071544fd61e35e9426507aac33/kore/src/Kore/Parser/Lexer.x#L57
- https://github.com/runtimeverification/llvm-backend/blob/7ca095a55430e587a444c4dbdbc96ab3ee9d4933/lib/parser/KOREScanner.l#L26
Bug 1: pyk munge does not encode non-ASCII
Characters outside MUNGE_TABLE are copied verbatim, so munge('λ') == 'λ', which is not a valid KORE identifier and differs from what kompile emits:
Bug 2: no decoder converts hex chunks back to characters
Reachable today:
KoreToK.mapCode (used for symbol names) parses the hex and then discards it, returning the text \u03bb instead of the character:
pyk unmunge raises ValueError('Unknown encoding "03bb"'):
Latent, because these two are only applied to variable names and #KVariable restricts those to ASCII [A-Za-z0-9'_] plus a !/?/@ prefix (the @ is split off before encoding):
StringUtil.decodeKoreString looks the slice up in the default map and appends the string "null" on a miss:
llvm-backend decode_kore does codes[code] on a missing key and emits a NUL byte per chunk:
The haskell-backend never decodes names and is unaffected.
Side issues
decodeKoreString uses the default table, so it would also miss the KORE overrides And-, -LT-, -GT-, -AT-, Xor- if ever applied to a symbol name:
llvm-backend maps SCln to 'l' instead of ';':
Expected
mungeproduces the same encoding asModuleToKORE(per UTF-16 code unit,%04x).- Decoders recognise a
[0-9a-f]{4}chunk and convert it back to a code unit, recombining surrogate pairs where the host string type is not UTF-16, or fail loudly instead of producingnull/NUL.
- Ngôn ngữ chính
- Python
- Star
- 600
- Fork
- 164
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của runtimeverification/k
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 43/100
runtimeverification/k#4942 ·
-
Introduce composable symbolic execution interface in pyxCó thể làm lại được @Stevengre đã nhận 128 ngày trước và không có pull request nào đang mở. Đang mở
runtimeverification/k#4939 · 1 người được giao ·
-
Concolic ExplorerĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 32/100
runtimeverification/k#4937 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
runtimeverification/k#4936 ·
-
Accelerating all-path reachability proofs with one-path reachability proofsCó thể làm lại được @Stevengre đã nhận 133 ngày trước và không có pull request nào đang mở. Đang mởtype:epic
runtimeverification/k#4934 · 4 bình luận · 1 người được giao ·
Tất cả issue của runtimeverification/k
Issue tương tự
-
Support .aac audio uploadsCó thể đã có người làm @julien731 đã nhận hôm nay. Đang mởfeature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nimblehq/audio-transcriber#153 ·
-
help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
antonyrag/ragleap-core#1062 ·
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
gke-labs/kube-agents#4321 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Git-Hospital/githealthcheck#61 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
changelog investigate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
ramnes/notion-sdk-py#433 ·