freespek / ssf-mc

EF project Exploring Automatic Model-Checking of the Ethereum specification
Apache License 2.0
3 stars 0 forks source link

Fix & tighten bounds on folds #30

Closed thpani closed 1 month ago

thpani commented 1 month ago

Fix and tighten the bounds on folds.

For helpers.tla:

  1. We currently use { i \in 0..MAX_SLOT: i <= node_state.current_slot } to fold over. However, we don't constrain single_node_state.current_slot in Init, so the additional filter is unsound. We replace it with just 0..MAX_SLOT.

  2. The bounds on get_blockchain and have_common_ancestor can be tightened to 1..MAX_SLOT.

  3. For is_ancestor_descendant_relationship we do the same by pulling the comparison one step out of the fold.

For ffg.tla:

  1. Replace non-constant checkpoint.chkp_slot with MAX_SLOT.
  2. ApaFoldSeqLeft over MkSeq would require a type annotation on the lambda. Replace it with ApaFoldSet over 1..N to emphasize that order of the underlying structure is irrelevant.