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

* and & don't coincide #3145

Open
mtzguido opened this issue Dec 8, 2023 · 1 comment
Open

* and & don't coincide #3145

mtzguido opened this issue Dec 8, 2023 · 1 comment

Comments

@mtzguido
Copy link
Member

mtzguido commented Dec 8, 2023

module ProdAssoc

let t1 = int * int * int
let t2 = int * int & int
let t3 = int & int * int
let t4 = int & int & int

--dump_module shows...

Module after type checking:
module ProdAssoc
Declarations: [
let t1 = Prims.int * Prims.int * Prims.int
let t2 = Prims.int * Prims.int * Prims.int
let t3 = Prims.int * Prims.int * Prims.int
let t4 = Prims.int * Prims.int * Prims.int
]
Exports: [
let t1 = Prims.int * Prims.int * Prims.int
let t2 = Prims.int * Prims.int * Prims.int
let t3 = Prims.int * Prims.int * Prims.int
let t4 = Prims.int * Prims.int * Prims.int
]

but! with --ugly we see

Module after type checking:
module ProdAssoc
Declarations: [
[@ ]
visible let  t1  : Type = (tuple3 int int int)
[@ ]
visible let  t2  : Type = (tuple2 (tuple2 int int) int)
[@ ]
visible let  t3  : Type = (tuple2 int (tuple2 int int))
[@ ]
visible let  t4  : Type = (tuple3 int int int)
]
Exports: [
[@ ]
visible let  t1  : Type = (tuple3 int int int)
[@ ]
visible let  t2  : Type = (tuple2 (tuple2 int int) int)
[@ ]
visible let  t3  : Type = (tuple2 int (tuple2 int int))
[@ ]
visible let  t4  : Type = (tuple3 int int int)
]

Verified module: ProdAssoc
All verification conditions discharged successfully

So

  1. The pretty printer is being very misleading with nested tuples and we should definitely fix that.
  2. Looks like & only "composes" with itself and not with * to make larger tuples. Maybe that's ok.
@TWal
Copy link
Contributor

TWal commented Dec 9, 2023

This reminds me of #2245, I don't know if it is related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants