Skip to content

Print type parameters of operators when not inferrable from arguments#966

Merged
strub merged 1 commit intomainfrom
fix-457
Apr 7, 2026
Merged

Print type parameters of operators when not inferrable from arguments#966
strub merged 1 commit intomainfrom
fix-457

Conversation

@strub
Copy link
Copy Markdown
Member

@strub strub commented Apr 5, 2026

When an operator has type parameters that cannot be inferred from the types of its provided arguments, the pretty-printer now automatically displays the type instantiation (e.g., card<:bool> instead of card).

A PP:showtvi flag (toggled via pragma +PP:showtvi) forces display of type parameters even when they are inferrable.

@strub strub self-assigned this Apr 5, 2026
@strub strub linked an issue Apr 5, 2026 that may be closed by this pull request
When an operator has type parameters that cannot be inferred from the
types of its provided arguments, the pretty-printer now automatically
displays the type instantiation (e.g., `card<:bool>` instead of `card`).

A `PP:showtvi` flag (toggled via `pragma +PP:showtvi`) forces display
of type parameters even when they are inferrable.
Copy link
Copy Markdown
Member

@alleystoughton alleystoughton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I tried things like

lemma test: card = (fun xs : int fset => 0) /\
            card = (fun xs : bool fset => 0).
proof.
(* 
(card<:int> = fun (_ : int fset) => 0) /\
card<:bool> = fun (_ : bool fset) => 0
*)

@strub strub added this pull request to the merge queue Apr 7, 2026
Merged via the queue into main with commit bcaa810 Apr 7, 2026
16 checks passed
@strub strub deleted the fix-457 branch April 7, 2026 15:45
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.

Printing type parameters of constants

2 participants