Skip to content

Commit

Permalink
Merge pull request #1553 from informalsystems/gabriela/fix-init-n-traces
Browse files Browse the repository at this point in the history
Hotfix: Properly reset metadata variables
  • Loading branch information
bugarela authored Nov 19, 2024
2 parents 649fd79 + 28486b1 commit ab48b6a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deprecated
### Removed
### Fixed

- Fixed a problem where traces other than the first one when `--n-traces` > 1
and `--mbt` is true had the incorrect `action_taken` and `nondet_picks` values
(#1553).

### Security

## v0.22.3 -- 2024-10-28
Expand Down
4 changes: 3 additions & 1 deletion quint/io-cli-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -894,14 +894,16 @@ rm out-itf-example.itf.json

<!-- !test in run with n-traces itf -->
```
quint run --out-itf=out-itf-example.itf.json --n-traces=3 --max-steps=5 --seed=123 ../examples/tutorials/coin.qnt
quint run --out-itf=out-itf-example.itf.json --n-traces=3 --mbt --max-steps=5 --seed=123 ../examples/tutorials/coin.qnt
cat out-itf-example0.itf.json | jq '.["#meta"].status'
cat out-itf-example1.itf.json | jq '.states[0].action_taken'
rm out-itf-example*.itf.json
```

<!-- !test out run with n-traces itf -->
```
"ok"
"init"
```

### Run to generate multiple ITF traces with violation
Expand Down
6 changes: 6 additions & 0 deletions quint/src/runtime/impl/VarStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ export class VarStorage {
reset() {
this.vars.forEach(reg => (reg.value = initialRegisterValue(reg.name)))
this.nextVars.forEach(reg => (reg.value = initialRegisterValue(reg.name)))
if (this.storeMetadata) {
this.actionTaken = undefined
this.nondetPicks.forEach((_, key) => {
this.nondetPicks.set(key, undefined)
})
}
}

/**
Expand Down

0 comments on commit ab48b6a

Please sign in to comment.