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

Use Dolmen type variables #1267

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

Halbaroth
Copy link
Collaborator

This PR is open to replace #1263:

  • Remove the useless mutable field in type variables.
  • Use directly the Dolmen type variables from Dolmen.

We do not need a value field in the type variable of Alt-Ergo.
These values were only used by the unification of the types in the legacy
typechecker.
@Halbaroth Halbaroth changed the title Remove mutable field variable and use Dolmen type variables Use Dolmen type variables Nov 12, 2024
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.

OK for me to merge with the requested change.

@@ -335,7 +335,7 @@ module SmtPrinter = struct

(* This printer follows the convention used to print
type variables in the module [Ty]. *)
let pp_tyvar ppf v = Fmt.pf ppf "A%d" v
let pp_tvar ppf v = Fmt.pf ppf "A%a" DE.Ty.Var.print v
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 pp_tvar ppf v = Fmt.pf ppf "A%a" DE.Ty.Var.print v
let pp_tvar ppf v = Fmt.pf ppf "%a" DE.Ty.Var.print v

"A" is already added to the name of the variable in fresh_tvar, and there is no need to add a prefix to variables from the problem (once we use them).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Indeed, it should work because it seems that we always call Ty.fresh_tvar() in Translate even if we do not need to call it on some type variables emitted by Dolmen. Otherwise, we could see type variables without this prefix. I remove the printer.

@Halbaroth Halbaroth enabled auto-merge (squash) November 12, 2024 12:48
@Halbaroth Halbaroth merged commit 9eb059d into OCamlPro:next Nov 12, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants