Skip to content

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
@strub strub merged commit cecd206 into main Jan 13, 2025
15 checks passed
@strub strub deleted the better-ty-checking branch January 13, 2025 13:56
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.

2 participants