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

Lean: List Int to Nat conversion #1091

Open
Alasdair opened this issue Feb 28, 2025 · 2 comments
Open

Lean: List Int to Nat conversion #1091

Alasdair opened this issue Feb 28, 2025 · 2 comments
Assignees
Labels
Lean Issues with Sail to Lean translation

Comments

@Alasdair
Copy link
Collaborator

One test fails with (The aptly named list_torture):

error: ././././Out.lean:126:41: application type mismatch
  Exc_list_int xs
argument
  xs
has type
  List Nat : Type
but is expected to have type
  List Int : Type

so we need at least a List Nat to List Int conversion. But there is likely a more general problem when we start nesting types like list(option(list(nat))) and list(option(list(int))) in Sail.

@Alasdair Alasdair added the Lean Issues with Sail to Lean translation label Feb 28, 2025
@Alasdair
Copy link
Collaborator Author

I made a test case of the awkward version:

has type
  List (Option (wrapper (List (Option (wrapper (List (Option (wrapper Nat)))))))) : Type
but is expected to have type
  List (Option (wrapper (List (Option (wrapper (List (Option (wrapper Int)))))))) : Type

@javra javra self-assigned this Mar 5, 2025
@javra
Copy link
Collaborator

javra commented Mar 5, 2025

I think there's not going to be a problem with the nested cases because of the way we'd set up the coercions.

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

No branches or pull requests

2 participants