You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
There is no valid module type for modules using a functor #1235
The following fails with no way to fix it from what I can tell:
module type T = {}.
module type FT (M: T) = {
proc p(): bool
}.
module type A (M : T) (F : FT) = {
proc p() : bool
}.
module (C : A) (M : T) (F : FT) = {
proc p() = {
var b;
b <@ F(M).p();
return b;
}
}.
The error is:
the module C does not have the module type A:
procedure `p' is not compatible:
the function is not allowed to use F(M).p
This means you can't do things like abstract over games. Games take adversaries which are often functors.
If this is changed, care should be taken to ensure that the abstract call rule remains sound. I found this limitation while investigating what I thought was an unsoundness in the call rule, which turned out to be saved by this limitation.
If we intend to keep this limitation around, maybe we should emit an error already at the definition of A?
Activity