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
In the definition of subtyping adopted in the article, the SubApp rule states that subtyping between $f\ x$ and $f' x'$ can only be discussed when $x = x'$. The implementation follows this definition:
However, this definition seems to introduce suboptimal situations in the presence of constants.
Assume t @ list Type(α) ~ t' :. tR for a given list t containing types. Translating t @ list Type(β) by tR is therefore only authorised if list Type(α) is a subtype of list Type(β). In this case, the SubApp rule asserts that α = β, which is not necessarily true.
Indeed, we have:
tR : listR Type(α) Type(α) Param(α) t t'
which essentially means that for all values A and A' in t and t', Param(α) A A' holds. If α is higher than β, every proof Param(α) A A' can be weakened to Param(β) A A', which means the stronger witness tR at type list Type(α) should be acceptable when expecting a witness at type list Type(β). Therefore, we can state that list Type(α) is actually a subtype of list Type(β), without having α = β.
Are there concrete cases where the translation gets stuck because of this forced equality?
The text was updated successfully, but these errors were encountered:
Indeed, this is true for list essentially because we can map the weakening, i.e. list : Type(4,0) -> Type(4,0).
This is where Trocq could be used to feed its own subtyping mechanism.
In the definition of subtyping adopted in the article, the SubApp rule states that subtyping between$f\ x$ and $f' x'$ can only be discussed when $x = x'$ . The implementation follows this definition:
trocq/elpi/annot.elpi
Lines 70 to 73 in 95f083a
However, this definition seems to introduce suboptimal situations in the presence of constants.
Assume
t @ list Type(α) ~ t' :. tR
for a given listt
containing types. Translatingt @ list Type(β)
bytR
is therefore only authorised iflist Type(α)
is a subtype oflist Type(β)
. In this case, the SubApp rule asserts thatα = β
, which is not necessarily true.Indeed, we have:
which essentially means that for all values
A
andA'
int
andt'
,Param(α) A A'
holds. Ifα
is higher thanβ
, every proofParam(α) A A'
can be weakened toParam(β) A A'
, which means the stronger witnesstR
at typelist Type(α)
should be acceptable when expecting a witness at typelist Type(β)
. Therefore, we can state thatlist Type(α)
is actually a subtype oflist Type(β)
, without havingα = β
.Are there concrete cases where the translation gets stuck because of this forced equality?
The text was updated successfully, but these errors were encountered: