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

Add the operator Guess #1590

Merged
merged 14 commits into from
Apr 11, 2022
Merged

Add the operator Guess #1590

merged 14 commits into from
Apr 11, 2022

Conversation

konnov
Copy link
Collaborator

@konnov konnov commented Apr 4, 2022

Closes #888. This PR adds the operator Guess in Apalache.tla. The operator Guess(S) non-deterministically picks a value out of the set S. In this PR, Guess(S) and CHOOSE x \in S: TRUE behave the same. When #841 is closed, CHOOSE will become deterministic, whereas Guess will stay non-deterministic.

  • Tests added for any new code
  • Ran make fmt-fix (or had formatting run automatically on all files edited)
  • Documentation added for any new functionality
  • Entry added to UNRELEASED.md for any new functionality

@codecov-commenter
Copy link

codecov-commenter commented Apr 4, 2022

Codecov Report

Merging #1590 (200e693) into unstable (625b215) will increase coverage by 0.01%.
The diff coverage is 85.00%.

@@             Coverage Diff              @@
##           unstable    #1590      +/-   ##
============================================
+ Coverage     74.99%   75.00%   +0.01%     
============================================
  Files           361      361              
  Lines         11753    11771      +18     
  Branches        571      576       +5     
============================================
+ Hits           8814     8829      +15     
- Misses         2939     2942       +3     
Impacted Files Coverage Δ
...yte/apalache/tla/bmcmt/SymbStateRewriterImpl.scala 93.02% <ø> (ø)
.../apalache/tla/bmcmt/analyses/ExpansionMarker.scala 71.79% <0.00%> (-3.89%) ⬇️
...t/forsyte/apalache/tla/lir/oper/ApalacheOper.scala 66.66% <75.00%> (+0.87%) ⬆️
...e/apalache/tla/bmcmt/rules/ChooseOrGuessRule.scala 88.88% <88.88%> (ø)
.../at/forsyte/apalache/tla/imp/StandardLibrary.scala 100.00% <100.00%> (ø)
...forsyte/apalache/tla/typecheck/etc/ToEtcExpr.scala 94.47% <100.00%> (+0.04%) ⬆️
...in/scala/at/forsyte/apalache/tla/lir/Builder.scala 99.08% <100.00%> (+<0.01%) ⬆️
...ir/transformations/standard/KeraLanguagePred.scala 94.56% <100.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 625b215...200e693. Read the comment docs.

Copy link
Collaborator

@thpani thpani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Few minor comments below

docs/src/lang/apalache-operators.md Show resolved Hide resolved
src/tla/Apalache.tla Outdated Show resolved Hide resolved
src/tla/Apalache.tla Outdated Show resolved Hide resolved
src/tla/Apalache.tla Outdated Show resolved Hide resolved
test/tla/TestSets.tla Outdated Show resolved Hide resolved
src/tla/Apalache.tla Outdated Show resolved Hide resolved
@thpani
Copy link
Collaborator

thpani commented Apr 5, 2022

I think we also need to update #888. It says:

We will do that and let the tool report that CHOOSE is not supported.

src/tla/Apalache.tla Outdated Show resolved Hide resolved
Copy link
Collaborator

@Kukovec Kukovec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

docs/src/lang/apalache-operators.md Outdated Show resolved Hide resolved
@konnov konnov enabled auto-merge April 11, 2022 08:49
@konnov konnov merged commit f3f0695 into unstable Apr 11, 2022
This was referenced Apr 18, 2022
@shonfeder shonfeder deleted the ik/guess888 branch July 21, 2022 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Introduce operator Guess
5 participants