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

Family issues #208

Open
rdaly525 opened this issue Sep 18, 2020 · 2 comments
Open

Family issues #208

rdaly525 opened this issue Sep 18, 2020 · 2 comments
Assignees

Comments

@rdaly525
Copy link
Collaborator

rdaly525 commented Sep 18, 2020

This is a tracker for resolving family issues:

The major issue is that different codepaths make different assumptions regarding families

In a peak program there are 4 use cases of families.

(1) Type annotations on call
(2) Constant values
(3) Type matching for Sum/TaggedUnions
(4) Dynamic ADT constructors (family.get_constructor
(5) Type annotations on init values

We need to decide whether to use the passed in family or a particular kind of family (Py) for each of these 4 cases.

Constraints:
(2) needs to be the passed in family.
(4) needs to be the passed in family (I suspect)

Current state:
Some code paths assume (1) and (3) assume the family is Py and other assume it is the passed in family.

My preference is to have all 1-4 be using the passed in family.

@cdonovick
Copy link
Owner

cdonovick commented Sep 21, 2020

(4) Type constructors

Assuming you mean ADT constructors (the only user facing type constructors in peak other than BitVector). They are agnostic to all types, so I don't understand the constraint you later reference.

Some code paths assume (1) and (3) assume the family is Py

Which code paths? (See constraints for the one place I am aware of)

other assume it is the passed in family

Which code paths?

Constraints:

  • Magma requires the annotations be the assembled versions of an adt. To achieve this the magma family replaces the annotations with their assembled variants.
  • The assembler can only assemble py adts. Its doesn't know how to handle a Bits or SMTBitVector field. As there is no way to convert them to other bitvector types.

@rdaly525
Copy link
Collaborator Author

Sorry, yeah for (4) I meant the dynamic ADT value constructor methods ( family.get_constructor(T) ). For Py, this just returns the same type, and for SMT/Magma, it returns the relevant Assembled type's from_fields method.

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

No branches or pull requests

2 participants