Skip to content

Bad format of Json trace printing #47

Description

@tangruize

Hello! I learned printing a TLC error trace in #json format and tried the EWD840_json example:

sed -i '/^SendMsg/{n;d;}' EWD840.tla  # delete '/\ active[i]' below SendMsg
wget -q https://nightly.tlapl.us/dist/tla2tools.jar \
           https://modules.tlapl.us/releases/latest/download/CommunityModules-deps.jar
java -jar tla2tools.jar EWD840_json

TLC prints Error: Evaluating invariant JsonInv failed. and the traces. The trace.json file content is:

[

Is there something I made a mistake?

It seems JsonInv should not be violated since TLCSet("exit", TRUE). I replaced JsonSerialize("trace.json", Trace) with TRUE and TLC shows that JsonInv is not violated.

I tried another example DieHard, which violates the Inv big /= 4. TLC prints no trace and there is a trace.json file. I think this should be the expected behavior?

But after repeatedly running DieHard, I found the trace.json can be bad formatted:

[
{"big":0,"small":0},
{"big":5,"small":0},
{"big":2,"small":3},
{"big":2,"small":0},
{"big":0,"small":2},
{"big":5,"small":2},
{"big":4,"small":3}
]
"big":1,"small":3},
{"big":4,"small":0}
]

After trying the above, I think Json.tla might has a bug if my operations are correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions