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

Rebind #66

Merged
merged 4 commits into from
Jul 16, 2019
Merged

Rebind #66

merged 4 commits into from
Jul 16, 2019

Conversation

cdonovick
Copy link
Collaborator

resolves #65

@rdaly525
Copy link
Collaborator

I think I was not clear on what I wanted for #65

The use case I had in mind was something along the lines of:

class A_smt(Product):
  a = SMTBitVector[16]
  b = SMTBit

class A_bv(Product):
  a = BitVector[16]
  b = Bit

assert rebind_family(A_smt,BitVector.get_family()) == A_bv

Although it looks like I can use this code to create the above rebind_family()

@cdonovick
Copy link
Collaborator Author

cdonovick commented Jul 16, 2019

@rdaly525
You can achieve this by
A_smt.rebind(SMTBitVector, BitVector).rebind(SMTBit, Bit)

This is just more general allowing any type to rebound to any type,

@cdonovick cdonovick merged commit acabe3e into master Jul 16, 2019
@cdonovick cdonovick deleted the rebind branch July 16, 2019 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature-request] rebind(new_family) method on ADT types
2 participants