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

Unexpected failure of generic type unification #142

Open
yvting opened this issue Aug 15, 2022 · 0 comments
Open

Unexpected failure of generic type unification #142

yvting opened this issue Aug 15, 2022 · 0 comments
Assignees
Labels

Comments

@yvting
Copy link
Contributor

yvting commented Aug 15, 2022

Run the following script with Abella in the master branch:

Kind pair  type -> type -> type.

Define map : (A -> B) -> prop by
  map F.

Set types on.

Theorem map_destr_cons [A,B]: forall (F: (pair A B) -> A),
  map F -> false.
induction on 1. intros. case H1.

The last case analysis fails with the following message:

Error: Unification error during case analysis: the generic type variable A cannot be instantiated; instead it is instantiated to (pair A B).

Variables: 
  F : (pair A B) -> A
IH : forall F, map F * -> false
H1 : map F @
============================
 false

However, it is obvious the unification should have succeeded with the schematic type variables A and B in the definition of map instantiated with types pair A B and A, respectively, in which A and B are generic type variables.

It seems that the type unification algorithm incorrectly conflates the schematic type variable A in the definition of map with the generic type variable A in the proof.

@yvting yvting added the bug label Aug 15, 2022
@yvting yvting self-assigned this Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant