Skip to content

Commit ab48b6a

Browse files
authored
Merge pull request #1553 from informalsystems/gabriela/fix-init-n-traces
Hotfix: Properly reset metadata variables
2 parents 649fd79 + 28486b1 commit ab48b6a

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Deprecated
1313
### Removed
1414
### Fixed
15+
16+
- Fixed a problem where traces other than the first one when `--n-traces` > 1
17+
and `--mbt` is true had the incorrect `action_taken` and `nondet_picks` values
18+
(#1553).
19+
1520
### Security
1621

1722
## v0.22.3 -- 2024-10-28

quint/io-cli-tests.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,14 +894,16 @@ rm out-itf-example.itf.json
894894

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

902903
<!-- !test out run with n-traces itf -->
903904
```
904905
"ok"
906+
"init"
905907
```
906908

907909
### Run to generate multiple ITF traces with violation

quint/src/runtime/impl/VarStorage.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ export class VarStorage {
140140
reset() {
141141
this.vars.forEach(reg => (reg.value = initialRegisterValue(reg.name)))
142142
this.nextVars.forEach(reg => (reg.value = initialRegisterValue(reg.name)))
143+
if (this.storeMetadata) {
144+
this.actionTaken = undefined
145+
this.nondetPicks.forEach((_, key) => {
146+
this.nondetPicks.set(key, undefined)
147+
})
148+
}
143149
}
144150

145151
/**

0 commit comments

Comments
 (0)