Skip to content
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

Error: Conversion test raised an anomaly (polyproj) #78

Open
JasonGross opened this issue Feb 5, 2014 · 1 comment
Open

Error: Conversion test raised an anomaly (polyproj) #78

JasonGross opened this issue Feb 5, 2014 · 1 comment

Comments

@JasonGross
Copy link

Set Implicit Arguments.
Require Import Logic.

Global Set Universe Polymorphism.
Global Set Asymmetric Patterns.
Local Set Primitive Projections.

Local Open Scope type_scope.

Record prod (A B : Type) : Type :=
  pair { fst : A; snd : B }.

Arguments pair {A B} _ _.

Notation "x * y" := (prod x y) : type_scope.
Notation "( x , y , .. , z )" := (pair .. (pair x y) .. z) : core_scope.

Generalizable Variables X A B f g n.

Inductive paths {A : Type} (a : A) : A -> Type :=
  idpath : paths a a.

Arguments idpath {A a} , [A] a.

Notation "x = y :> A" := (@paths A x y) : type_scope.
Notation "x = y" := (x = y :>_) : type_scope.

Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
  match p with idpath => u end.

Definition transport_prod {A : Type} {P Q : A -> Type} {a a' : A} (p : a = a')
  (z : P a * Q a)
  : transport (fun a => P a * Q a) p z  =  (transport _ p (fst z), transport _ p (snd z))
  := match p with
       | idpath => idpath
     end.
(** Toplevel input, characters 15-255:
Error: Conversion test raised an anomaly *)

Adding an explicit return type (match p as p' return transport (fun a0 => P a0 * Q a0) p' z = (transport P p' (fst z), transport Q p' (snd z)) with) fixes the problem.

@JasonGross
Copy link
Author

Note that this is still open in trunk-polyproj (though you have to remove the Set Universe Polymorphism as per #124 to get it to accept the annotated

Definition transport_prod' {A : Type} {P Q : A -> Type} {a a' : A} (p : a = a')
  (z : P a * Q a)
  : transport (fun a => P a * Q a) p z  =  (transport _ p (fst z), transport _ p (snd z))
  := match p as p' return transport (fun a0 => P a0 * Q a0) p' z = (transport P p' (fst z), transport Q p' (snd z)) with
       | idpath => idpath
     end.

)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant