feat(symbolic): nested dict, dict-of-set, 3-level nesting#10
Merged
Conversation
… support Support Dict[Int, Dict[Int, T]], Dict[Int, Set[Int]], and deeper nesting like PBFT's Dict[Int, Dict[Int, Dict[Int, Bool]]]. - state_vars: type_to_kind_value with spec context for nested type resolution - encoder: flatten index chains, recursive resolve_index_chain for arbitrary depth - encoder: generalized len/membership for nested compounds - transition: recursive init (encode_init_compound_body) and effect encoding - transition: encode_compound_update_for_slot handles Dict/Set/Seq uniformly - trace: format_compound_value displays nested dicts/sets recursively - Clear error messages for infeasible Set[Seq[T]] and Dict[Seq[T], V] Newly passing: Paxos, PBFT, Comet, EPaxos, Percolator, MESI, Redlock, SWIM, Simplex, Counters (10 new specs, ~49/59 total with correct constants) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dict[Int, Dict[Int, T]],Dict[Int, Set[Int]], and deeper nesting (e.g. PBFT'sDict[Int, Dict[Int, Dict[Int, Bool]]])d[k1][k2][k3]) and resolve recursively viaresolve_index_chainencode_init_compound_bodyandencode_compound_update_for_slotSet[Seq[T]]andDict[Seq[T], V]constructsstride == 1vs scalar value bug: compound types with a single key (e.g.Dict[0..0, Bool]) have stride 1 but are not scalarsNewly passing specs (10)
Dict[Int, Dict[Int, Bool]]Dict[Int, Dict[Int, Dict[Int, Bool]]]Dict[Int, Dict[Int, Int]]Dict[Int, Set[Int]]Dict[Int, Dict[Int, Int]]Test plan
cargo fmt --checkcleancargo build -p specl-symboliczero warningscargo test --workspace --exclude specl-tlaall tests passSet[Seq[T]]error🤖 Generated with Claude Code