-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extensional conversions in F* (not included in EMF*) break subject reduction #1204
Comments
IIUC, the difference with Coq here is that we internalized treatment of The Coq equivalent of your example is this, I think: Definition coerce (A B: Type) (p: A = B) (a: A) : B :=
eq_rect A (fun T => T) a B p.
Definition test
(A B C: Type)
(x: A) (y: B) (z: C)
(p: (A -> B) = (A -> C)) :=
(coerce (A -> B) (A -> C) p (fun x => y)) x = z.
Compute test.
(* fun (A B C : Type) (x : A) (y : B) (z : C) (p : (A -> B) = (A -> C)) =>
match p in (_ = x0) return x0 with
| eq_refl => fun _ : A => y
end x = z *) Is this really a problem with open terms, though? For example, suppose I have A.fst like this:
then I can write this in
Evaluating This is probably pretty obvious, but the problem also happens with other constructors:
|
Along the same line, Andrej Bauer and Théo Winterhalter seem to have come up with a simple counter-example to subject reduction in Extensional Type Theory that is quite striking (and puzzling). The counter-example to SR boils down to the fact that the context with only an hypothesis From that, the term In order to recover SR in his work on conservativity of ETT over ITT, Théo Winterhalter used a "typed" beta-reduction where all lambda-abstractions and applications are annotated with both the types of the domain and the codomain, and the beta-reduction can happen only if these syntactically match. |
This is an example from Andrej Bauer via @leodemoura.
The term is well-typed but if you reduce the
coerce
and the beta redex you're left withy == z
which is ill-typed.I guess we say very little about reduction of open terms (e.g., open terms can diverge). But, this is still interesting and something to consider as we look to beef up EMF* to include more of F*.
In its current form, EMF* lacks the conversion rule needed to typecheck
coerce
although F* allows it.Thoughts?
The text was updated successfully, but these errors were encountered: