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

Monomorphisation for using BDDs/analysis #30

Open
nickgian opened this issue Oct 16, 2019 · 0 comments
Open

Monomorphisation for using BDDs/analysis #30

nickgian opened this issue Oct 16, 2019 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@nickgian
Copy link
Collaborator

A function that uses BDDs (or some analyses that requires the types) may have polymorphic type which causes the interpreter to fail. For instance, the type of transFailure depends on transProt, and type inference gives the most general type for this which includes type quantifiers.

let transFailure transProt e x =
  let x = mapIf (fun e1 -> e = e1) (fun v -> None) x in
  mapIf (fun e1 -> !(e=e1)) (fun v -> transProt e v) x

The workaround for now is to inline and hence the type of transProt will be visible in the body of transFailure.
Another option would be to have a monomorphisation pass which creates specialized version of transFailure with the type of each different transProt that it's called with.
This is less intrusive than inlining.

@nickgian nickgian added bug Something isn't working enhancement New feature or request labels Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant