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

Better operators overloading inference #665

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

strub
Copy link
Member

@strub strub commented Dec 5, 2024

This PR is about using more type information to resolve the overloading of operators. Currently, the following is now accepted:

require import AllCore List.

theory T.
  op o : int.
  op a : int -> int -> int.
end T.

theory U.
  op o : bool.
  op a : bool -> bool -> bool.
end U.

import T U.

op foo : int -> unit.

op bar = foo o.

op plop1 = foldr a false [].

op plop2 = foldr (fun x => a x) false [].

op plop3 = foldr (fun x y => a x y) false [].

@strub
Copy link
Member Author

strub commented Dec 5, 2024

Relates to #630

@strub strub force-pushed the better-ty-checking branch from a58a703 to 61ce35e Compare December 5, 2024 18:13
@strub strub self-assigned this Dec 5, 2024
@strub strub force-pushed the better-ty-checking branch from 61ce35e to 9d08c02 Compare December 23, 2024 09:24
This commit introduces a weak form a bi-directional typing, and
does a two-pass typing of overloading operators arguments.
@strub strub force-pushed the better-ty-checking branch from 9d08c02 to 848bf68 Compare January 6, 2025 09:23
@strub strub changed the title better overloading inference Better operators overloading inference Jan 6, 2025
@strub strub marked this pull request as ready for review January 6, 2025 09:24
@strub strub requested review from bgregoir and fdupress January 6, 2025 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant