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

Remove uid module #1253

Merged
merged 9 commits into from
Oct 9, 2024
Merged

Remove uid module #1253

merged 9 commits into from
Oct 9, 2024

Conversation

Halbaroth
Copy link
Collaborator

@Halbaroth Halbaroth commented Oct 8, 2024

This PR removes the interface Uid. We now use term_cst and ty_cst
of Dolmen directly!

@Halbaroth Halbaroth marked this pull request as ready for review October 9, 2024 09:28
@Halbaroth
Copy link
Collaborator Author

Strangely, it seems that the test testfile-qfbv-timeout.unix.smt2 failed sometimes. I ran it again on next and it succeeds. I got an error code 2 on next and here it is 1!

Copy link
Collaborator

@bclement-ocp bclement-ocp left a comment

Choose a reason for hiding this comment

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

testfile-qfbv-timeout.unix.smt2 is known to be flaky at times. Although #1245 might have made it worse; I will look into it.

On the PR itself — nothing to say except a small nitpick on tcst_of_rounding_mode, looks good to me.

@@ -748,14 +744,14 @@ let handle_patt_var id (DE.{ term_descr; _ } as term) =
match term_descr with
| Cst ({ builtin = B.Base; id_ty; _ } as ty_c) ->
let ty = dty_to_ty id_ty in
let v = Var.of_string @@ Uid.show id in
let v = Var.of_string @@ Fmt.str "%a" DE.Term.Const.print id in
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
let v = Var.of_string @@ Fmt.str "%a" DE.Term.Const.print id in
let v = Var.of_string @@ Fmt.to_to_string DE.Term.Const.print id in

let sy = Sy.Var v in
Cache.store_sy ty_c sy;
v, id, ty

| Var ({ builtin = B.Base; id_ty; _ } as ty_v) ->
let ty = dty_to_ty id_ty in
let v = Var.of_string @@ Uid.show id in
let v = Var.of_string @@ Fmt.str "%a" DE.Term.Const.print id in
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
let v = Var.of_string @@ Fmt.str "%a" DE.Term.Const.print id in
let v = Var.of_string @@ Fmt.to_to_string DE.Term.Const.print id in

@@ -924,10 +920,9 @@ let mk_add translate sy ty l =
E.mk_term sy args ty

let mk_rounding fpar =
let name = Hstring.make @@ Fpa_rounding.string_of_rounding_mode fpar in
let tcst = Fpa_rounding.tcst_of_rounding_mode fpar in
Copy link
Collaborator

Choose a reason for hiding this comment

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

tcst_of_rounding_mode is a confusing name — the t before cst implies we want to distinguish with other kinds of constructors, but does t mean "term" or "type"?

I think this should be called either term_cst_of_rounding_mode (what a mouthful!) or cst_of_rounding_mode, which is as expressive as tcst_of_rounding_mode due to the ambiguity but less confusing.

@Halbaroth Halbaroth enabled auto-merge (squash) October 9, 2024 10:16
@Halbaroth Halbaroth merged commit 6dbbae3 into OCamlPro:next Oct 9, 2024
17 checks passed
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