Non-ASCII characters in symbol names
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 75/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 596
- Forks
- 164
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de runtimeverification/k
-
Introduce composable symbolic execution interface in pyxQuizá libre de nuevo @Stevengre la tomó hace 120 días y no hay ningún pull request abierto. Abierto
runtimeverification/k#4939 · 1 asignado ·
-
Concolic ExplorerAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 32/100
runtimeverification/k#4937 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
runtimeverification/k#4936 ·
-
Accelerating all-path reachability proofs with one-path reachability proofsQuizá libre de nuevo @Stevengre la tomó hace 125 días y no hay ningún pull request abierto. Abiertotype:epic
runtimeverification/k#4934 · 4 comentarios · 1 asignado ·
-
Support progressive depth halving as a generic policy in `Prover.advance_proof`Posiblemente ocupada @Stevengre la tomó hace 145 días. Abierto
runtimeverification/k#4924 · 1 asignado ·
Todos los issues de runtimeverification/k
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
volcengine/OpenViking#6445 ·
Los mantenedores suelen responder en 1 día
-
BUG:Edit Album strips spaces from the password so albums with a leading/trailing space in the password can't be editedPosiblemente ocupada @ManyaJain111 la tomó hoy. Abiertobug enhancement possible-duplicate
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
AOSSIE-Org/PictoPy#1637 · 4 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
deepspeedai/DeepSpeed#8884 ·
Los mantenedores suelen responder en 3 días
-
Flaky: test_advisor_live_calibrates_an_unmeasured_circuit ranks engines by a 1.8ms sleep marginAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
flagos-ai/FlagQuantum#718 ·
Los mantenedores suelen responder en 1 día
-
bug CI-failure high priority
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
vllm-project/afd-plugin#483 ·
Los mantenedores suelen responder en 1 día