-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
TBuilderTypeException in type checking of TwoPhase spec #2682
Comments
Thank you for the report, @will62794, and sorry for the gnarly error message there! Fortunately the problem can be easily addressed in this case. You have
Which says the constant This addition will make your spec go thru + \* @typeAlias: RM = Str;
+ TypeAliases == TRUE
+
+ CInit ==
+ RM = {"a", "b"}
CONSTANT
\* @type: Set(RM);
RM \* The set of resource managers with
Note that I am only using This is discussed a bit in our manual here https://apalache.informal.systems/docs/adr/002adr-types.html?highlight=type%20alias#11-type-grammar-type-system-1-or-ts1 -- tho I apologize in advance for the documentation not being extremely clear on this point. You may also find https://apalache.informal.systems/docs/HOWTOs/howto-write-type-annotations.html?highlight=type%20alias#recipe-6-type-aliases useful. Please let me know if this doesn't unblock you! |
Thanks @shonfeder. I think your workaround makes sense but shouldn't there be a way to have Apalache correctly treat To give a bit more detail, in my config file I was setting
which perhaps isn't supported by Apalache in this setting. Based on that documentation page, perhaps it is more correct to instantiate the uninterpreted type concretely as
following the convention mentioned there. When I just tried defining
in my spec and then running $ apalache/bin/apalache-mc check --init=ApaInv --next=Next --inv=ApaInv --cinit=CInit benchmarks/TwoPhase.tla this appeared to avoid the error and model checking completed successfully. |
@will62794 you’ve found the correct way to set RM as an uninterpreted type and create value for it! Not knowing what was in your
there is a bug in Apalache in that we are letting an unhandled exception thru, and not catching this earlier in typechecking. But it looks like you also had an invalid cfg, which is arguably due to a bug in our documentation. thanks for following up with your fix, and again for the report. Let us know if you hit more snags! |
Alright, so here's the actual underlying problem:
Basically, Apalache typechecks the spec, which passes, since |
The issue with fixing this is, we'd have to somehow be able to support apalache type-annotations, and apalache uninterpreted-type values inside TLC config files to get sensible feedback on error (even if you write |
TODO note to self: investigate whether #2757 closed this issue too. |
Confirmed, using
and using |
Closed by #2757 |
Impact
Type-checking fails on a relatively small spec of two-phase commit, preventing successful bounded model checking or checking of inductive invariants.
Input specification
The command line parameters used to run the tool
Expected behavior
Expected type-checking to pass and model checker to start checking specified invariant.
Log files
System information
0.40.6 build 626668c
Linux
17.0.7
Triage checklist (for maintainers)
The text was updated successfully, but these errors were encountered: