-
Hi, I'm trying to enhance performance of invariant safety checking in my project with apalache. Gradually I'm supplying my specs with type annotations. As far as i understand we must add type annotations to most of standard functions we use (i.e. from Sequences spec). I faced a strange type errors while checking a spec with EXCEPT construction. Say we have :
where id is of type U, Sessions is of type SESSIONS and ![id].SessionM, exprs are of type Seq(POLICY) The type checker says: [RuntimeFS.tla:174:32-174:39]: Need annotation. Found 2 matching operator signatures ((Str, a1333) => (Str -> a1333)) or ((Str, a1333) => [SessionM: a1333]) for arguments Str and a3388 E@12:26:09.934 So what annotation i need to add to fix it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @timimin, These messages can be hard to understand. Basically, what the type checker is complaining about is that it does not know, whether How do you annotate |
Beta Was this translation helpful? Give feedback.
-
)
it works... May be i had to recompile the extended module. Thanks. |
Beta Was this translation helpful? Give feedback.
Hi @timimin,
These messages can be hard to understand. Basically, what the type checker is complaining about is that it does not know, whether
Sessions[id]
is a function of strings to something, that is,(Str -> a1333)
, or it is a record that hasSessionM
as a field. Most likely, the type checker does not see the annotation ofSessions
. That happens sometimes, because the type checker gets the annotations as comments from the SANY parser.How do you annotate
Sessions
?