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
F* admits a subtyping rule for effectful functions such that a -> b is a subtype of a -> GTot b. However this rule implies that a function f can have both the type a -> b and the type a -> GTot b, even though one extracts to a function while the other is erased.
We can use this rule to easily convert an erased ghost function to a total function and then call it:
This is accepted from (roughly) HasType f t and (= g f) in the encoding. Reminds me of #2069, a similar issue where the lack of universes in the encoding produces more equalities than there should be.
#1390 is another related issue. We reject subeffecting a -> Tot b into a -> Tac b since we need some internal marker to make sure the tactics normalize properly. Instead one can eta-expand (we also considered using coercive subtyping so the typechecker would automatically do it, but did not implement it).
I would imagine without that patch we run into the issue for tactics (reifiable effects in general). And also forbidding subeffecting of Tot arrows into GTot arrows, without eta expanding, would avoid this issue I think (but it would probably be painful for users).
F* admits a subtyping rule for effectful functions such that
a -> b
is a subtype ofa -> GTot b
. However this rule implies that a functionf
can have both the typea -> b
and the typea -> GTot b
, even though one extracts to a function while the other is erased.We can use this rule to easily convert an erased ghost function to a total function and then call it:
Extracting this module predictably results in an OCaml program that crashes when run:
The text was updated successfully, but these errors were encountered: