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

fix: Set/ValueVec support searching distinct typed elements #657

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

lalo
Copy link

@lalo lalo commented Aug 11, 2021

  • relax equals() - returns false instead of throwing (we can revert case by case)
  • add more advanced tests - nested sets
  • keep happy path for set of same typed elements
  • types are order based on their "ValueImage"/Kind int

See diff of tlatools/org.lamport.tlatools/test/tlc2/REPLTest.java for more info.

@lemmy lemmy added enhancement Lets change things for the better Tools The command line tools - TLC, SANY, ... labels Aug 12, 2021
- add best_effort_normalize_and_compare to SetEnumValue
- add specialized Exception type to avoid catching other TLCRuntimeExceptions
- relax equals() - returns false instead of throwing
- add more advanced tests - nested sets
- more of the same but have to confirm if correct
@@ -274,6 +329,8 @@ public final Value normalize() {
return this;
}
catch (RuntimeException | OutOfMemoryError e) {
// reset isNorm since it failed
this.isNorm = false;
Copy link
Author

Choose a reason for hiding this comment

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

this fixes un-normalized sets being classified as normalized, issue in latest main

@lalo lalo changed the title fix: ValueVec support searching distinct types fix: Set/ValueVec support searching distinct typed elements Aug 12, 2021
@lemmy
Copy link
Member

lemmy commented Aug 13, 2021

@lalo We appreciate your efforts and willingness to contribute. :-) Note though that we are generally very, very careful when it comes to changing the core of TLC. Without judging the quality of this PR (I haven't looked at it), please don't be discouraged should we decide that the proposed changes are too risky to be accepted. Real-world specs tend to be "well-typed".

@lalo lalo force-pushed the type-compare-repl branch 4 times, most recently from 8700960 to e907eb9 Compare August 14, 2021 05:44
@lalo
Copy link
Author

lalo commented Aug 16, 2021

I understand. It would be nice to see a spec that gets broken with this change, or have the full CI run to see how much damage this change is making. I've only ran the REPLtest and played around with the REPL.

@lemmy
Copy link
Member

lemmy commented Aug 16, 2021

Tests only ever confirm the presence of bugs, but you can run the TLC test suite with: ant -f tlatools/org.lamport.tlatools/customBuild.xml -Dtest.halt=true compile compile-test test.

@lalo
Copy link
Author

lalo commented Aug 16, 2021

assertEquals("Attempted to check equality of integer 0 with non-integer:\n\"abc\"", expVar[0].getValue());

This would return false now instead of raising exception.

@lemmy
Copy link
Member

lemmy commented Aug 16, 2021

The goal of this assertion is to test that the debugger raises an error on silly expressions. Thus, you could simply replace this particular expression with another silly expression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Lets change things for the better Tools The command line tools - TLC, SANY, ...
Development

Successfully merging this pull request may close these issues.

None yet

2 participants