Open tneele opened 5 years ago
This is a fundamental problem of the typing system. The fact that an error is generated is understandable in this case. I tend to see this as a problem that may be resolved when reimplementing the type system for expressions. We may also consider adding some typing syntax when more changes apply to the language. I would like to rebaptise this is a feature request.
Consider the following specification
Linearising this fails with the message
The same can be observed with mcrl2i:
The fact that we declared
L
here has no effect, since the where expression introduces a new scope.The same issue likely occurs with sets and bags, which have the polymorphic constructor
{}
. I see that it is very difficult to typecheck such constructions. Perhaps the mCRL2 language would benefit from type annotation syntax, for exampleL = ([] type List(Pos))
, wheretype
is a new keyword. I have seen this in several other languages, such as Haskell and SMT-LIB2, so such syntax might be unavoidable in certain situations (this is a wild guess).