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.
make fmt-fix
(or had formatting run automatically on all files edited)./unreleased/
for any new functionalityThis PR attempts to change the way the internal transpilation is performed, and, to a lesser extent, the SMT term representation.
The main issue is, that SMT separates two concepts: terms, and declarations/definitions. In an effort to make the transpilation "side-effect free",
FunDef
was introduced as aTerm
, which represented a function, to be defined in the SMT header, but used (by name) whereverFunDef
appeared in the syntax tree. Later, aCollector
would traverse the tree again, and extract the function definitions, along with any uninterpreted literals, which also needed to be declared.This is clunky, and does not scale with extensions to
Term
s. Instead, the new approach introduces rules asState
computations over a class which holds SMT declarations. This way, rules conceptually still translate TLA to SMT terms directly, but the internal declarations class keeps track of any declarations or definitions, which need to be introduced along the way.The PR also includes minor QoL changes, such as replacing case classes without parameters with case objects, and standardizing the use of
Seq
(instead of a mix ofSeq
andList
).