Summary
Specl only supports integer-range-keyed dictionaries (Dict[0..N, T]). String keys are not available, requiring manual mapping of named entities to integer indices.
Problem
Quint and TLA+ use string-keyed maps naturally:
// Quint
const resourceManagers: Set[str] // {"rm1", "rm2", "rm3"}
var states: str -> ResourceManagerState
states.get("rm1") == Working
// Specl today
var rmState: Dict[0..2, 0..3] // 0=rm1, 1=rm2, 2=rm3
rmState[0] == 0 // what is 0? which RM? which state?
Impact
Minor compared to sum types and sets — the integer-index encoding works fine mechanically. The main cost is readability: named entities like "rm1", "wolf", "goat" become anonymous integers.
Desired Behavior
Support string literal keys in dictionaries, or at minimum named constants that can serve as dictionary keys.
Context
Identified during Quint-to-Specl benchmark translation. All 7 translated specs used integer indices. See sidequests/quint-apalache-benchmark/README.md Section 3.1.
Summary
Specl only supports integer-range-keyed dictionaries (
Dict[0..N, T]). String keys are not available, requiring manual mapping of named entities to integer indices.Problem
Quint and TLA+ use string-keyed maps naturally:
Impact
Minor compared to sum types and sets — the integer-index encoding works fine mechanically. The main cost is readability: named entities like "rm1", "wolf", "goat" become anonymous integers.
Desired Behavior
Support string literal keys in dictionaries, or at minimum named constants that can serve as dictionary keys.
Context
Identified during Quint-to-Specl benchmark translation. All 7 translated specs used integer indices. See
sidequests/quint-apalache-benchmark/README.mdSection 3.1.