Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Apalache to 0.47.2 and update UNIT representation #1565

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
### Changed

- Bumped Apalache to 0.47.2 (#1565)

### Deprecated
### Removed
### Fixed

- Fixed a problem where calling `setOfMaps()` on empty sets resulted in errors in the simulator (#1561)

### Security

## v0.22.4 -- 2024-11-19
Expand Down
2 changes: 1 addition & 1 deletion quint/apalache-dist-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ quint verify --verbosity=1 ../examples/language-features/booleans.qnt | \

<!-- !test out server not running -->
```
Downloading Apalache distribution 0.46.1... done.
Downloading Apalache distribution 0.47.2... done.
[ok] No violation found (duration).
[ok] No violation found (duration).
```
6 changes: 3 additions & 3 deletions quint/apalache-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ VARIABLE
x

(*
@type: (() => A(UNIT) | B(Int));
@type: (() => A({ tag: Str }) | B(Int));
*)
A == Variant("A", "U_OF_UNIT")
A == Variant("A", [tag |-> "UNIT"])

(*
@type: ((Int) => A(UNIT) | B(Int));
@type: ((Int) => A({ tag: Str }) | B(Int));
*)
B(__BParam_31) == Variant("B", __BParam_31)

Expand Down
3 changes: 2 additions & 1 deletion quint/src/apalache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function serverEndpointToConnectionString(endpoint: ServerEndpoint): stri
return `${endpoint.hostname}:${endpoint.port}`
}

export const DEFAULT_APALACHE_VERSION_TAG = '0.46.1'
export const DEFAULT_APALACHE_VERSION_TAG = '0.47.2'
// TODO: used by GitHub api approach: https://github.com/informalsystems/quint/issues/1124
// const APALACHE_TGZ = 'apalache.tgz'

Expand Down Expand Up @@ -437,6 +437,7 @@ export async function connect(
const connectionResult = await tryConnect(serverEndpoint)
// We managed to connect, simply return this connection
if (connectionResult.isRight()) {
debugLog(verbosityLevel, 'Connecting with existing Apalache server')
return connectionResult
}

Expand Down
11 changes: 5 additions & 6 deletions quint/src/itf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,6 @@ export function ofItf(itf: ItfTrace): QuintEx[] {
if (typeof value === 'boolean') {
return { id, kind: 'bool', value }
} else if (typeof value === 'string') {
if (value === 'U_OF_UNIT') {
// Apalache converts empty tuples to its unit value, "U_OF_UNIT".
// We need to convert it back to Quint's unit value, the empty tuple.
return { id, kind: 'app', opcode: 'Tup', args: [] }
}

return { id, kind: 'str', value }
} else if (isBigint(value)) {
// this is the standard way of encoding an integer in ITF.
Expand Down Expand Up @@ -226,6 +220,11 @@ export function ofItf(itf: ItfTrace): QuintEx[] {
}
} else if (isVariant(value)) {
const l = ofItfValue(value.tag)
if (l.kind === 'str' && l.value === 'UNIT') {
// Apalache converts empty tuples to its unit value, { tag: "UNIT" }.
// We need to convert it back to Quint's unit value, the empty tuple.
return { id, kind: 'app', opcode: 'Tup', args: [] }
}
const v = ofItfValue(value.value)
return { id, kind: 'app', opcode: 'variant', args: [l, v] }
} else if (typeof value === 'object') {
Expand Down
2 changes: 1 addition & 1 deletion quint/test/itf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('toItf', () => {
'#meta': {
index: 0,
},
a: 'U_OF_UNIT',
a: { tag: 'UNIT' },
},
],
}
Expand Down
Loading