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

[ssr] "apply:" produces ill-typed terms #15659

Open
mrhaandi opened this issue Feb 10, 2022 · 1 comment
Open

[ssr] "apply:" produces ill-typed terms #15659

mrhaandi opened this issue Feb 10, 2022 · 1 comment
Labels
kind: bug An error, flaw, fault or unintended behaviour. part: ssreflect The SSReflect proof language.

Comments

@mrhaandi
Copy link
Contributor

Description of the problem

The following ssreflect example uses apply: to incorrectly arrive at No more subgoals for the goal Vector.t unit 0 -> False.
An ill-typed term is produced and detected only at Qed.
Standard Coq apply does not produce such an issue.

Possibly related: #11881 (uses apply /).

Require Vector.
Require Import ssreflect.

Lemma vec_fail (v : Vector.t unit 0) : False.
Proof.
  pattern v.
  apply: (Vector.case0 _ v).
  (* No more subgoals *)
Fail Qed.
(*
  The command has indeed failed with message:
  Illegal application: 
  The term "@Vector.case0" of type
  "forall (A : Type) (P : Vector.t A 0 -> Type),
  P (Vector.nil A) -> forall v : Vector.t A 0, P v"
  cannot be applied to the terms
  "unit" : "Set"
  "fun _ : Vector.t unit 0 => False" : "Vector.t unit 0 -> Prop"
  "v" : "Vector.t unit 0"
  "v" : "Vector.t unit 0"
  The 3rd term has type "Vector.t unit 0" which should be coercible to
  "(fun _ : Vector.t unit 0 => False) (Vector.nil unit)".
*)

Coq Version

The Coq Proof Assistant, version 8.15+rc1
compiled with OCaml 4.13.1
@Alizter
Copy link
Contributor

Alizter commented Feb 10, 2022

Also present in master d78e79c.

@Alizter Alizter added kind: bug An error, flaw, fault or unintended behaviour. part: ssreflect The SSReflect proof language. labels Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug An error, flaw, fault or unintended behaviour. part: ssreflect The SSReflect proof language.
Projects
None yet
Development

No branches or pull requests

2 participants