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
Coq requires that types that depend on each other have syntactically identical type parameters. Since the compiler does not check that, mutually recursive data definitions with differing type parameters are compiled into an invalid Coq program.
Steps to Reproduce
Translate the following mutually recursive data types with the compiler.
Compiled programs should always be valid Coq programs. The compiler should therefore try to avoid this error by renaming differing variables so they are the same.
In the case of a different number of type parameters, the compiler should either find a way to make them the same as well, or report an error.
Description
Coq requires that types that depend on each other have syntactically identical type parameters. Since the compiler does not check that, mutually recursive data definitions with differing type parameters are compiled into an invalid Coq program.
Steps to Reproduce
Translate the following mutually recursive data types with the compiler.
Behavior
The compiler translates the data type as follows:
This Coq code is not valid; it produces the error
Parameters should be syntactically the same for each inductive type.
On the other hand, the translation of
is valid in Coq because both
Foo
andBar
have the same parameters.The same problem arises when
Foo
andBar
have a different number of parameters:This definition also leads to invalid Coq code.
Expected Behavior
Compiled programs should always be valid Coq programs. The compiler should therefore try to avoid this error by renaming differing variables so they are the same.
In the case of a different number of type parameters, the compiler should either find a way to make them the same as well, or report an error.
Versions
ghc --version
:8.6.5
cabal --version
:3.2.0.0
coqc --version
:8.11.0
The text was updated successfully, but these errors were encountered: