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

Error-trace shows a bag (multiset) like a sequence #250

Open
Tracked by #342
lemmy opened this issue Mar 15, 2022 · 5 comments
Open
Tracked by #342

Error-trace shows a bag (multiset) like a sequence #250

lemmy opened this issue Mar 15, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@lemmy
Copy link
Member

lemmy commented Mar 15, 2022

---- MODULE Braf ----
EXTENDS Bags, Naturals

VARIABLE x, y

Init ==
    /\ x = [ k \in {<<"a", "b">>, <<"b", "c">>} |-> 1 ]
    /\ y = 1

Next ==
    /\ UNCHANGED x
    /\ y' = y + 1

Inv ==
    y < 2

====
---- CONFIG Braf ----
INIT Init
NEXT Next
INVARIANT Inv
====

Screen Shot 2022-03-14 at 10 07 36 PM

Screen Shot 2022-03-14 at 10 11 19 PM


------ MODULE Traces -----

EXTENDS Naturals

VARIABLES x

Init ==
    x = 0

Next ==
    x' = 1

Inv ==
    x = 0

Alias ==
    [
        x |-> x
        , seq |-> <<4,5,6>>
        , seq2 |-> << <<4,5>>, <<5,6>>, <<6,7>> >>
        , s2f |-> << [ s \in {"d","c"} |-> <<s, "c">>], [ s \in {"e","f"} |-> 42] >>
        , fun |-> [ i \in 0..2 |-> i * 2 * x]
        , fn2f |-> [ i \in 0..2 |-> [ j \in 0..2 |-> j * i * 2 * x]]
        , s2n |-> [ s \in {"a","b"} |-> 42]
        , f2s |-> [ s \in {"a","b"} |-> <<s, "c">>]
        , f2f |-> [ s \in {"a","b"} |-> [ i \in {3,5,7} |-> i * 2]]
        , seq2n |-> [ k \in {<<"a", "b">>, <<"b", "c">>} |-> 23 ]
        , seq2s |-> [ k \in { {8,9}, {10,11}} |-> "ab" ]

        , seq2f |-> [ k \in { [{"a","b"} -> {TRUE}]} |-> "ab" ]
        , seq2f2 |-> [ k \in [{"a","b"} -> {TRUE, FALSE}] |-><< "ab", "de">> ]
    ]

=======
----- CONFIG Traces -----
INIT Init
NEXT Next
ALIAS Alias
INVARIANT Inv
======

Previous fix: #61

@lemmy lemmy added the bug Something isn't working label Oct 26, 2022
lemmy added a commit that referenced this issue Oct 26, 2022
@lemmy
Copy link
Member Author

lemmy commented Oct 26, 2022

I ran out of time! Any takers to update/refactor the now-removed tests in 1d9161c#diff-5ad2ff4a54440bf2b50b351c7d6092744831ab604bc4f3cbbda8757029a50b1b?

@lemmy lemmy closed this as completed Oct 26, 2022
@lemmy
Copy link
Member Author

lemmy commented Sep 6, 2023

The extension has only limited support for TLA+ functions, i.e., the domain (ValueKey) of its StructureValue can only be string or numeric. However, the domain may be any value in TLA+.

@lemmy
Copy link
Member Author

lemmy commented Sep 8, 2023

It's impossible to see which elements have been added with bags:

image

@afonsonf Would it be possible to highlight the added elements of a set in addition to adding the "A" label?

@FedericoPonzi
Copy link
Collaborator

FedericoPonzi commented Oct 10, 2024

This seems fixed in the latest version:
image
Or is anything else missing?

I derived the Acceptance Criteria to be: It should be clear what item was added to the Bag.
From the screenshot above, the item has an A near it, so I think the AC checks out.

@lemmy
Copy link
Member Author

lemmy commented Oct 10, 2024

Here's a screenshot of the same trace in both IDEs. If I recall correctly, Toolbox does a better job of highlighting added, removed, or modified values within deeply nested structures. However, I don't have time to reproduce that scenario right now. There may be existing Toolbox tests that cover this functionality.
Screenshot 2024-10-10 at 4 48 40 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants